From b4ad0ae748fb8fd29825b82574dcb23be3036486 Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Thu, 24 Sep 2026 14:02:04 +1200 Subject: [PATCH] Use dependency groups (PEP 735) --- .github/workflows/main.yml | 26 ++++++++++++++++---- .gitignore | 3 +++ .readthedocs.yml | 11 ++++----- pyproject.toml | 49 +++++++++++++++++++++++++------------- 4 files changed, 61 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5fa9e55..708e23f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -v --editable .[lint] + pip install -v --editable . --group lint - name: black check run: | @@ -44,6 +44,22 @@ jobs: run: | cython-lint src/pykrige/ + uv-sync: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + + - name: Install uv + uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 + with: + enable-cache: false + version: "0.12.13" # Released on 2026-09-10 + + # Ensure that dependencies and dependency groups are consistent and resolvable. + - run: uv sync --all-extras --all-groups --dry-run + build_wheels: name: wheels for ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -101,11 +117,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install build + pip install --group tests build - name: Install pykrige run: | - pip install -v --editable .[test] + pip install -v --editable . - name: Install pinned dependencies run: | @@ -142,11 +158,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install "coveralls>=3.0.0" + pip install --group dev "coveralls>=3.0.0" - name: Install pykrige run: | - pip install -v --editable .[test] + pip install -v --editable . --no-build-isolation - name: Run tests env: diff --git a/.gitignore b/.gitignore index d4587a5..4b3ed62 100644 --- a/.gitignore +++ b/.gitignore @@ -86,6 +86,9 @@ celerybeat-schedule # dotenv .env +# lock files (pixi, pipenv, uv) +*.lock + # virtualenv .venv venv/ diff --git a/.readthedocs.yml b/.readthedocs.yml index 4291bf8..37d0a54 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,15 +4,12 @@ build: os: ubuntu-22.04 tools: python: "3.11" + jobs: + install: + - python -m pip install --upgrade --no-cache-dir pip + - python -m pip install --upgrade --upgrade-strategy only-if-needed --no-cache-dir --group docs . sphinx: configuration: docs/source/conf.py formats: [pdf] - -python: - install: - - method: pip - path: . - extra_requirements: - - doc diff --git a/pyproject.toml b/pyproject.toml index d504766..fee2862 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,11 @@ [build-system] requires = [ - "setuptools>=77", - "wheel", + # keep in sync with [dependency-groups.build] "Cython>=3", "numpy>=2", - "scipy>=1.5.4", "pentapy>=1.1.0,<2", + "scipy>=1.5.4", + "setuptools>=77", "setuptools_scm[toml]>=7", ] build-backend = "setuptools.build_meta" @@ -54,7 +54,28 @@ dependencies = [ ] [project.optional-dependencies] -doc = [ +plot = ["matplotlib>=3,<4"] +sklearn = ["scikit-learn>=0.19"] + +[project.urls] +Changelog = "https://github.com/GeoStat-Framework/PyKrige/blob/main/CHANGELOG.md" +Conda-Forge = "https://anaconda.org/conda-forge/pykrige" +Documentation = "https://pykrige.readthedocs.io" +Homepage = "https://github.com/GeoStat-Framework/PyKrige" +Source = "https://github.com/GeoStat-Framework/PyKrige" +Tracker = "https://github.com/GeoStat-Framework/PyKrige/issues" + +[dependency-groups] +build = [ + # keep in sync with [build-system.requires] + "Cython>=3", + "numpy>=2", + "pentapy>=1.1.0,<2", + "scipy>=1.5.4", + "setuptools>=77", + "setuptools_scm[toml]>=7", +] +docs = [ "gstools>=1.4,<2", "pillow", "scikit-learn>=0.19", @@ -65,9 +86,7 @@ doc = [ "sphinx-gallery>=0.8", "sphinx-rtd-theme>=2", ] -plot = ["matplotlib>=3,<4"] -sklearn = ["scikit-learn>=0.19"] -test = [ +tests = [ "pytest-cov>=3", "scikit-learn>=0.19", "gstools>=1.4,<2", @@ -78,14 +97,12 @@ lint = [ "isort[colors]", "cython-lint", ] - -[project.urls] -Changelog = "https://github.com/GeoStat-Framework/PyKrige/blob/main/CHANGELOG.md" -Conda-Forge = "https://anaconda.org/conda-forge/pykrige" -Documentation = "https://pykrige.readthedocs.io" -Homepage = "https://github.com/GeoStat-Framework/PyKrige" -Source = "https://github.com/GeoStat-Framework/PyKrige" -Tracker = "https://github.com/GeoStat-Framework/PyKrige/issues" +dev = [ + {include-group = "build"}, + # {include-group = "docs"}, + {include-group = "tests"}, + {include-group = "lint"}, +] [tool.setuptools_scm] write_to = "src/pykrige/_version.py" @@ -156,7 +173,7 @@ build-frontend = "build" # Disable building py3.6/7/8, pp3.8, 32bit linux skip = ["*-win32", "*_i686", "*-musllinux_*", "cp31?t-*"] # Run the package tests using `pytest` -test-extras = "test" +test-groups = "tests" test-command = "pytest -v {package}/tests" environment.PIP_ONLY_BINARY = "numpy,scipy"