-
Notifications
You must be signed in to change notification settings - Fork 71
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
Figure out how to incorporate Fedora's (and openSUSE's) lib64 patches on Python 3.7/3.8 #110
Comments
Looking at the current implementation of pypa/distutils, it seems we only need to set |
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
Work in progress PR for python3.8: https://src.fedoraproject.org/rpms/python3.8/pull-request/54 |
I'll confess, I'm slightly uneasy with altering a value in |
Yeah, my idea is to set it, and try to see what it breaks. |
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
Setuptools v60 and later include a bundled version of distutils, a deprecated standard library scheduled for removal in future versions of Python. Setuptools v60 is only possible to install for Python 3.7 and later. Python has a distutils.sysconfig.get_python_lib() function that returns '/usr/lib/pythonX.Y' on posix systems. RPM-based systems actually use '/usr/lib64/pythonX.Y' instead, so Fedora patches stdlib distutils for Python 3.7 and Python 3.8 to return the correct value. Python 3.9 and later introduce a sys.platlibdir property, which returns the correct value on RPM-based systems. The change to a distutils package not provided by Fedora on Python 3.7 and 3.8 causes a regression in distutils.sysconfig.get_python_lib() that ultimately causes false positives to be emitted by pylint, because it can no longer find the system source libraries. Many Python tools are fairly aggressive about updating setuptools packages, and so even though this package is a fair bit newer than Python 3.7/3.8, it's not entirely unreasonable for a given user to have such a modern package with a fairly old Python interpreter. Updates to Python 3.7 and Python 3.8 are being produced for Fedora which will fix the problem on up-to-date systems. Until then, we can force the loading of platform-provided distutils when running the pylint test. This is the least-invasive yet most comprehensive fix. References: pypa/setuptools#2896 pylint-dev/pylint#5704 pypa/distutils#110 Signed-off-by: John Snow <[email protected]> Message-id: [email protected] Signed-off-by: John Snow <[email protected]>
That's great. Does that mean this issue is done? Optimistically closing, but feel free to report back if not. |
Yes, it is hopefully resolved for Fedora at least. |
Setuptools v60 and later include a bundled version of distutils, a deprecated standard library scheduled for removal in future versions of Python. Setuptools v60 is only possible to install for Python 3.7 and later. Python has a distutils.sysconfig.get_python_lib() function that returns '/usr/lib/pythonX.Y' on posix systems. RPM-based systems actually use '/usr/lib64/pythonX.Y' instead, so Fedora patches stdlib distutils for Python 3.7 and Python 3.8 to return the correct value. Python 3.9 and later introduce a sys.platlibdir property, which returns the correct value on RPM-based systems. The change to a distutils package not provided by Fedora on Python 3.7 and 3.8 causes a regression in distutils.sysconfig.get_python_lib() that ultimately causes false positives to be emitted by pylint, because it can no longer find the system source libraries. Many Python tools are fairly aggressive about updating setuptools packages, and so even though this package is a fair bit newer than Python 3.7/3.8, it's not entirely unreasonable for a given user to have such a modern package with a fairly old Python interpreter. Updates to Python 3.7 and Python 3.8 are being produced for Fedora which will fix the problem on up-to-date systems. Until then, we can force the loading of platform-provided distutils when running the pylint test. This is the least-invasive yet most comprehensive fix. References: pypa/setuptools#2896 pylint-dev/pylint#5704 pypa/distutils#110 Signed-off-by: John Snow <[email protected]> Message-id: [email protected] Signed-off-by: John Snow <[email protected]>
Setuptools v60 and later include a bundled version of distutils, a deprecated standard library scheduled for removal in future versions of Python. Setuptools v60 is only possible to install for Python 3.7 and later. Python has a distutils.sysconfig.get_python_lib() function that returns '/usr/lib/pythonX.Y' on posix systems. RPM-based systems actually use '/usr/lib64/pythonX.Y' instead, so Fedora patches stdlib distutils for Python 3.7 and Python 3.8 to return the correct value. Python 3.9 and later introduce a sys.platlibdir property, which returns the correct value on RPM-based systems. The change to a distutils package not provided by Fedora on Python 3.7 and 3.8 causes a regression in distutils.sysconfig.get_python_lib() that ultimately causes false positives to be emitted by pylint, because it can no longer find the system source libraries. Many Python tools are fairly aggressive about updating setuptools packages, and so even though this package is a fair bit newer than Python 3.7/3.8, it's not entirely unreasonable for a given user to have such a modern package with a fairly old Python interpreter. Updates to Python 3.7 and Python 3.8 are being produced for Fedora which will fix the problem on up-to-date systems. Until then, we can force the loading of platform-provided distutils when running the pylint test. This is the least-invasive yet most comprehensive fix. References: pypa/setuptools#2896 pylint-dev/pylint#5704 pypa/distutils#110 Signed-off-by: John Snow <[email protected]> Message-id: [email protected] Signed-off-by: John Snow <[email protected]>
Setuptools v60 and later include a bundled version of distutils, a deprecated standard library scheduled for removal in future versions of Python. Setuptools v60 is only possible to install for Python 3.7 and later. Python has a distutils.sysconfig.get_python_lib() function that returns '/usr/lib/pythonX.Y' on posix systems. RPM-based systems actually use '/usr/lib64/pythonX.Y' instead, so Fedora patches stdlib distutils for Python 3.7 and Python 3.8 to return the correct value. Python 3.9 and later introduce a sys.platlibdir property, which returns the correct value on RPM-based systems. The change to a distutils package not provided by Fedora on Python 3.7 and 3.8 causes a regression in distutils.sysconfig.get_python_lib() that ultimately causes false positives to be emitted by pylint, because it can no longer find the system source libraries. Many Python tools are fairly aggressive about updating setuptools packages, and so even though this package is a fair bit newer than Python 3.7/3.8, it's not entirely unreasonable for a given user to have such a modern package with a fairly old Python interpreter. Updates to Python 3.7 and Python 3.8 are being produced for Fedora which will fix the problem on up-to-date systems. Until then, we can force the loading of platform-provided distutils when running the pylint test. This is the least-invasive yet most comprehensive fix. References: pypa/setuptools#2896 pylint-dev/pylint#5704 pypa/distutils#110 Signed-off-by: John Snow <[email protected]> Message-id: [email protected] Signed-off-by: John Snow <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
… /usr/lib/ Only used when "%{_lib}" == "lib64". Also sets sys.platlibdir to "lib64" for pypa/distutils#110 Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
See pylint-dev/pylint#5704 and pypa/setuptools#2896 (comment)
Apparently, I have completely forgotten that on Python < 3.9, we do patch distutils in one more way: We replace /usr/lib with /usr/lib64 on 64bit architectures.
See our patches:
I am opening this issue to track this problem. I don't expect you to fix it, I plan to have a look, but not today.
The text was updated successfully, but these errors were encountered: