-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Try to make distutils not emit relative paths #10257
Conversation
725b75f
to
7d5a65c
Compare
@mdmintz @msapiro Continuing the conversation in #10151, did you use the built-in It would also be awesome if you could provide the following outputs for me (from the problematic virtual environment): import sys
print(sys.prefix)
print(sys.base_prefix)
print(sys.real_prefix) |
7d5a65c
to
b4055ed
Compare
I have tried to duplicate this issue on two different servers including the one where I see the issue by creating new directories and virtualenvs that mimic the problem layout, but when I do this, I don't see the issue. When I mimic the activation and cd that my script does when I see the problem, I get
When I then do without anything in between
I get
virtualenv --version gives me One other thing which is puzzling. The script that I run actually does the |
@uranusjr The virtual environment was created with Here's the
And here's the latest info you wanted:
|
Thanks for the additional information! I tried multiple virtualenv versions and was able to reproduce this with virtualenv 13.1.2 (likely earlier). I will still try to fix this warning, but recreating the virtual environment with a newer version of Another side note, the output when creating the environment is quite indicative:
You can see how 13.1.2 creates a new python executable at a relative path, but 14.0.6 makes the path absolute. |
Our own override for the distutils implementation has a bug :)
virtualenv<14 does not normalize sys.prefix correctly, so we need to do it on our own.
b4055ed
to
a3b186a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand all of it, but looks good to me for the bits that I can understand.
It’s mostly backward compatibility stuff (some variable/function used before is broken on old version of something so we need to do the same thing with another variable/function). So if you can’t understand the difference, it’s probably right 😆 |
I confirm that this fixes my issue. |
#10151 (comment)
#10151 (comment)
To prevent distutils from returning weird paths, try to normalise the target prefix before passing it into distutils.Not sure how well this would work, so not pinging people for testing yet…Turns out the original implementation simply had a bug… This should fix the relative path issue (but not the normalisation part).