-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Question: What’s the difference between optional-dependencies
and dependency-groups
in pyproject.toml
?
#9011
Comments
I was wondering about the same today, looking for some insights here. From my understanding:
I think it's more about what ends up in the published package than how they are handled by uv. In theory, you can move all your Moreover I'm new to uv, so they are just considerations. Probably some contributor could shed more light on the rationale behind this feature 😃 |
They are not uv specific but a fairly new packaging standard defined by PEP 735 – Dependency Groups in pyproject.toml.
|
Thanks for pointing it out @Ravencentric, I was not aware of it 😄 |
@PRFina Thanks for your response; it was really helpful! |
See also: #8981 (comment). |
Wouldn't this violate DRY? If I'm working on an optional user feature, how do I specify the deps as a |
If it's a user feature, use |
uv does support this though
|
oh ok! b/c i can refer to the package that i'm developing. thanks! |
I'm not sure if other tools will accept that. |
Hi,
I have a question regarding the configuration of dependencies in
pyproject.toml
.I’ve noticed that both
optional-dependencies
anddependency-groups
seem to handle optional dependencies in a similar way, so I'm a bit confused about how they differ and when each should be used. Could you clarify the following points?Purpose: What is the intended purpose of
optional-dependencies
versusdependency-groups
?Usage Scenarios: In what specific scenarios would it make sense to use one over the other?
Any insights or examples you could provide would be really helpful.
Thanks in advance for your time and assistance!
The text was updated successfully, but these errors were encountered: