-
Notifications
You must be signed in to change notification settings - Fork 290
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
feat(pipx): add support for specifying package extras #2510
Conversation
I think Tool Options would be a better solution as it wouldn't require a new convention in mise https://mise.jdx.dev/dev-tools/#tool-options See #2515 for an example |
@jdx How would you propose the syntax for tool options in this case? Python extras are a list rather than a map, maybe something like
|
I think for now unfortunately it only supports strings so you will need to do this: mytool = { version = '3.10', extras = 'foo,bar' } I may be wrong though, I may have implemented some simple array support |
That's fine, I'll update the PR to accommodate the tool options convention! |
51cb1d3
to
04bd924
Compare
@jdx I've updated the code to use |
you've got a test failure |
4f78c2b
to
7c7e9d1
Compare
6189ddc
to
9c896b3
Compare
@jdx this is ready for review. The git history is kind of messy, let me know if you want me to clean it up before merging 👍 |
* feat(pipx): add support for specifying extras * chore: fix linting erros * tests: add e2e tests for pipx with extras
Closes #2491
Some Python tools support optional features upon package installation, via
pipx install package[feature,…]
. This is used, for example, by Harlequin.This PR adds support for specifying extras via
NOTE: It only works for tools published to a registry (e.g PyPI), git-based tools require a different syntax than the one already implemented. (
git+...#egg=project[...]
).NOTE: I had some issues setting up the local docker environment (unrelated to this project), so I couldn't run the e2e tests. There may be other parts of the code that could complain if using
[, ]
in the tool name, but the PyPI resolution error is the first one that popped up when trying to use package extras.