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

pipx run -> _download_and_run: error branch can never execute properly #253

Closed
itsayellow opened this issue Oct 27, 2019 · 1 comment
Closed

Comments

@itsayellow
Copy link
Contributor

Describe the bug
In commands.py, in function run(): run() calls _download_and_run() with the variable package_or_url where _download_and_run() is expecting argument package.

The result is that if the if branch executes for this statement in _download_and_run():

    if not (venv.bin_path / app).exists():

_download_and_run() will try and execute venv.get_venv_metadata_for_package(package).

If the package argument to _download_and_run() is in fact a url (as it could be if run() is called with a --spec argument) then venv.get_venv_metadata_for_package(package) will fail because it is expecting a package name and not a url.

How to reproduce
One would need to call pipx run with a --spec argument with a url and a non-existent app. For example by modifying an example from the pipx makefile:
pipx run --spec=git+https://github.com/cs01/nox.git@5ea70723e9e6 notnox

Unexpected behavior
Because notnox is not an app in the package, the error if statement will execute. However venv_metadata_inspector.py will find no package named git+https://github.com/cs01/nox.git@5ea70723e9e6 and so will return empty information about the venv. Thus the printed error message has no apps to show as available or associated with the package in the venv.

@itsayellow
Copy link
Contributor Author

itsayellow commented Dec 7, 2019

After merging #222, I cannot reproduce the bug (pipx works fine now.)

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

1 participant