warnings in pip may be a bug in cpython package build patch
by alijkl from LinuxQuestions.org on (#5S4ZF)
Hello,
Some time ago I gave python3.10 a try on my slackware64-current box and noticed an issue with pip --user.
As it was not usable without custom setting I raised a bug with the warning provided python pip.
One of the maintainer had a look and I cut and past his reply (should be visible on github too).
now moved to: https://github.com/pypa/pip/issues/10668
I don't know how to reply the last question and what it the proper way to report a bug. Any help will be much appreciated.
thanks
-------
I just verified-this is (arguably) a bug in Slackware's CPython patch. It patches sysconfig like this:
'posix_user': {
'stdlib': '{userbase}/{platlibdir}/python{py_version_short}',
'platstdlib': '{userbase}/{platlibdir}/python{py_version_short}',
'purelib': '{userbase}/lib64/python{py_version_short}/site-packages',
'platlib': '{userbase}/{platlibdir}/python{py_version_short}/site-packages',
'include': '{userbase}/include/python{py_version_short}',
'scripts': '{userbase}/bin',
'data': '{userbase}',
},
These are the corresponding lines in upstream CPython for comparison:
https://github.com/python/cpython/bl...fig.py#L69-L77
The difference is Slackware's Python patches purelib to use lib64 instead of lib. This is OK on its own, but Slackware needs to but did not also patch site to match this:
chung@darkstar:~$ python3 -m site
sys.path = [
'/home/chung',
'/usr/lib64/python39.zip',
'/usr/lib64/python3.9',
'/usr/lib64/python3.9/lib-dynload',
'/home/chung/.local/lib/python3.9/site-packages',
'/usr/lib64/python3.9/site-packages',
]
USER_BASE: '/home/chung/.local' (exists)
USER_SITE: '/home/chung/.local/lib/python3.9/site-packages' (exists)
ENABLE_USER_SITE: True
which causes the warning because pip correctly detects that packages installed to the incorrectly patches sysconfig locations will work (because the incorrect path is not in USER_SITE or sys.path). So Slackware should either patch site, or remove the posix_user patch in sysconfig. Fedora had a similar issue and chose to do the latter, see bpo-44860.
So the bottom line is Slackware should fix this bug. In the meantime though, I'll submit a patch in pip to detect and slience the warning since there's nothing pip can do in this situation.
Some time ago I gave python3.10 a try on my slackware64-current box and noticed an issue with pip --user.
As it was not usable without custom setting I raised a bug with the warning provided python pip.
One of the maintainer had a look and I cut and past his reply (should be visible on github too).
now moved to: https://github.com/pypa/pip/issues/10668
I don't know how to reply the last question and what it the proper way to report a bug. Any help will be much appreciated.
thanks
-------
I just verified-this is (arguably) a bug in Slackware's CPython patch. It patches sysconfig like this:
'posix_user': {
'stdlib': '{userbase}/{platlibdir}/python{py_version_short}',
'platstdlib': '{userbase}/{platlibdir}/python{py_version_short}',
'purelib': '{userbase}/lib64/python{py_version_short}/site-packages',
'platlib': '{userbase}/{platlibdir}/python{py_version_short}/site-packages',
'include': '{userbase}/include/python{py_version_short}',
'scripts': '{userbase}/bin',
'data': '{userbase}',
},
These are the corresponding lines in upstream CPython for comparison:
https://github.com/python/cpython/bl...fig.py#L69-L77
The difference is Slackware's Python patches purelib to use lib64 instead of lib. This is OK on its own, but Slackware needs to but did not also patch site to match this:
chung@darkstar:~$ python3 -m site
sys.path = [
'/home/chung',
'/usr/lib64/python39.zip',
'/usr/lib64/python3.9',
'/usr/lib64/python3.9/lib-dynload',
'/home/chung/.local/lib/python3.9/site-packages',
'/usr/lib64/python3.9/site-packages',
]
USER_BASE: '/home/chung/.local' (exists)
USER_SITE: '/home/chung/.local/lib/python3.9/site-packages' (exists)
ENABLE_USER_SITE: True
which causes the warning because pip correctly detects that packages installed to the incorrectly patches sysconfig locations will work (because the incorrect path is not in USER_SITE or sys.path). So Slackware should either patch site, or remove the posix_user patch in sysconfig. Fedora had a similar issue and chose to do the latter, see bpo-44860.
So the bottom line is Slackware should fix this bug. In the meantime though, I'll submit a patch in pip to detect and slience the warning since there's nothing pip can do in this situation.