mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Merge pull request #8553 from uranusjr/header-location-prefix
Header location prefix
This commit is contained in:
commit
b27956928f
3
news/8521.bugfix
Normal file
3
news/8521.bugfix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Headers provided by wheels in .data directories are now correctly installed
|
||||||
|
into the user-provided locations, such as ``--prefix``, instead of the virtual
|
||||||
|
environment pip is running in.
|
|
@ -138,7 +138,7 @@ def distutils_scheme(
|
||||||
|
|
||||||
if running_under_virtualenv():
|
if running_under_virtualenv():
|
||||||
scheme['headers'] = os.path.join(
|
scheme['headers'] = os.path.join(
|
||||||
sys.prefix,
|
i.prefix,
|
||||||
'include',
|
'include',
|
||||||
'site',
|
'site',
|
||||||
'python{}'.format(get_major_minor_version()),
|
'python{}'.format(get_major_minor_version()),
|
||||||
|
|
|
@ -130,3 +130,19 @@ class TestDistutilsScheme:
|
||||||
scheme = distutils_scheme('example')
|
scheme = distutils_scheme('example')
|
||||||
assert scheme['platlib'] == install_lib + os.path.sep
|
assert scheme['platlib'] == install_lib + os.path.sep
|
||||||
assert scheme['purelib'] == install_lib + os.path.sep
|
assert scheme['purelib'] == install_lib + os.path.sep
|
||||||
|
|
||||||
|
def test_prefix_modifies_appropriately(self):
|
||||||
|
prefix = os.path.abspath(os.path.join('somewhere', 'else'))
|
||||||
|
|
||||||
|
normal_scheme = distutils_scheme("example")
|
||||||
|
prefix_scheme = distutils_scheme("example", prefix=prefix)
|
||||||
|
|
||||||
|
def _calculate_expected(value):
|
||||||
|
path = os.path.join(prefix, os.path.relpath(value, sys.prefix))
|
||||||
|
return os.path.normpath(path)
|
||||||
|
|
||||||
|
expected = {
|
||||||
|
k: _calculate_expected(v)
|
||||||
|
for k, v in normal_scheme.items()
|
||||||
|
}
|
||||||
|
assert prefix_scheme == expected
|
||||||
|
|
Loading…
Reference in a new issue