Skip to content

Commit e5cb0ea

Browse files
committed
Use dev dependency-group
1 parent 0125fe2 commit e5cb0ea

15 files changed

+81
-73
lines changed

.github/workflows/daily.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: "0 0 * * *"
77
pull_request:
88
paths:
9-
- "requirements-tests.txt"
9+
- "pyproject.toml"
1010
- ".github/workflows/daily.yml"
1111

1212
# Please keep the permissions minimal, as stubtest runs arbitrary code from pypi.
@@ -45,11 +45,11 @@ jobs:
4545
with:
4646
python-version: ${{ matrix.python-version }}
4747
cache: pip
48-
cache-dependency-path: requirements-tests.txt
48+
cache-dependency-path: pyproject.toml
4949
allow-prereleases: true
5050
check-latest: true
5151
- name: Install dependencies
52-
run: pip install -r requirements-tests.txt
52+
run: pip install --group=dev
5353
- name: Run stubtest
5454
run: python tests/stubtest_stdlib.py
5555

@@ -69,10 +69,10 @@ jobs:
6969
python-version: "3.13"
7070
cache: pip
7171
cache-dependency-path: |
72-
requirements-tests.txt
72+
pyproject.toml
7373
stubs/**/METADATA.toml
7474
- name: Install dependencies
75-
run: pip install -r requirements-tests.txt
75+
run: pip install --group=dev
7676
- name: Run stubtest
7777
shell: bash
7878
run: |

.github/workflows/meta_tests.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ on:
1212
- "tests/**"
1313
- "lib/**"
1414
- ".github/workflows/meta_tests.yml"
15-
- "requirements-tests.txt"
1615
- "pyproject.toml"
1716

1817
permissions:
@@ -40,7 +39,7 @@ jobs:
4039
with:
4140
python-version: "3.13"
4241
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
43-
- run: uv pip install -r requirements-tests.txt --system
42+
- run: uv pip install --group=dev --system
4443
- run: python ./tests/typecheck_typeshed.py --platform=${{ matrix.platform }}
4544
pyright:
4645
name: Check scripts and tests with pyright
@@ -57,7 +56,7 @@ jobs:
5756
# pytype_test.py imports pytype, we need to use Python 3.12 for now.
5857
python-version: "3.12"
5958
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
60-
- run: uv pip install -r requirements-tests.txt --system
59+
- run: uv pip install --group=dev --system
6160
- name: Run pyright on typeshed
6261
uses: jakebailey/pyright-action@v2
6362
with:
@@ -78,5 +77,5 @@ jobs:
7877
run: |
7978
git config --global user.name stubsabot
8079
git config --global user.email '<>'
81-
- run: uv pip install -r requirements-tests.txt --system
80+
- run: uv pip install --group=dev --system
8281
- run: python scripts/stubsabot.py --action-level local

.github/workflows/mypy_primer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ jobs:
3333
with:
3434
python-version: "3.13"
3535
- name: Install dependencies
36-
run: pip install git+https://github.com/hauntsaninja/mypy_primer.git
36+
run: pip install git+https://github.com/hauntsaninja/mypy_primer.git dependency-groups
3737
- name: Run mypy_primer
3838
shell: bash
3939
run: |
4040
cd typeshed_to_test
41-
MYPY_VERSION=$(grep mypy== requirements-tests.txt | cut -d = -f 3)
41+
MYPY_VERSION=$(python3 -m dependency_groups dev | grep mypy== | cut -d = -f3)
4242
echo "new commit"
4343
git rev-list --format=%s --max-count=1 $GITHUB_SHA
4444
git checkout -b upstream_main origin/main

.github/workflows/stubsabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
git config --global user.name stubsabot
3434
git config --global user.email '<>'
3535
- name: Install dependencies
36-
run: uv pip install -r requirements-tests.txt --system
36+
run: uv pip install --group=dev --system
3737
- name: Run stubsabot
3838
run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python scripts/stubsabot.py --action-level everything
3939

.github/workflows/stubtest_stdlib.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ jobs:
4141
with:
4242
python-version: ${{ matrix.python-version }}
4343
cache: pip
44-
cache-dependency-path: requirements-tests.txt
44+
cache-dependency-path: pyproject.toml
4545
allow-prereleases: true
4646
check-latest: true
4747
- name: Install dependencies
48-
run: pip install -r requirements-tests.txt
48+
run: pip install --group=dev
4949
- name: Run stubtest
5050
run: python tests/stubtest_stdlib.py

.github/workflows/stubtest_third_party.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ jobs:
4444
python-version: "3.13"
4545
cache: pip
4646
cache-dependency-path: |
47-
requirements-tests.txt
47+
pyproject.toml
4848
stubs/**/METADATA.toml
4949
- name: Install dependencies
50-
run: pip install -r requirements-tests.txt
50+
run: pip install --group=dev
5151
- name: Run stubtest
5252
shell: bash
5353
run: |

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
python-version: "3.13"
3333
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
34-
- run: uv pip install -r requirements-tests.txt --system
34+
- run: uv pip install --group=dev --system
3535
- run: python ./tests/check_typeshed_structure.py
3636

