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

Allow adding virtualenv's /bin to PATH when executing command #1369

Open
NotAFile opened this issue Apr 24, 2024 · 0 comments
Open

Allow adding virtualenv's /bin to PATH when executing command #1369

NotAFile opened this issue Apr 24, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@NotAFile
Copy link

How would this feature be useful?

There are some tools which, despite being python, do not offer a stable API for certain actions. One such example would be the way that molecule uses ansible-playbook: https://github.com/ansible/molecule/blob/main/src/molecule/provisioner/ansible_playbook.py#L90

In a normal virtualenv, this would be fine as the activate script prepends $VIRTUAL_ENV/bin to the PATH. However, with pipx this does not happen, which leads to either not finding the command, or using in incompatible version that happens to be installed on the system.

Using --include-deps works somewhat, but overwrites any version installed elsewhere the system. It also breaks with the --suffix feature, as the binaries now no longer have the expected name.

Describe the solution you'd like

Some way of ensuring that the command has access to the binaries from it's virtualenv in it's PATH

Describe alternatives you've considered

  • Patching or wrapping the application to prepend $VIRTUALENV/bin to PATH, if it exists
  • Patching the application to be able to override the path of all commands it executes
@chrysle chrysle added the enhancement New feature or request label Apr 24, 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

2 participants