-
Notifications
You must be signed in to change notification settings - Fork 446
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
Should installing pipx shared libs use pip_args
from the latest package?
#544
Comments
In almost all cases it's probably fine to not use |
Yeah a private index was the only thing I could think of. But I couldn't rationalize why they would want to use a private index for |
Yeah agreed. I guess in that case they couldn't install in the first place? There are also environment variables for pip to proxy requests, i.e. |
I'm also kind of assuming that since we inconsistently apply |
#shipit |
I almost hate to bring this up because I really want to just #shipit, but I'm wondering about the use of Indeed @cs01 seems to have brought up the issue in the PR that added this code and it was never addressed unfortunately: For reference, here's the stackoverflow article that I seem to have found independently after @cs01: I like the clean reinstall on the first-time creation of the shared libs, (even if we think Debian has fixed its problems), but I'm thinking that maybe it should be I did try it on my Ubuntu system with no ill effects, so unless somebody has a problem I'm going to make this change in the PR I'm writing. |
...aaaaaand I'm here 😎 I have exactly this issue: using a private index, and pypi.org is blocked. It's not that bad, there are alternative solutions (#604). More context: I'm a bit facing a chicken-and-egg problem. Devs here work on Linux and Windows, so I wrote a Python script (cross-compatible) that will configure their environment so they can use our private index, etc. But then... this script is published on our private index 😑 So how do I install it? By passing the right options to pip to install pipx, and the same options to pipx to install the script. It led me to #604 😄 Conclusion: it's fine. Maybe there are possible improvements to do in pipx regarding pip args. Surely this should simply be documented, in a troubleshooting note for example 🙂 I can open a PR for that! |
If this was a one time command and you didn't want to modify the env variables persistently, you could do something like:
(Or depending on your shell you might have to prefix that with the I see the need here for some kind of mechanism. But I can't think of any easier way to set this for pipx, than there is to set the environment variables for pip. So to reduce complexity I think I tend to agree that what is best is to add a note in the docs somewhere on how to alter pip behavior in this case. |
Describe the bug
Currently when installing or upgrading the pipx shared libs, the functions
_SharedLibs.upgrade()
and_SharedLibs.create()
acceptpip_args
arguments.https://github.com/pipxproject/pipx/blob/08bd15610bc406dabe8bf0db4adaba4a3a8b89ea/src/pipx/shared_libs.py#L33
https://github.com/pipxproject/pipx/blob/08bd15610bc406dabe8bf0db4adaba4a3a8b89ea/src/pipx/shared_libs.py#L61
They are used if a normal
pipx install
needs a shared library create/upgrade, and thepipx install
pip args are used to also create the shared libs.They are NOT used when creating/upgrading the shared libs during a
pipx list
or any access of an existing venv. (!!)Recently this failed for me in the following situation: In a Python 3.6 test I was trying to install a package for the first time using the pip arguments
--use-feature=2020-resolver
. It caused pipx to fail with an error because before installing the package, it went to install the shared libs using pip argument--use-feature=2020-resolver
. Since the original Python 3.6 pip doesn't have that option, it couldn't even upgrade pip in the first place and crashed.I'm wondering if we should just remove
pip_args
from_SharedLibs.upgrade()
and_SharedLibs.create()
. It seems kind of arbitrary that only when upgrading the shared libs during a package install do they get thepip_args
that happen to be used for that package, but not otherwise.Is there a reason a user would need custom pip args to be used with the installation of the shared libs? If so, maybe we need a different more reliable mechanism.
How to reproduce
Expected behavior
The text was updated successfully, but these errors were encountered: