- Notifications
You must be signed in to change notification settings - Fork5.7k
Implement PEP 735 Dependency Groups#4800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR implements PEP 735 dependency groups, removes legacy requirement files, and updates CI/docs workflows to use pip’s--group
installs.
- Define
tests
,docs
, andall
dependency groups inpyproject.toml
- Remove
requirements-*.txt
files and switch workflows from-r
installs to--group
flags - Reformat array syntax and lint settings in
pyproject.toml
for consistency
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
requirements-unit-tests.txt | Removed legacy test requirements file |
requirements-dev-all.txt | Removed legacy dev-all requirements file |
pyproject.toml | Added[dependency-groups] , collapsed arrays, updated optional-dependencies |
docs/requirements-docs.txt | Removed legacy docs requirements file |
.readthedocs.yml | Updated RTD install step—now onlypip install . |
.github/workflows/unit_tests.yml | Switched topip install . --group tests , removed old installs |
.github/workflows/test_official.yml | Switched topip install .[all] --group tests |
.github/workflows/docs-linkcheck.yml | Switched topip install .[all] --group all |
.github/workflows/docs-admonitions.yml | Switched topip install . --group all |
.github/workflows/chango.yml | Switched topip install . --group docs |
.github/CONTRIBUTING.rst | Updated contributor setup to use--group all |
Comments suppressed due to low confidence (3)
.readthedocs.yml:20
- The ReadTheDocs config no longer installs documentation dependencies. You should add an install argument to include the
docs
group (e.g.,args: ["--group", "docs"]
) so Sphinx requirements are pulled in.
- method: pip path: .
.github/workflows/unit_tests.yml:41
- [nitpick] The
tests
dependency group already includespytest-xdist
, so this extra installation is redundant and can be removed.
python -W ignore -m pip install pytest-xdist
.github/workflows/docs-admonitions.yml:34
- With the old requirements files removed, the cache no longer tracks dependency changes. Consider adding
cache-dependency-path: 'pyproject.toml'
(or similar) to ensure the cache is invalidated when dependencies are updated.
- cache-dependency-path: '**/requirements*.txt'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for the PR! Really nice seeing that PEP in action!
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3" # latest stable cpython version | ||
jobs: | ||
install: | ||
- pip install -U pip | ||
- pip install .[all] --group 'all' # install all the dependency groups |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
[all]
is probably duplicate here, right? It's already listed in line 22
dependencies = "Implement PEP 735 Dependency Groups" | ||
documentation = "Implement PEP 735 Dependency Groups" | ||
internal = "Implement PEP 735 Dependency Groups" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
dependencies ="Implement PEP 735 Dependency Groups" | |
documentation ="Implement PEP 735 Dependency Groups" | |
internal ="Implement PEP 735 Dependency Groups" | |
dependencies ="Implement PEP 735 Dependency Groups for Development Dependencies" |
tests = [ | ||
"build", | ||
"pytest==8.3.5", | ||
"pytest-asyncio==0.21.2", | ||
"pytest-xdist==3.6.1", | ||
"flaky>=3.8.1", | ||
"beautifulsoup4", | ||
"tzdata", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Can you add the comments from the req file? At least the one about tzdate is useful IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
What are all the unrelated formatting changes about? I prefer not to have them in this PR. If you use some toml formatter that you think is worth introducing, then let's do that in a standalone PR :)
Closes#4795.
Also ran the standard vscode file formatter on pyproject.toml, so if you're wondering about that change, it's that.
Also works with
uv
:uv sync --all-extras --all-groups