From 417feb4f479956d79689e4c0cb9de065a6e4316d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 26 Sep 2026 10:33:12 -0400 Subject: [PATCH] CI: Test standalone import after pip install (not for merge) A plain `python -c "from grass.pygrass import utils"` run before the "Install additional python packages" step succeeds (see ci-diag/standalone-import-test), but pytest/python -m pytest collecting the same import after that step crashes with "Windows fatal exception: code 0xc0000139" (see ci-diag/no-xdist-single-process and ci-diag/python-m-pytest-vs-exe). None of pytest/pytest-xdist/execnet/ pytest-timeout/pytest-randomly/colorama declare a pywin32 dependency (checked via PyPI metadata), so this isn't a duplicate pywin32 install conflict, a scenario pywin32's own README explicitly blames for this same generic Windows error text ("The specified procedure could not be found"). This repeats the plain standalone import again, but now after pip has installed pytest and friends, to isolate whether the crash is tied to something the pip install changes in the environment, or specifically to pytest's own import/collection machinery. Temporary, for CI investigation only. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/osgeo4w.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 96b5a6bb9aa..a02a936b2df 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -133,6 +133,31 @@ jobs: pytest-randomly # Obfuscated usage of GitHub Actions features, Windows CMD shell limits analysis shell: cmd /D /E:ON /V:OFF /S /C "CALL C:/OSGeo4W/OSGeo4W.bat "{0}"" # zizmor: ignore[misfeature] + + - name: "[CI diagnostic, not for merge] Standalone import after pip install" + # A plain `python -c "from grass.pygrass import utils"` run + # BEFORE this pip install step succeeds (see + # ci-diag/standalone-import-test), but `pytest`/`python -m + # pytest` collecting the exact same import AFTER this step + # crashes with "Windows fatal exception: code 0xc0000139" (see + # ci-diag/no-xdist-single-process and + # ci-diag/python-m-pytest-vs-exe). None of pytest/pytest-xdist/ + # execnet/pytest-timeout/pytest-randomly/colorama declare a + # pywin32 dependency, so this isn't a duplicate-pywin32-install + # conflict (a scenario pywin32's own README explicitly blames + # for this same generic Windows error text). This repeats the + # plain standalone import again, but now AFTER pip has installed + # pytest and friends, to isolate whether the crash is tied to + # something the pip install changes in the environment, or + # specifically to pytest's own import/collection machinery. + run: | + call %OSGEO4W_ROOT%\opt\grass\etc\env.bat + set PYTHONPATH=%GISBASE%\etc\python;%PYTHONPATH% + path %GISBASE%\lib;%GISBASE%\bin;%PATH% + python -c "from grass.pygrass import utils; print('OK: pygrass.utils imported successfully after pip install')" + # Obfuscated usage of GitHub Actions features, Windows CMD shell limits analysis + shell: cmd /D /E:ON /V:OFF /S /C "CALL C:/OSGeo4W/OSGeo4W.bat "{0}"" # zizmor: ignore[misfeature] + - name: Run pytest with multiple workers in parallel run: | call %OSGEO4W_ROOT%\opt\grass\etc\env.bat