Parse 'pipx run' input and infer the app name like 'pipx install'
See original GitHub issueHow would this feature be useful?
This would make pipx run
immensely more user friendly and easier to type without resorting to a readme or scanning the --help
for the correct run syntax.
Background
Given an app called tap-mysql
currently, pipx run tap-mysql --help
works great! It knows that the plugin’s name is tap-mysql
and it attempts to run a command with that same name (tap-mysql --help
in this example),
Given an a more complex pip_url (like tap-mysql==1.4
or git+https://github.com/singer-io/tap-mysql.git
), could pipx
doesn’t use the detected package name to attempt the same. Instead, the package is installed and then the command will immediately fail.
$ pipx run tap-mysql --help
usage: tap-mysql [-h] -c CONFIG...
... # works perfectly
$ pipx run tap-mysql==1.17.5 --help
'tap-mysql==1.17.5' executable script not found in package 'tap-mysql==1.17.5'. Available executable scripts: tap-mysql
So in theory, we could put those two things together and let this work out of box?: pipx run <any_pip_url> --help
Describe the solution you’d like
The requested feature improvement would be to use the detected package name as the app name if --spec
is not detected and if the argument passed to pipx run
was a complex pip_url, such as a git ref or a version-pinned ref.
Already pipx
does have the logic to detect package name, and pipx run
already accepts simple package names without having to separately pass the app name.
pipx run tap-mysql --help # already works today
pipx run tap-mysql==1.17.5 --help # would be new
pipx run git+https://github.com/singer-io/tap-mysql@main.git --help # would be new
Describe alternatives you’ve considered
The workaround is to explicitly send the executable name and pip URL separately using pipx run --spec <pip_url> <app_name>
. However, this is not very portable and since most pipx commands do not require remembering the --spec
.
Instead of running like this:
pipx run git+https://github.com/singer-io/tap-mysql.git --help
or
pipx run tap-mysql==1.0.5 --help
We would need to add tap-mysql
at the end also.
pipx run --spec=git+https://github.com/singer-io/tap-mysql.git tap-mysql --help
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Based on the comments from @meowmeowmeowcat and others, I’ve confirmed that this issue seems specific to git refs.
Version-pinned refs seem to resolve the app name without issue.
We should allow users to run the app without
--spec
if the app name provided is an SVN URL, so a command likepipx run git+https://github.com/ansible/ansible-lint.git --version
can be run successfully. After auto name inferring, it should getansible-lint
and use this name to run the app.