3737
pytype:
@@ -44,7 +44,7 @@ jobs:
4444
# Max supported Python version as of pytype 2024.10.11
4545
python-version: "3.12"
4646
- uses: astral-sh/setup-uv@v6
47-
- run: uv pip install -r requirements-tests.txt --system
47+
- run: uv pip install --group=dev --system
4848
- name: Install external dependencies for 3rd-party stubs
4949
run: |
5050
DEPENDENCIES=$( python tests/get_external_stub_requirements.py )
@@ -102,7 +102,7 @@ jobs:
102102
# TODO: figure out why that is (#11590)
103103
python-version: "3.11"
104104
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
105-
- run: uv pip install -r requirements-tests.txt --system
105+
- run: uv pip install --group=dev --system
106106
- run: python ./tests/regr_test.py --all --verbosity QUIET
107107

108108
pyright:
@@ -121,7 +121,7 @@ jobs:
121121
- uses: astral-sh/setup-uv@v6
122122
- name: Install typeshed test-suite requirements
123123
# Install these so we can run `get_external_stub_requirements.py`
124-
run: uv pip install -r requirements-tests.txt --system
124+
run: uv pip install --group=dev --system
125125
- name: Install required APT packages
126126
run: |
127127
DEPENDENCIES=$( python tests/get_external_apt_dependencies.py )
@@ -187,5 +187,5 @@ jobs:
187187
- name: Run tests
188188
run: |
189189
cd stub_uploader
190-
uv pip install -r requirements.txt --system
190+
uv pip install --group=dev --system
191191
python -m pytest tests

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ repos:
1010
- id: mixed-line-ending
1111
args: [--fix=lf]
1212
- id: check-case-conflict
13+
- repo: https://github.com/sirosen/dependency-groups
14+
rev: 1.3.1 # must match pyproject.toml
15+
hooks:
16+
- id: lint-dependency-groups
1317
- repo: https://github.com/astral-sh/ruff-pre-commit
1418
rev: v0.11.4 # must match requirements-tests.txt
1519
hooks:

CONTRIBUTING.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ Note that some tests require extra setup steps to install the required dependenc
6363
```bash
6464
$ python3 -m venv .venv
6565
$ source .venv/bin/activate
66-
(.venv)$ pip install -U pip
67-
(.venv)$ pip install -r requirements-tests.txt
66+
(.venv)$ pip install -U "pip>=25.1"
67+
(.venv)$ pip install --group=dev
6868
```
6969

7070
</td>
@@ -79,8 +79,8 @@ Note that some tests require extra setup steps to install the required dependenc
7979
```powershell
8080
> python -m venv .venv
8181
> .venv\Scripts\activate
82-
(.venv) > pip install -U pip
83-
(.venv) > pip install -r requirements-tests.txt
82+
(.venv) > pip install -U "pip>=25.1"
83+
(.venv) > pip install --group=dev
8484
```
8585

8686
To be able to run pytype tests, you'll also need to install it manually
@@ -100,8 +100,7 @@ as it's currently excluded from the requirements file:
100100
If you already have [uv](https://docs.astral.sh/uv/getting-started/installation/) installed, you can simply replace the commands above with:
101101

102102
```shell
103-
uv venv
104-
uv pip install -r requirements-tests.txt
103+
uv pip install --group=dev
105104
```
106105

107106
```shell
@@ -220,7 +219,7 @@ This has the following keys:
220219
in addition to the requirements in the `requires` field.
221220
* `apt_dependencies` (default: `[]`): A list of Ubuntu APT packages
222221
that need to be installed for stubtest to run successfully.
223-
* `brew_dependencies` (default: `[]`): A list of MacOS Homebrew packages
222+
* `brew_dependencies` (default: `[]`): A list of macOS Homebrew packages
224223
that need to be installed for stubtest to run successfully
225224
* `choco_dependencies` (default: `[]`): A list of Windows Chocolatey packages
226225
that need to be installed for stubtest to run successfully
@@ -347,7 +346,7 @@ replacing `$INSERT_LIBRARY_NAME_HERE` with the name of the library:
347346
When the script has finished running, it will print instructions telling you what to do next.
348347

349348
If it has been a while since you set up the virtualenv, make sure you have
350-
the latest mypy (`pip install -r requirements-tests.txt`) before running the script.
349+
the latest mypy (`pip install --group=dev`) before running the script.
351350

352351
### Supported type system features
353352

lib/ts_utils/paths.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
STUBS_PATH: Final = TS_BASE_PATH / "stubs"
1111

1212
PYPROJECT_PATH: Final = TS_BASE_PATH / "pyproject.toml"
13-
REQUIREMENTS_PATH: Final = TS_BASE_PATH / "requirements-tests.txt"
1413
GITIGNORE_PATH: Final = TS_BASE_PATH / ".gitignore"
1514

1615
TESTS_DIR: Final = "@tests"

0 commit comments

Comments
 (0)