-
-
Notifications
You must be signed in to change notification settings - Fork 325
Hatch environments support PEP735 dependency-groups #1922
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
base: master
Are you sure you want to change the base?
Conversation
4528af3
to
f987adb
Compare
Dependency groups have no impact on binary distributions so moved to build frontend.
f987adb
to
ad721e5
Compare
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.
thank you for your effort on this. i left a few notes regarding the user documentation and hope to find some time soon for a deeper look.
maybe the PA's usage guide reg. the dependency groups could also be linked somewhere: https://packaging.python.org/en/latest/specifications/dependency-groups/
[tool.hatch.envs.test] | ||
dependency-groups = ["test"] | ||
|
||
[tool.hatch.envs.lint] | ||
dependency-groups = ["lint"] | ||
|
||
[tool.hatch.envs.dev] | ||
dependency-groups = ["dev"] |
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.
i can imagine that a completely reflected use-case would be preferable here. i don't know the current affairs reg. user documentation guidelines, maybe @lwasser has some advice.
dependencies = [ | ||
"coverage[toml]>=7.0.0", | ||
] | ||
# Project dependencies will be included if not skip-install and in dev-mode |
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.
i don't really get what this wants to tell me; it seems to be suited for a sentence or two outside the example snippet.
!!! note | ||
Unlike features which affect how the project itself is installed, dependency groups are separate dependencies that are installed alongside the project. | ||
|
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.
if the point here is to point out that dependency groups are no direct project dependencies, i think that aspect can be included in one of the prior paragraphs.
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.
Dependency groups exist to be exactly what hatch’s env dependencies are, so I don’t like the indirection of making an env refer to dependency groups to install.
I think we should do more that simply support them, we should actually integrate them: #1852 (comment)
So I propose that we change hatch to actually collect the list of defined dependency groups and merge it with the list of hatch envs (each dependency group implicitly defines a hatch env, and each hatch env implicitly installs its corresponding dependency group). @ofek should weigh in here.
Imagine: if dependency groups would have existed when designing hatch, would they be used like I propose? I think yes.
Closes #754
Closes #1852