Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: refactor/enhance dependency groups section #11690

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rsyring
Copy link

@rsyring rsyring commented Feb 21, 2025

Summary

  • Add example of dependency group includes
  • Refactor section to to show pyproject.toml config & explanation of dependency resolution first and move CLI implementation and options into it's own section

It took me a decent amount of searching through the issues and multiple attempts to resist just posting a "question" issue to ask how to do group includes before I finally stumbled upon the answer pointing to pep 735. Since I had been over the docs in that section multiple times, I thought it would help to just add the answer front and center.

Also refactored the section to separate config from cli. The part about resolution all being done together was something I had to search for a couple days ago and it seems like that's an important bit that should be closer to the top of the section instead of mixed in after the CLI option discussion.

Feel free to ask for adjustments if desired.

Test Plan

I started the docs server and reviewed manually.

@rsyring rsyring force-pushed the docs-dependency-groups branch 2 times, most recently from 899e965 to 0f84e8c Compare February 21, 2025 06:28
Copy link
Contributor

@Gankra Gankra left a comment

Choose a reason for hiding this comment

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

This seems like a reasonable tweak but I'm gonna get a second opinion.

@@ -613,19 +613,47 @@ instead. Additionally, the `dev` group is [synced by default](#default-groups).

### Dependency groups

uv supports
[PyPA spec Dependency Groups](https://packaging.python.org/en/latest/specifications/dependency-groups/):
Copy link
Contributor

Choose a reason for hiding this comment

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

Uncertain this is the "right" thing to cite? (genuine question, need to check with someone else...)

Copy link
Author

Choose a reason for hiding this comment

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

The docs already reference PEP 735. I was going to reference it again but noticed that the pep itself points to the dependency groups spec as the canonical version. So I linked to it.

However, upon reviewing the docs, I realized there was further room for improvement so pushed up another commit with some additional refactoring which removes this sentence.

However, it's up for debate on whether or not the existing PEP 735 reference should be kept or replaced with the link to the spec. I'd be +0 towards the latter since the PEP points there.

Comment on lines 670 to 673
!!! note

If you have dependency groups that conflict with one another, resolution will fail
unless you explicitly [declare them as conflicting](./config.md#conflicting-dependencies).
`include-group` is not supported from the CLI ([#9054](https://github.com/astral-sh/uv/issues/9054)).
Those edits must be made manually.
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a distracting/strange thing to include in the documentation.

Copy link
Author

Choose a reason for hiding this comment

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

Since there was an issue open about it, I thought it might save someone from creating another issue. :)

I moved the notice to a comment in the example but wouldn't mind at all if your preference is to remove that too.

@rsyring rsyring force-pushed the docs-dependency-groups branch 2 times, most recently from a27d817 to 51b4c6d Compare February 21, 2025 18:02
@rsyring
Copy link
Author

rsyring commented Feb 21, 2025

Forced pushed a new commit (would you prefer separate commits when addressing PR comments?) addressing a couple of the above issues as well as some additional refactoring.

@Gankra
Copy link
Contributor

Gankra commented Feb 21, 2025

You can put the commits up in any form you prefer, we always squash-merge so don't worry about it too much.

- Add example of dependency group includes
- Refactor section to to show pyproject.toml config & explanation of dependency resolution first and move CLI implementation and options into it's own section
@rsyring rsyring force-pushed the docs-dependency-groups branch from 51b4c6d to 44403b2 Compare February 21, 2025 18:11
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