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

Support for default groups #1322

Open
patrick91 opened this issue Apr 3, 2024 · 2 comments
Open

Support for default groups #1322

patrick91 opened this issue Apr 3, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@patrick91
Copy link

Hi there!

I have a project that has an option command line interface, which can be installed via pip install lib[cli]

This is not a big deal, but I was wondering if pipx could support a default group for when running/installing a library, so users would only need to run pipx run lib (or pipx install lib)

This would remove some friction in using the cli from my library, and also prevent some small issue like quoting (some shells don't like the [] syntax 😊)

Maybe pipx could check if there's a cli group, or maybe we can add some metadata on the package?

Not sure if all of these are feasible 😊

Another option on myside would be to check if the dependencies are missing and tell the user to run install/run lib[cli], but I'd like to avoid one extra step if possibile 😊

@chrysle
Copy link
Contributor

chrysle commented Apr 3, 2024

This is not a big deal, but I was wondering if pipx could support a default group for when running/installing a library, so users would only need to run pipx run lib (or pipx install lib)

Hmm, you mean whenever installing a library, a cli extra should be installed? AFAIK, there is no such standard that a library should expose its CLI interface via an extra called that way? I do think the behaviour that we have right now is correct, and if I understand you correctly, the only way to detect an entry point within a library would be searching amongst its extras, which I think is a bit overshooting.

@patrick91
Copy link
Author

patrick91 commented Apr 4, 2024

@chrysle just to clarify, I don't think pipx is doing anything wrong, I was just thinking if there's a way to make the experience better in some cases 😊

This was inspired by a conversation I had with @dbanty, as we were chatting about default dependencies (inspired by cargo: https://doc.rust-lang.org/cargo/reference/features.html)

the only way to detect an entry point within a library would be searching amongst its extras, which I think is a bit overshooting.

Yeah probably, I wonder if there's something we can add in the package metadata for that? Also maybe it could be better to use a pipx group, so there are less potential issues?

Also, I'm totally fine with closing this issue if you don't think is a good addition :D

@Gitznik Gitznik added the enhancement New feature or request label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants