You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PEP-735 defined dependency groups for Python projects. Is there a way to specify those as environment dependencies?
Here's a hypothetical project.
# pyproject.toml
[project.optional-dependencies]
test = ["gcovr", "pytest-xdist"] # OK: can reference them directly.
[dependency-groups]
docs = ["sphinx"] # Need to repeat it for Hatch.# …
[tool.hatch.envs.testenv]
features = ["test"] # Referenced directly.
[tool.hatch.envs.docsenv]
dependencies = ["sphinx"] # Repeated here.skip-install = true
Building the documentation for this hypothetical project does not require the project to be installed, which is why Sphinx is in dependency-groups instead of project.optional-dependencies. (This is, in fact, one of the reasons dependency groups were introduced.) But I couldn't find a way to specify a dependency group in the documentation of Hatch environments. Is there an easy way to accomplish this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
PEP-735 defined dependency groups for Python projects. Is there a way to specify those as environment dependencies?
Here's a hypothetical project.
Building the documentation for this hypothetical project does not require the project to be installed, which is why Sphinx is in
dependency-groups
instead ofproject.optional-dependencies
. (This is, in fact, one of the reasons dependency groups were introduced.) But I couldn't find a way to specify a dependency group in the documentation of Hatch environments. Is there an easy way to accomplish this?Beta Was this translation helpful? Give feedback.
All reactions