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 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-compatibility-tests.yml b/.github/workflows/python-compatibility-tests.yml index 8407fae..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,8 +70,23 @@ 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} - 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/.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 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