Skip to content

chore: move to using dependency-groups#227

Merged
abravalheri merged 2 commits into
abravalheri:mainfrom
henryiii:henryiii/chore/dependency-groups
Mar 13, 2025
Merged

chore: move to using dependency-groups#227
abravalheri merged 2 commits into
abravalheri:mainfrom
henryiii:henryiii/chore/dependency-groups

Conversation

@henryiii

@henryiii henryiii commented Feb 7, 2025

Copy link
Copy Markdown
Collaborator

Trying something new for RtD, based on recent additions. readthedocs/readthedocs.org#11289 Also using tox-uv to speed up CI. This has the added bonus that uv run pytest also just works out of the box, since it picks up the dev dependency group. (Note: uv is not required for people running tox, though, just the minimum version was bumped a bit, no other changes for users)

This cuts the readthedocs job time in half. Other jobs are faster, too.

@henryiii henryiii force-pushed the henryiii/chore/dependency-groups branch 3 times, most recently from fbf772f to 3913348 Compare February 7, 2025 16:24
@henryiii henryiii force-pushed the henryiii/chore/dependency-groups branch 2 times, most recently from 1fd6eb3 to 55228d8 Compare February 26, 2025 20:31
@henryiii henryiii force-pushed the henryiii/chore/dependency-groups branch 3 times, most recently from 48d232b to 6606d3a Compare March 12, 2025 22:10
@henryiii henryiii requested a review from abravalheri March 13, 2025 14:09
Comment thread pyproject.toml
validate_pyproject = "validate_pyproject.repo_review:repo_review_families"
[tool.uv]
environments = [
"python_version >= '3.9'",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, this is required because uv locks across the entire environment, and the docs requirements require 3.9 (sphinx>=7.2.2). You can't build the docs on 3.8.

@abravalheri abravalheri left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much @henryiii for working on this. I looks great.

I just wanted to clarify a couple of points (no change in code necessary):

  • The improvement in speed in due to uv right? Or is dependency-groups inherently faster?
  • The (reasonable) assumption is that no-one is really installing installing validate-pyproject[test], so it is fine to remove this extra; right?

Would something like the following work as a CHANGELOG entry (to inform downstream package systems that might not be using tox for the tests)?

validate-pyproject no longer communicates test dependencies via the tests extra and doc dependencies via the docs/requirements.txt files. Instead new dependency-groups have been setup to support CI environments.

(Please feel free to suggest something different)

@henryiii

Copy link
Copy Markdown
Collaborator Author
  1. Yes, it's due to using uv in the docs job and in the CI for the tox jobs.
  2. Yes, [test] is really not a public extra, since you need the project files to actually run the tests anyway. It's better to keep extras to just things that really are extras ([all], for example).

That's fine, though you could also add more detail:

validate-pyproject no longer communicates test dependencies via the tests extra and doc dependencies via the docs/requirements.txt file. Instead dependency-groups have been added to support CI environments. As a result, uv's high level interface also works for developers. You can use the dependency-groups package on PyPI if you need to convert to a classic requirements list.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@abravalheri abravalheri force-pushed the henryiii/chore/dependency-groups branch from 6606d3a to d3a000a Compare March 13, 2025 15:07
@abravalheri abravalheri merged commit e63f598 into abravalheri:main Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants