From 09d8d1441480205e55452ee93613a1ec87dd3cef Mon Sep 17 00:00:00 2001 From: Maverick <87385184+Maverick-F@users.noreply.github.com> Date: Tue, 10 Nov 2026 14:24:25 -0600 Subject: [PATCH 1/4] Compatibility matrix: run pytest through the tox env's python All three Tox jobs failed with "pytest is not allowed, use allowlist_externals to allow it": with sitepackages = true, pytest lives in the base conda env, not in the tox venv, so tox 4 refuses the bare command. tox now runs python -m pytest, and passes PROJ_DATA, PROJ_LIB, GDAL_DATA and GDAL_DRIVER_PATH through, as it strips the environment and pyproj/GDAL can't find their data from inside the venv. The workflow falls back to the conda env's share/ dirs when activation doesn't export them. From BERATool/beratools_full. --- .github/workflows/python-compatibility-tests.yml | 11 ++++++++++- tox.ini | 12 +++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-compatibility-tests.yml b/.github/workflows/python-compatibility-tests.yml index 8407fae..44ba30e 100644 --- a/.github/workflows/python-compatibility-tests.yml +++ b/.github/workflows/python-compatibility-tests.yml @@ -66,4 +66,13 @@ jobs: - name: Run Tests shell: bash -el {0} - run: tox -e ${{ matrix.toxenv }} + env: + TOXENV_NAME: ${{ matrix.toxenv }} + run: | + # tox passes these through (see passenv in tox.ini); fall back to the + # env's share/ dirs in case activation did not export them. + export PROJ_DATA="${PROJ_DATA:-$CONDA_PREFIX/share/proj}" + export GDAL_DATA="${GDAL_DATA:-$CONDA_PREFIX/share/gdal}" + echo "PROJ_DATA=$PROJ_DATA"; ls "$PROJ_DATA/proj.db" + echo "GDAL_DATA=$GDAL_DATA" + tox -e "$TOXENV_NAME" diff --git a/tox.ini b/tox.ini index 9816cd4..64c573e 100644 --- a/tox.ini +++ b/tox.ini @@ -10,10 +10,20 @@ description = Run tests/test_workflow.py with pytest in an isolated environment package = skip skip_install = true sitepackages = true +# Run pytest via the env's interpreter: with sitepackages=true pytest lives in the +# base (conda) env, so a bare `pytest` is not inside the venv and tox 4 rejects it. commands = - pytest -vv -s --maxfail=1 --log-cli-level=INFO tests/test_workflow.py + python -m pytest -vv -s --maxfail=1 --log-cli-level=INFO tests/test_workflow.py setenv = PYTHONDONTWRITEBYTECODE = 1 +# tox 4 strips the environment. Inside the venv sys.prefix is .tox/, so +# pyproj/pyogrio/GDAL cannot locate the base env's data files on their own and +# need the variables the conda activation scripts set. +passenv = + PROJ_DATA + PROJ_LIB + GDAL_DATA + GDAL_DRIVER_PATH [testenv:py312] basepython = python3.12 From d3a64a9224030251c2a36a262f5f9e661d452494 Mon Sep 17 00:00:00 2001 From: Maverick <87385184+Maverick-F@users.noreply.github.com> Date: Tue, 10 Nov 2026 14:24:26 -0600 Subject: [PATCH 2/4] Compatibility matrix: install networkit from PyPI on Python 3.14 conda-forge has no Python 3.14 build of networkit yet, so the 3.14 job installs it from PyPI (which publishes cp314 wheels) instead of conda. From BERATool/beratools_full. --- .../workflows/python-compatibility-tests.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-compatibility-tests.yml b/.github/workflows/python-compatibility-tests.yml index 44ba30e..9c3bdd0 100644 --- a/.github/workflows/python-compatibility-tests.yml +++ b/.github/workflows/python-compatibility-tests.yml @@ -13,13 +13,21 @@ jobs: strategy: fail-fast: false matrix: + # conda-forge has no Python 3.14 build of networkit yet, so 3.14 installs it + # from PyPI (cp314 wheels are published there) instead of conda. include: - python-version: "3.12" toxenv: py312 + conda-networkit: networkit + pip-networkit: "" - python-version: "3.13" toxenv: py313 + conda-networkit: networkit + pip-networkit: "" - python-version: "3.14" toxenv: py314 + conda-networkit: "" + pip-networkit: networkit steps: - uses: actions/checkout@v7 @@ -37,7 +45,7 @@ jobs: gdal>=3.12,<4 geopandas pandas - networkit + ${{ matrix.conda-networkit }} numpy>=1.26,<2.4 pandas pyogrio>=0.12 @@ -62,7 +70,13 @@ jobs: - name: Install project shell: bash -el {0} - run: python -m pip install -e . --no-deps + env: + PIP_NETWORKIT: ${{ matrix.pip-networkit }} + run: | + python -m pip install -e . --no-deps + if [ -n "$PIP_NETWORKIT" ]; then + python -m pip install "$PIP_NETWORKIT" + fi - name: Run Tests shell: bash -el {0} From f0d58fd033aa37655e0386dddfcd9d2fbca1b621 Mon Sep 17 00:00:00 2001 From: Maverick <87385184+Maverick-F@users.noreply.github.com> Date: Tue, 10 Nov 2026 14:24:26 -0600 Subject: [PATCH 3/4] Windows installer workflow: update actions/checkout to v7 From BERATool/beratools_full. --- .github/workflows/build-win-installer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-win-installer.yml b/.github/workflows/build-win-installer.yml index 9049b9b..700264a 100644 --- a/.github/workflows/build-win-installer.yml +++ b/.github/workflows/build-win-installer.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: ref: ${{ inputs.release_tag && format('refs/tags/{0}', inputs.release_tag) || github.sha }} persist-credentials: false From 45dbdbffa82d01cb453ae38a1c2ea8d1292c28d4 Mon Sep 17 00:00:00 2001 From: Maverick <87385184+Maverick-F@users.noreply.github.com> Date: Tue, 10 Nov 2026 14:24:27 -0600 Subject: [PATCH 4/4] Docs and integration workflows: allow manual runs Both can now be started with workflow_dispatch. A manual docs run also uploads and deploys the site (the deploy steps now run on anything but a pull request, not only on push). From BERATool/beratools_full. --- .github/workflows/mkdocs-gh-pages.yml | 5 +++-- .github/workflows/python-integration-tests.yml | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mkdocs-gh-pages.yml b/.github/workflows/mkdocs-gh-pages.yml index c052a9a..c7693a7 100644 --- a/.github/workflows/mkdocs-gh-pages.yml +++ b/.github/workflows/mkdocs-gh-pages.yml @@ -1,6 +1,7 @@ name: Deploy Docs to GitHub Pages on: + workflow_dispatch: pull_request: branches: - main @@ -42,13 +43,13 @@ jobs: - name: Build docs site run: pixi run zensical build -f docs/mkdocs.yml - name: Upload Pages artifact - if: github.event_name == 'push' + if: github.event_name != 'pull_request' uses: actions/upload-pages-artifact@v3 with: path: docs/site deploy: - if: github.event_name == 'push' + if: github.event_name != 'pull_request' needs: test-docs runs-on: ubuntu-latest timeout-minutes: 10 diff --git a/.github/workflows/python-integration-tests.yml b/.github/workflows/python-integration-tests.yml index 9f16c91..4cb7185 100644 --- a/.github/workflows/python-integration-tests.yml +++ b/.github/workflows/python-integration-tests.yml @@ -1,6 +1,7 @@ name: Python Tests / Integration on: + workflow_dispatch: pull_request: branches: - main