From 52c33da0654788ebd1c319ee9c0e5864322cf9c3 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Tue, 18 Feb 2025 11:02:07 -0500 Subject: [PATCH 01/20] Trying to add a Linux test via GitHub Actions --- .github/workflows/test_linux.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/test_linux.yml diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml new file mode 100644 index 00000000..18fc566e --- /dev/null +++ b/.github/workflows/test_linux.yml @@ -0,0 +1,30 @@ +name: Test Linux + +on: [push, pull_request] + +jobs: + test-linux: + name: Test Linux + runs-on: ubuntu-latest + steps: + - name: "Check out the repo" + uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install system dependencies + run: | + sudo apt update && sudo apt install -y libgl1 libglx-mesa0 + + - name: Install nimble packages and dev tools + run: | + pip install -e .[dev] + pip list + + - name: Run tests + uses: coactions/setup-xvfb@v1 + with: + run: pytest \ No newline at end of file From ca6c8198f9854b9ccf2a26919268503437809124 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Tue, 18 Feb 2025 11:06:46 -0500 Subject: [PATCH 02/20] Making sure all test packages are installed --- .github/workflows/test_linux.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 18fc566e..1051ecb3 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -21,7 +21,8 @@ jobs: - name: Install nimble packages and dev tools run: | - pip install -e .[dev] + pip install -e . + pip install .[test] pip list - name: Run tests From f6ad216d38631c0c2cbf29c5c1d318967dd939a2 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 10:36:08 -0500 Subject: [PATCH 03/20] Make PyQt5 explicit in deps --- .github/workflows/test_linux.yml | 2 +- pyproject.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 1051ecb3..8551c07b 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -19,7 +19,7 @@ jobs: run: | sudo apt update && sudo apt install -y libgl1 libglx-mesa0 - - name: Install nimble packages and dev tools + - name: Install packages run: | pip install -e . pip install .[test] diff --git a/pyproject.toml b/pyproject.toml index a64af0d8..1afe10cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,6 +7,7 @@ name = "CQ-editor" version = "0.6" dependencies = [ "cadquery", + "PyQt5", "pyqtgraph", "qtawesome==1.4.0", "path", From 44d95477bbe0a4140ed62fd195a6cb726752a5b6 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 10:40:09 -0500 Subject: [PATCH 04/20] Trying an older runner to see if it fixes the segfault --- .github/workflows/test_linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 8551c07b..ec57fe2b 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: test-linux: name: Test Linux - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: "Check out the repo" uses: actions/checkout@v3 From 084a602ed5f6e07d5f3caaebc0dd7ed98bc52c0a Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 10:43:32 -0500 Subject: [PATCH 05/20] Pinning to the latest version of setup-xvfb --- .github/workflows/test_linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index ec57fe2b..6800cdf0 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: test-linux: name: Test Linux - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: "Check out the repo" uses: actions/checkout@v3 @@ -26,6 +26,6 @@ jobs: pip list - name: Run tests - uses: coactions/setup-xvfb@v1 + uses: coactions/setup-xvfb@v1.0.1 with: run: pytest \ No newline at end of file From 1e5d46a8f3d33b57df8c57d6e1082695022db819 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 10:51:18 -0500 Subject: [PATCH 06/20] Trying to make sure all OpenGL deps are installed --- .github/workflows/test_linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 6800cdf0..2a78ad17 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -17,7 +17,7 @@ jobs: - name: Install system dependencies run: | - sudo apt update && sudo apt install -y libgl1 libglx-mesa0 + sudo apt update && sudo apt install -y libgl1 libglx-mesa0 libgl1-mesa-dri libglu1-mesa libegl1-mesa mesa-utils libopengl0 - name: Install packages run: | From 6dbceb332fe211f3391185a43ccbb789fd532891 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 10:54:11 -0500 Subject: [PATCH 07/20] Trying with older version of Ubuntu --- .github/workflows/test_linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 2a78ad17..f62a4e40 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: test-linux: name: Test Linux - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: "Check out the repo" uses: actions/checkout@v3 From 146759acc4da3cf5ea3124366523f8c707f9df59 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 10:56:45 -0500 Subject: [PATCH 08/20] Trying to add environment variable to fix segfault --- .github/workflows/test_linux.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index f62a4e40..8013d768 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -26,6 +26,8 @@ jobs: pip list - name: Run tests + env: + LIBGL_ALWAYS_SOFTWARE: "1" uses: coactions/setup-xvfb@v1.0.1 with: run: pytest \ No newline at end of file From 557befac4c9ee182e660e6fa7e2114f98b26a567 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 11:05:06 -0500 Subject: [PATCH 09/20] Adding more environment variables --- .github/workflows/test_linux.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 8013d768..3ce24c21 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -28,6 +28,8 @@ jobs: - name: Run tests env: LIBGL_ALWAYS_SOFTWARE: "1" + QT_QPA_PLATFORM: "offscreen" + QT_OPENGL: "software" uses: coactions/setup-xvfb@v1.0.1 with: - run: pytest \ No newline at end of file + run: pytest From 21eb5fcd746c5d3fd4b5aa10ca17461061a7d8fb Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 11:08:44 -0500 Subject: [PATCH 10/20] Trying different environment variable config --- .github/workflows/test_linux.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 3ce24c21..8f4fd668 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -28,8 +28,9 @@ jobs: - name: Run tests env: LIBGL_ALWAYS_SOFTWARE: "1" - QT_QPA_PLATFORM: "offscreen" QT_OPENGL: "software" + QT_QPA_PLATFORM: "minimal" + QT_XCB_GL_INTEGRATION: "none" uses: coactions/setup-xvfb@v1.0.1 with: run: pytest From af4c17e8d63716fe11d31d17a9ef8c7c1c156c9e Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 11:16:07 -0500 Subject: [PATCH 11/20] Trying to fix fonts on headless --- .github/workflows/test_linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 8f4fd668..95160759 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -17,7 +17,7 @@ jobs: - name: Install system dependencies run: | - sudo apt update && sudo apt install -y libgl1 libglx-mesa0 libgl1-mesa-dri libglu1-mesa libegl1-mesa mesa-utils libopengl0 + sudo apt update && sudo apt install -y libgl1 libglx-mesa0 libgl1-mesa-dri libglu1-mesa libegl1-mesa mesa-utils libopengl0 fontconfig fonts-dejavu-core - name: Install packages run: | From 40ad20ad1903d96f4463092cb4ddd8c57f03db6e Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 11:21:02 -0500 Subject: [PATCH 12/20] Still trying to fix fonts --- .github/workflows/test_linux.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 95160759..da154e2e 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -18,6 +18,7 @@ jobs: - name: Install system dependencies run: | sudo apt update && sudo apt install -y libgl1 libglx-mesa0 libgl1-mesa-dri libglu1-mesa libegl1-mesa mesa-utils libopengl0 fontconfig fonts-dejavu-core + sudo fc-cache -f - name: Install packages run: | @@ -29,7 +30,7 @@ jobs: env: LIBGL_ALWAYS_SOFTWARE: "1" QT_OPENGL: "software" - QT_QPA_PLATFORM: "minimal" + QT_QPA_PLATFORM: "offscreen" QT_XCB_GL_INTEGRATION: "none" uses: coactions/setup-xvfb@v1.0.1 with: From ce2dcabac849eb9199f661b4281973f60f2c4fe5 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 11:26:01 -0500 Subject: [PATCH 13/20] Trying to switch to the XCB plugin --- .github/workflows/test_linux.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index da154e2e..6bfec7ed 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -17,7 +17,7 @@ jobs: - name: Install system dependencies run: | - sudo apt update && sudo apt install -y libgl1 libglx-mesa0 libgl1-mesa-dri libglu1-mesa libegl1-mesa mesa-utils libopengl0 fontconfig fonts-dejavu-core + sudo apt update && sudo apt install -y libgl1 libglx-mesa0 libgl1-mesa-dri libglu1-mesa libegl1-mesa mesa-utils libopengl0 fontconfig fonts-dejavu-core libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 sudo fc-cache -f - name: Install packages @@ -30,8 +30,7 @@ jobs: env: LIBGL_ALWAYS_SOFTWARE: "1" QT_OPENGL: "software" - QT_QPA_PLATFORM: "offscreen" - QT_XCB_GL_INTEGRATION: "none" + QT_QPA_PLATFORM: "xcb" uses: coactions/setup-xvfb@v1.0.1 with: run: pytest From ddbc46dda11e50237dc5535a3ab4ba43af3d20ce Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 11:28:43 -0500 Subject: [PATCH 14/20] Trying even more environment variables --- .github/workflows/test_linux.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 6bfec7ed..796d22ee 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -29,8 +29,11 @@ jobs: - name: Run tests env: LIBGL_ALWAYS_SOFTWARE: "1" + MESA_LOADER_DRIVER_OVERRIDE: "swrast" + GALLIUM_DRIVER: "llvmpipe" QT_OPENGL: "software" QT_QPA_PLATFORM: "xcb" + QT_XCB_GL_INTEGRATION: "none" uses: coactions/setup-xvfb@v1.0.1 with: run: pytest From a69b9fe275ee32e1f17ba3267c3aafa90ee18545 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 11:33:50 -0500 Subject: [PATCH 15/20] Different configuration --- .github/workflows/test_linux.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 796d22ee..c8b904cc 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -17,7 +17,14 @@ jobs: - name: Install system dependencies run: | - sudo apt update && sudo apt install -y libgl1 libglx-mesa0 libgl1-mesa-dri libglu1-mesa libegl1-mesa mesa-utils libopengl0 fontconfig fonts-dejavu-core libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 + sudo apt update && sudo apt install -y \ + xvfb xauth \ + libgl1 libglx-mesa0 libgl1-mesa-dri libglu1-mesa libegl1-mesa mesa-utils libopengl0 \ + libx11-6 libx11-xcb1 libxext6 libxrender1 libsm6 libice6 libxxf86vm1 libxdamage1 libxfixes3 \ + libxcb-glx0 libxcb-dri2-0 libxcb-dri3-0 libxcb-present0 libxcb-shape0 libxcb-shm0 libxcb-sync1 \ + libxcb-xfixes0 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \ + libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 \ + fontconfig fonts-dejavu-core sudo fc-cache -f - name: Install packages @@ -31,9 +38,9 @@ jobs: LIBGL_ALWAYS_SOFTWARE: "1" MESA_LOADER_DRIVER_OVERRIDE: "swrast" GALLIUM_DRIVER: "llvmpipe" + LIBGL_DRIVERS_PATH: "/usr/lib/x86_64-linux-gnu/dri" QT_OPENGL: "software" QT_QPA_PLATFORM: "xcb" - QT_XCB_GL_INTEGRATION: "none" uses: coactions/setup-xvfb@v1.0.1 with: run: pytest From 11844d969bac23899ff1c130d66471692341632a Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 16 Jan 2026 11:52:41 -0500 Subject: [PATCH 16/20] Trying to suppress the ipython banner --- cq_editor/widgets/console.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cq_editor/widgets/console.py b/cq_editor/widgets/console.py index f28cfbfe..95bf7dcb 100644 --- a/cq_editor/widgets/console.py +++ b/cq_editor/widgets/console.py @@ -49,6 +49,8 @@ def __init__(self, customBanner=None, namespace=dict(), *args, **kwargs): self.kernel_manager = kernel_manager = QtInProcessKernelManager() kernel_manager.start_kernel(show_banner=False) + kernel_manager.kernel.shell.display_banner = False + kernel_manager.kernel.shell.banner1 = "" kernel_manager.kernel.gui = "qt" kernel_manager.kernel.shell.banner1 = "" From 4b25eb71b10570bdc104c085f3161049a39f07f3 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Wed, 25 Feb 2026 16:52:03 -0500 Subject: [PATCH 17/20] Trying to fix C++ objects being used after teardown --- cq_editor/widgets/console.py | 12 +++++++++++- cq_editor/widgets/log.py | 29 +++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/cq_editor/widgets/console.py b/cq_editor/widgets/console.py index 95bf7dcb..75cda2a7 100644 --- a/cq_editor/widgets/console.py +++ b/cq_editor/widgets/console.py @@ -52,7 +52,6 @@ def __init__(self, customBanner=None, namespace=dict(), *args, **kwargs): kernel_manager.kernel.shell.display_banner = False kernel_manager.kernel.shell.banner1 = "" kernel_manager.kernel.gui = "qt" - kernel_manager.kernel.shell.banner1 = "" self.kernel_client = kernel_client = self._kernel_manager.client() kernel_client.start_channels() @@ -68,6 +67,17 @@ def stop(): self.push_vars(namespace) + def _append_plain_text(self, text, *args, **kwargs): + """ + Overrides the super's method to filter out IPython tips. + """ + # Drop IPython startup tips (including the unicode completion tip) + # Done because turning the banner off does not work + if isinstance(text, str) and text.lstrip().startswith("Tip:"): + return + + return super(ConsoleWidget, self)._append_plain_text(text, *args, **kwargs) + @pyqtSlot(dict) def push_vars(self, variableDict): """ diff --git a/cq_editor/widgets/log.py b/cq_editor/widgets/log.py index 91855820..56275324 100644 --- a/cq_editor/widgets/log.py +++ b/cq_editor/widgets/log.py @@ -38,10 +38,32 @@ def __init__(self, log_widget, *args, **kwargs): self._qobject = _QtLogHandlerQObject() self._qobject.sigRecordEmit.connect(log_widget.append) + self._is_closed = False def emit(self, record): - self._qobject.sigRecordEmit.emit(self.format(record) + "\n") - + # Skip emit if handler has been closed + if self._is_closed or self._qobject is None: + # No-op when Qt side is no longer valid + return + + # Protect signal emission against Qt object lifetime race at shutdown + try: + self._qobject.sigRecordEmit.emit(self.format(record) + "\n") + # Catch wrapped C/C++ deletion error during teardown + except RuntimeError: + # Mark handler closed so future emits are ignored + self._is_closed = True + # Drop QObject reference to avoid further access + self._qobject = None + + # Explicit close hook to safely disable handler at teardown + def close(self): + # Mark handler as closed + self._is_closed = True + # Release QObject reference + self._qobject = None + # Preserve base class close behavior + super(QtLogHandler, self).close() class LogViewer(QPlainTextEdit, ComponentMixin): @@ -64,6 +86,9 @@ def __init__(self, *args, **kwargs): self.handler = QtLogHandler(self) + # Ensure handler is closed when widget is destroyed + self.destroyed.connect(lambda *_: self.handler.close()) + def append(self, msg): """Append text to the panel with ANSI escape sequences stipped.""" self.moveCursor(QtGui.QTextCursor.End) From c84449fde57e7d370cdc37eed57e8c2d6aa84f11 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Wed, 25 Feb 2026 16:54:03 -0500 Subject: [PATCH 18/20] Obligatory lint fix --- cq_editor/cqe_run.py | 1 - cq_editor/widgets/code_editor.py | 1 - cq_editor/widgets/log.py | 1 + cq_editor/widgets/occt_widget.py | 1 - cq_editor/widgets/viewer.py | 1 - run.py | 1 - 6 files changed, 1 insertion(+), 5 deletions(-) diff --git a/cq_editor/cqe_run.py b/cq_editor/cqe_run.py index 038f7d31..622bd9ef 100644 --- a/cq_editor/cqe_run.py +++ b/cq_editor/cqe_run.py @@ -8,6 +8,5 @@ from cq_editor.__main__ import main - if __name__ == "__main__": main() diff --git a/cq_editor/widgets/code_editor.py b/cq_editor/widgets/code_editor.py index 98af9cb9..b7946407 100644 --- a/cq_editor/widgets/code_editor.py +++ b/cq_editor/widgets/code_editor.py @@ -4,7 +4,6 @@ from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import QPalette, QColor - DARK_BLUE = QtGui.QColor(118, 150, 185) diff --git a/cq_editor/widgets/log.py b/cq_editor/widgets/log.py index 56275324..1e9dd911 100644 --- a/cq_editor/widgets/log.py +++ b/cq_editor/widgets/log.py @@ -65,6 +65,7 @@ def close(self): # Preserve base class close behavior super(QtLogHandler, self).close() + class LogViewer(QPlainTextEdit, ComponentMixin): name = "Log viewer" diff --git a/cq_editor/widgets/occt_widget.py b/cq_editor/widgets/occt_widget.py index 58aac382..b2bebfd3 100755 --- a/cq_editor/widgets/occt_widget.py +++ b/cq_editor/widgets/occt_widget.py @@ -13,7 +13,6 @@ from OCP.AIS import AIS_InteractiveContext, AIS_DisplayMode from OCP.Quantity import Quantity_Color - ZOOM_STEP = 0.9 diff --git a/cq_editor/widgets/viewer.py b/cq_editor/widgets/viewer.py index ed42ae27..1e9cf343 100644 --- a/cq_editor/widgets/viewer.py +++ b/cq_editor/widgets/viewer.py @@ -29,7 +29,6 @@ from pyqtgraph.parametertree import Parameter import qtawesome as qta - DEFAULT_EDGE_COLOR = Quantity_Color(BLACK) DEFAULT_EDGE_WIDTH = 2 diff --git a/run.py b/run.py index 606ac60f..7401a916 100644 --- a/run.py +++ b/run.py @@ -11,6 +11,5 @@ from cq_editor.__main__ import main - if __name__ == "__main__": main() From 170add41a24e8645cdf77649e3874e1d7a9bb720 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Wed, 25 Feb 2026 17:05:15 -0500 Subject: [PATCH 19/20] Trying to get the dynamically created module for the import test to be reliable --- tests/test_app.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/test_app.py b/tests/test_app.py index 12894dc4..4c1c49f1 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -982,7 +982,7 @@ def test_viewer(main): assert(dummy())""" -def test_module_import(main): +def test_module_import(main, tmp_path, monkeypatch): qtbot, win = main @@ -990,12 +990,17 @@ def test_module_import(main): debugger = win.components["debugger"] traceback_view = win.components["traceback_viewer"] + # isolate test files in a temp directory + monkeypatch.chdir(tmp_path) + # save the dummy module - with open("module.py", "w") as f: - f.write(code_module) + module_file = tmp_path / "module.py" + module_file.write_text(code_module) # run the code importing this module - editor.set_text(code_import) + script_file = tmp_path / "main.py" + script_file.write_text(code_import) + editor.load_from_file(str(script_file)) debugger._actions["Run"][0].triggered.emit() # verify that no exception was generated From edc0449031fedc33116e0d8a82bb5ba48af3255f Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Wed, 25 Feb 2026 17:21:40 -0500 Subject: [PATCH 20/20] Removed appveyor config --- appveyor.yml | 56 ---------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 4797723a..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,56 +0,0 @@ -shallow_clone: false - -image: - - Ubuntu2204 - - Visual Studio 2019 - -environment: - matrix: - - PYTEST_QT_API: pyqt5 - CODECOV_TOKEN: - secure: ZggK9wgDeFdTp0pu0MEV+SY4i/i1Ls0xrEC2MxSQOQ0JQV+TkpzJJzI4au7L8TpD - MINICONDA_DIRNAME: C:\FreshMiniconda - -install: - - sh: if [[ $APPVEYOR_BUILD_WORKER_IMAGE != "macOS"* ]]; then sudo apt update; sudo apt -y --force-yes install libglu1-mesa xvfb libgl1-mesa-dri mesa-common-dev libglu1-mesa-dev; fi - - sh: if [[ $APPVEYOR_BUILD_WORKER_IMAGE != "macOS"* ]]; then curl -fsSL -o miniconda.sh https://github.com/conda-forge/miniforge/releases/download/25.3.1-0/Miniforge3-Linux-x86_64.sh; fi - - sh: if [[ $APPVEYOR_BUILD_WORKER_IMAGE == "macOS"* ]]; then curl -fsSL -o miniconda.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Darwin-x86_64.sh; fi - - sh: bash miniconda.sh -b -p $HOME/miniconda - - sh: source $HOME/miniconda/bin/activate - - cmd: curl -fsSL -o miniconda.exe https://github.com/conda-forge/miniforge/releases/download/24.11.3-2/Miniforge3-Windows-x86_64.exe - - cmd: miniconda.exe /S /InstallationType=JustMe /D=%MINICONDA_DIRNAME% - - cmd: set "PATH=%MINICONDA_DIRNAME%;%MINICONDA_DIRNAME%\\Scripts;%PATH%" - - cmd: activate - - conda info - - conda env create -y --name cqgui -f cqgui_env.yml - - sh: source activate cqgui - - cmd: activate cqgui - - conda list - - conda install -y pytest pluggy pytest-qt - - conda install -y pytest-mock pytest-cov pytest-repeat codecov pyvirtualdisplay - -build: false - -before_test: - - sh: ulimit -c unlimited -S - - sh: sudo rm -f /cores/core.* - -test_script: - - sh: export PYTHONPATH=$(pwd) - - cmd: set PYTHONPATH=%cd% - - sh: if [[ $APPVEYOR_BUILD_WORKER_IMAGE != "macOS"* ]]; then xvfb-run -s '-screen 0 1920x1080x24 +iglx' pytest -v --cov=cq_editor; fi - - sh: if [[ $APPVEYOR_BUILD_WORKER_IMAGE == "macOS"* ]]; then pytest -v --cov=cq_editor; fi - - cmd: pytest -v --cov=cq_editor - -on_success: - - codecov - -#on_failure: -# - qtdiag -# - ls /cores/core.* -# - lldb --core `ls /cores/core.*` --batch --one-line "bt" - -on_finish: -# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) -# - sh: export APPVEYOR_SSH_BLOCK=true -# - sh: curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -