From 51dbb0ca8e2fe6688ccccc87858572bc2ed62c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Fri, 6 Mar 2026 02:13:36 +0200 Subject: [PATCH 1/3] Migrated requirements.txt files to dependency groups --- .github/workflows/ci.yml | 6 +++--- .readthedocs.yml | 10 +++++----- MANIFEST.in | 1 - ci.sh | 5 +---- ci/rtd-requirements.txt | 4 ---- pyproject.toml | 12 ++++++++++++ test-requirements.txt | 3 --- 7 files changed, 21 insertions(+), 20 deletions(-) delete mode 100644 ci/rtd-requirements.txt delete mode 100644 test-requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eba1b15..76f75b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: python-version: ${{ matrix.python }} allow-prereleases: true cache: pip - cache-dependency-path: test-requirements.txt + cache-dependency-path: pyproject.toml - name: Run tests run: ./ci.sh shell: bash @@ -51,7 +51,7 @@ jobs: python-version: ${{ matrix.python }} allow-prereleases: true cache: pip - cache-dependency-path: test-requirements.txt + cache-dependency-path: pyproject.toml - name: Run tests run: ./ci.sh env: @@ -76,7 +76,7 @@ jobs: python-version: ${{ matrix.python }} allow-prereleases: true cache: pip - cache-dependency-path: test-requirements.txt + cache-dependency-path: pyproject.toml - name: Set PYTHON_GIL if: endsWith(matrix.python-version, 't') run: | diff --git a/.readthedocs.yml b/.readthedocs.yml index aceed1f..3c79e37 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,15 +4,15 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.8" + python: "3.10" + jobs: + install: + - python -m pip install --no-cache-dir "pip >= 25.1" + - python -m pip install --upgrade --upgrade-strategy only-if-needed --no-cache-dir --group rtd . formats: - htmlzip - epub -python: - install: - - requirements: ci/rtd-requirements.txt - sphinx: configuration: docs/source/conf.py diff --git a/MANIFEST.in b/MANIFEST.in index 4edd4b1..a2c07d1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,4 @@ include README.rst CHEATSHEET.rst LICENSE* CODE_OF_CONDUCT* CONTRIBUTING* include .coveragerc .style.yapf -include test-requirements.txt recursive-include docs * prune docs/build diff --git a/ci.sh b/ci.sh index 967836e..bc1039b 100755 --- a/ci.sh +++ b/ci.sh @@ -43,10 +43,7 @@ EOF exit 0 fi -pip install . - -# Actual tests -pip install -Ur test-requirements.txt +pip install -U --group test . mkdir empty cd empty diff --git a/ci/rtd-requirements.txt b/ci/rtd-requirements.txt deleted file mode 100644 index 67898ba..0000000 --- a/ci/rtd-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -# RTD is currently installing 1.5.3, which has a bug in :lineno-match: -sphinx >= 1.6.1 -sphinx_rtd_theme -sphinxcontrib-trio diff --git a/pyproject.toml b/pyproject.toml index a054095..cd73b2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,18 @@ Homepage = "https://github.com/python-trio/sniffio" Documentation = "https://sniffio.readthedocs.io/" Changelog = "https://sniffio.readthedocs.io/en/latest/history.html" +[dependency-groups] +test = [ + "pytest", + "pytest-cov", + "curio", +] +rtd = [ + "sphinx >= 1.6.1", + "sphinx_rtd_theme", + "sphinxcontrib-trio", +] + [tool.setuptools.dynamic] version = {attr = "sniffio._version.__version__"} diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index 6742196..0000000 --- a/test-requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest -pytest-cov -curio From 5bf87a2f9c7041afc1cb04c0152596f2e6edcd1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Fri, 6 Mar 2026 04:06:50 +0200 Subject: [PATCH 2/3] Updated os and Python version --- .readthedocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 3c79e37..7cc8b0a 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -2,9 +2,9 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-24.04 tools: - python: "3.10" + python: "3.12" jobs: install: - python -m pip install --no-cache-dir "pip >= 25.1" From a8c1af2e6f34a98ea4bb39c4835e78090d329846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Fri, 6 Mar 2026 13:44:25 +0200 Subject: [PATCH 3/3] Update ci.sh Co-authored-by: Christian Clauss --- ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci.sh b/ci.sh index bc1039b..23cc85e 100755 --- a/ci.sh +++ b/ci.sh @@ -43,7 +43,7 @@ EOF exit 0 fi -pip install -U --group test . +pip install --upgrade --group test . mkdir empty cd empty