-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix PEP 518 support #5190
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
fix PEP 518 support #5190
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix PEP 518 support. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| """ | ||
|
|
||
| import os | ||
| from distutils.sysconfig import get_python_lib | ||
| from sysconfig import get_paths | ||
|
|
||
| from pip._internal.utils.temp_dir import TempDirectory | ||
|
|
@@ -38,11 +39,14 @@ def __enter__(self): | |
| else: | ||
| os.environ['PATH'] = scripts + os.pathsep + os.defpath | ||
|
|
||
| if install_dirs['purelib'] == install_dirs['platlib']: | ||
| lib_dirs = install_dirs['purelib'] | ||
| # Note: prefer distutils' sysconfig to get the | ||
| # library paths so PyPy is correctly supported. | ||
| purelib = get_python_lib(plat_specific=0, prefix=self.path) | ||
| platlib = get_python_lib(plat_specific=1, prefix=self.path) | ||
| if purelib == platlib: | ||
| lib_dirs = purelib | ||
| else: | ||
| lib_dirs = install_dirs['purelib'] + os.pathsep + \ | ||
| install_dirs['platlib'] | ||
| lib_dirs = purelib + os.pathsep + platlib | ||
|
||
| if self.save_pythonpath: | ||
| os.environ['PYTHONPATH'] = lib_dirs + os.pathsep + \ | ||
| self.save_pythonpath | ||
|
|
||
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.
I assume the changes to this block are related to PyPy support? Having a comment here explaining what's going on would be really useful (from my tests on Windows,
get_python_libreturns absolute paths, so what's up with appending platlib to purelib?)(I know this is basically code that was already present, so I'm happy if the answer is that you don't know enough of the detail to write a reasonable comment).
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.
I'll add a comment. As for appending, see comment above.
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.
Realising it's
os.pathsep, the comment's probably not needed...