-
Notifications
You must be signed in to change notification settings - Fork 17
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
relenv breaks pip install #182
Comments
@smarsching Can you confirm or deny that these packages will install successfully by adding the |
@smarsching Here is a tentative patch for the fix: |
@Dowz I checked and adding the I also applied your patch to relenv 0.16.0, which is bundled with Salt 3006.8, and it does not fixe the issue for me:
I fixed the typo |
Okay, sorry to have you test a patch with typos. I've opened a PR with my changes and tests. Hopefully, these changes should work: #183 |
Recent versions of relenv (at least 0.15.0, 0.15.1, and 0.16.0) break
pip install
when used with the--target
argument.This causes
salt-pip
not to work correctly when trying to install some Python modules likemysqlclient
(saltstack/salt#65980) orM2Crypto
(saltstack/salt#66311).I can definitely track this down to an issue in
relenv
because the problem can be resolved by commenting removing a single line in relenv’sruntime.py
:As this might have undesired side effects (I do not understand the code well enough to be sure): I also tried more localized changes and came up with the following patch that resolves the issue:
In order to resolve the error when trying to install the module, the change that avoids setting
scheme.platlib
andscheme.purelib
is sufficient, but when only applying this change and not the other changes, the installed modules end up in/opt/saltstack/salt/extras-3.10/lib/python
instead of/opt/saltstack/salt/extras-3.10
.When applying the change regarding
scheme.purelib
andhome = TARGET.PATH
, but not removing the wrapper for_handle_target_dir
, there is no error but the module is not installed at all.If I understand it correctly,
home
is usually set to a temporary directory and_handle_target_dir
copies it from there to the actual target path. This is why not overridinghome
but replacing_handle_target_dir
results in the module not being installed at all (it ends up in the temporary directory and is never moded from there).@dwoz Unfortunately, I do not understand the intention behind this code, so I am not sure whether my fix is correct or might break something else. As it seems like you wrote most of this code, I hope that you might be able to explain what this code is supposed to do.
Maybe this code was targeted at an older version of pip, and due to changes in pip, it does not work correctly any longer (after all, the code messes with internals of pip). I tested my patch with Salt 3006.8, which bundles pip 23.3.2.
Some of the commits that added the code that is removed by my patch say something about fixing
pip uninstall
, but at fore the aforementioned version of pip, uninstall still works correctly after applying my patch.The text was updated successfully, but these errors were encountered: