-
Notifications
You must be signed in to change notification settings - Fork 72
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
Allow sysconfig to override install schemes... #23
Conversation
…ility overrides for debian and fedora until they patch sysconfig.
@encukou, @doko42 Please have a look and let me know your thoughts, especially about the broad strokes. In particular:
This change doesn't attempt to address the alternate naming for 'egg-info' files (without Python version). That'll be handled in a separate PR if needed. |
I don't think it should. Who konws how many variants there are; Distutils isn't likely to get all of them right.
For customizing locations on future systems, this looks good. Thank you! Another thing I'm worried about is that |
I share the intent to help users not to brick their system, having similar patches in Debian and Ubuntu. The proposed solution however makes 'unix_local' use the same location as somebody doing ./configure --prefix=/usr/local. Note that --prefix=/usr/local is implicit ( the default). You would now have a common modules dir for two different Python installations. I remember @warsaw suggested to use different locations for that. |
Co-authored-by: Petr Viktorin <encukou@gmail.com>
The
I'd like to avoid both "behavior on import" and also help limit use of |
I'm unsure what logic is needed to inject local under what circumstances. I'd really like someone with more experience in this domain to propose a solution. In da44ac0, I remove the 'unix_local' install scheme for now. |
…e schemes are updated in sysconfig.
da0e19a
to
dcafd57
Compare
IMO, having a |
This latest draft is minimally invasive, but promises to provide the necessary hook to enable install schemes to be overridden in sysconfig. @FFY00 Can you confirm this approach uses the correct attribute? |
5c128af
to
28e6439
Compare
Now this change incorporates the recommendation to use The tests were only failing on Windows, which led me to realize that it's the keys also that are different between sysconfig and distutils. Distutils uses "unix" whereas sysconfig uses "posix", which means that with the current implementation, only "nt" is getting the new semantics treatment. I think the best thing would be to also move distutils over to the "posix" naming to consistently apply the shift to sysconfig-based configs... and in fact probably remove any local schemes that are superseded by those in stdilb. |
In this latest commit (5c5aed1), I update the naming to match that of upstream, and when I do, one test in particular starts to fail:
This failure reveals several defects with the current approach:
I believe this all boils down to detecting that distutils: Ignoring for a moment that At this point, I'm not sure it's going to be possible to rely on install schemes from sysconfig. They've drifted too far from what distutils expects to be reliable. I can imagine that maybe distutils could keep its own copy of the default sysconfig values and the more customized distutils values, and prefer the customized values if the sysconfig values are set to defaults. But what a nightmare would that be? Until the install schemes specified in sysconfig are aligned with those that distutils expects, this approach is not going to be viable. It seems to me we have two choices:
@FFY00 Are those our only choices? How would you recommend to proceed? |
Yes, that was the main issue I found when migrating from distutils. It is described here: https://bugs.python.org/issue44445 Currently, I am getting the I think the best way to solve this is, like proposed in the bpo, adding a This is a major issue with the distutils deprecation and must be solved before 3.12. If distutils cannot use sysconfig for the paths, there is an incompatibility and sysconfig is not a proper replacement. |
Thanks for the pointers there. I do indeed see the issue. I do believe it's going to be a long and difficult road to harmonize
This approach should provide compatibility while also allowing the downstream packagers to override the |
This sounds reasonable to me as a solution for now, until we fix this properly. |
This reverts commit e4466cd.
Tests are passing here and also in pypa/setuptools#2875. |
...and provide some compatibility overrides for debian and fedora until they patch sysconfig.
Fixes #12.