-
Notifications
You must be signed in to change notification settings - Fork 3.1k
distutils: distro config file not copied to overlay directory #10949
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
Comments
A PR to fix this would be welcome. It should be noted, however, that NetBSD is not a supported platform so a reproducer for this on a supported platform would also be helpful here. |
@pfmoore I don't know the code base, can you please give me some pointers where this could be added? |
Class |
Here's the shell equivalent of what needs to happen:
Can you please add this in the appropriate python code? |
@0-wiz-0 it works on fedora with overridden |
If you could provide a way to reproduce this, on a Linux system (eg: Fedora, RHEL, Ubuntu, Debian etc) that'd be great. |
This patch fixes the problem for me:
|
|
Why does the file need to be copied? The point of having an isolated environment is so it has a fresh set of build tools and does not need to rely on the outside environment. This is conceptually against the grains of environment isolation. |
pkgsrc has patches for Python to handle different operating systems the same way, to make the list of installed files the same. This is a property of Python itself on platforms using pkgsrc. |
This sounds like something pip should not do. Unless the distro override is standardised, there’s no reason why pip needs to implement a special treatment for a setuptools-specific mechanism. Environment isolation and PEP 517 is designed exactly to abstract away build tools specifics in the first place. |
I think I agree with @uranusjr here. The linked setuptools issue describes the override as a short term solution. It also appears that there is a similar request for virtualenv. Does the stdlib venv module need this too? That’s a lot of work to handle a short term problem in setuptools. I think that either the mechanism being used needs to be standardised, or setuptools needs to come up with a fix that doesn’t require multiple other tools to add special cases for it. |
@jaraco writes about a long-term solution in distutils, true, but as far as I understand, distutils development is dead, so that will not be coming. Perhaps they can chime in about distutils development and if that change will ever come? @jaraco also writes that pip previously copied distutils, so copying one file instead is less work and equivalent. |
Distutils development is alive and well insofar as it’s used as a basis for Setuptools. Other uses are discouraged but still supported. |
Description
setuptools recently added a distro-config file for distutils (see e.g. pypa/setuptools#2896). pkgsrc uses this feature.
pip does not copy this file to its overlay directory, causing 'pip install' to fail. 'pip install --no-build-isolation' works.
Example output of the error:
(This particular error happens because the pkgsrc distro config file overrides
_sysconfig_name_tmpl
to_sysconfigdata_${platform}
.)Expected behavior
pip should provide the
_distutils_system_mod.py
in its overlay directory, if the file exists.pip version
21.3.1
Python version
3.10.2
OS
NetBSD
How to Reproduce
pip install 'PyYAML<6'
though probably any package works.Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: