From c173da8eb3dc659b933a48b174ed41a3fb8681a1 Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Tue, 23 Jun 2026 14:24:49 +1200 Subject: [PATCH] Use PEP-735 for dependency groups --- .github/workflows/test.yml | 11 ++++------- .gitignore | 1 + .readthedocs.yaml | 9 ++++----- docs/requirements.txt | 2 -- pyproject.toml | 16 ++++++++++++++++ tox.ini | 7 +++---- 6 files changed, 28 insertions(+), 18 deletions(-) delete mode 100644 docs/requirements.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b47314f..26aa1b2c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup - run: conda install -c conda-forge pip numpy "pytest<9.1" libspatialindex=${{ matrix.sidx-version }} -y + run: conda install -c conda-forge pip numpy pytest libspatialindex=${{ matrix.sidx-version }} -y - name: Install run: pip install -e . @@ -70,13 +70,10 @@ jobs: allow-prereleases: true - name: Setup - run: | - sudo apt-get -y install libspatialindex-c6 - pip install --upgrade pip - pip install numpy "pytest<9.1" + run: sudo apt-get -y install libspatialindex-c6 - - name: Build - run: pip install --user . + - name: Install + run: pip install . --group test - name: Test with pytest run: pytest -Werror -v --doctest-modules rtree tests diff --git a/.gitignore b/.gitignore index 988351d9..7de080cc 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ lib wheelhouse .vscode/ *venv* +*.lock diff --git a/.readthedocs.yaml b/.readthedocs.yaml index ce370a7e..415ee017 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -12,6 +12,10 @@ build: os: ubuntu-lts-latest tools: python: latest + jobs: + install: + - pip install --upgrade pip + - pip install --group docs # Build documentation in the docs/source directory with Sphinx sphinx: @@ -21,8 +25,3 @@ sphinx: # Optionally build your docs in additional formats such as PDF formats: - pdf - -# Declare the Python requirements required to build your docs -python: - install: - - requirements: docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 49e47461..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -sphinx>=4 -sphinx-issues diff --git a/pyproject.toml b/pyproject.toml index be2024fa..11df01c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,22 @@ dynamic = ["version"] Documentation = "https://rtree.readthedocs.io" Repository = "https://github.com/Toblerity/rtree" +[dependency-groups] +dev = [ + "coverage", + "pre-commit", + "tox>=4.22", + {include-group = "test"}, +] +docs = [ + "sphinx>=5.0", + "sphinx-issues", +] +test = [ + "numpy", + "pytest>=7.0", +] + [tool.setuptools] packages = ["rtree"] zip-safe = false diff --git a/tox.ini b/tox.ini index 27f16db3..39c8270f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,12 @@ [tox] requires = - tox>=4 + tox>=4.22 env_list = py{310,311,312,313,314} [testenv] description = run unit tests -deps = - pytest>=7.0,<9.1 - numpy +dependency_groups = + test install_command = python -I -m pip install --only-binary=:all: {opts} {packages} ignore_errors = True