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

Optional dependencies are not synced #842

Closed
flying-sheep opened this issue Apr 29, 2023 · 5 comments
Closed

Optional dependencies are not synced #842

flying-sheep opened this issue Apr 29, 2023 · 5 comments

Comments

@flying-sheep
Copy link
Contributor

flying-sheep commented Apr 29, 2023

I want to use pip in CI to install my test dependencies. Therefore my config looks like this:

[optional-dependencies]
test = ['pytest', '...']

[tool.hatch.envs.test]
dependencies = ['my-package-name[test]']

This works fine, but hatch never realizes when dependencies changed, so I have to manually sync dependencies.

If #650 were implemented, there would be a workaround less time/bandwidth consuming than hatch env prune && hatch run test:test

@ofek
Copy link
Collaborator

ofek commented Apr 29, 2023

You need to use the actual option https://hatch.pypa.io/latest/config/environment/overview/#features

@ofek
Copy link
Collaborator

ofek commented Apr 29, 2023

(please close this when you confirm that option works for you)

@flying-sheep
Copy link
Contributor Author

Thanks, it does!

@flying-sheep
Copy link
Contributor Author

Actually I think Hatch needs to support the syntax. Some packages have transitive extras, which Hatch should understand:

[optional-dependencies]
test-min = ['pytest']
test = ['mypkg[test-min]']

[tool.hatch.envs.test]
dependencies = ['my-package-name']
features = ['test']

Will changing the test-min extra make Hatch re-sync dependencies?

@ofek
Copy link
Collaborator

ofek commented Mar 21, 2024

No, can you please open a separate feature request?

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

No branches or pull requests

2 participants