Skip to content

Commit 6f566c7

Browse files
committed
setup.py: use absolute paths for pth files
On some systems (such as PyPy3 on Gentoo), distutils' `data` path is not `sys.prefix`, which means that we cannot rely on relative paths.
1 parent 3935774 commit 6f566c7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ def find_pth_directory():
6666
Determine the correct directory pathname for installing ``*.pth`` files.
6767
6868
To install a ``*.pth`` file using a source distribution archive (created
69-
when ``python setup.py sdist`` is called) the relative directory pathname
70-
``lib/pythonX.Y/site-packages`` needs to be passed to the ``data_files``
71-
option to ``setup()``.
69+
when ``python setup.py sdist`` is called) the directory pathname
70+
``/usr/lib/pythonX.Y/site-packages`` needs to be passed to the ``data_files``
71+
option of ``setup()``.
7272
7373
Unfortunately this breaks universal wheel archives (created when ``python
7474
setup.py bdist_wheel --universal`` is called) because a specific Python
@@ -81,7 +81,7 @@ def find_pth_directory():
8181
directory without hard coding its location.
8282
"""
8383
return ('/' if 'bdist_wheel' in sys.argv
84-
else os.path.relpath(distutils.sysconfig.get_python_lib(), sys.prefix))
84+
else distutils.sysconfig.get_python_lib())
8585

8686

8787
setup(name='coloredlogs',

0 commit comments

Comments
 (0)