Skip to content

Conversation

djcopley
Copy link
Contributor

Closes #754
Closes #1852

@djcopley djcopley force-pushed the hatch-dependency-groups branch 4 times, most recently from 4528af3 to f987adb Compare March 4, 2025 01:36
djcopley added 2 commits March 4, 2025 10:21
Dependency groups have no impact on binary distributions so moved to build frontend.
Copy link
Contributor

@funkyfuture funkyfuture left a 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/

Comment on lines +152 to +159
[tool.hatch.envs.test]
dependency-groups = ["test"]

[tool.hatch.envs.lint]
dependency-groups = ["lint"]

[tool.hatch.envs.dev]
dependency-groups = ["dev"]
Copy link
Contributor

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
Copy link
Contributor

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.

Comment on lines +125 to +127
!!! note
Unlike features which affect how the project itself is installed, dependency groups are separate dependencies that are installed alongside the project.

Copy link
Contributor

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.

Copy link
Contributor

@flying-sheep flying-sheep left a 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.

@schlich
Copy link

schlich commented Jun 8, 2025

@ofek have you put any further thought into this? I was VERY suprised to find out that Hatch did not support this PEP and was thus incompatible with uv and pixi, as others have mentioned. I would be happy to contribute if it is labor that is blocking this; if it's more of an administration, your thoughts on whether or not this will be something that Hatch plans to support would be very appreciated!

@Midnighter
Copy link
Contributor

Greetings all,

I want this feature very much in hatch. I'm willing to put in the necessary work like others above, but that does not seem the blocker here. In any case, please let us know how we can contribute.

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.

[request] Support for [dependency-groups] Possibility to mark dependencies as dev-only that don’t go into package metadata
5 participants