-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Python is deprecating distutils.cfg
#76621
Comments
This links a bit with the
Perhaps best to wait for the outcome of this before acting. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
As a related follow-up, a conversation happend during PyCon US last week between PyPA and Linux distribution folks around how the make distribution package managers (e.g. |
Related: geofft/peps#3 |
Hi @uranusjr, thanks for that info. I don't know about anyone else on the Homebrew team but I've joined the linux-sig list you linked for now. Reading through that draft PEP now (thanks Carlo). |
This comment has been minimized.
This comment has been minimized.
For users: yes. AFAIK nothing is broken yet. The warning still seems a bit early considering a proper solution forward has not yet been agreed in the Python community. The discussion in the linked draft PEP appears to have stalled for now. It seems the pip team might be trying to push us into applying custom patches. This is not a long term solution at all and is not something we want to maintain in the long run. Assuming |
IYAM it's not something we want to maintain in the short term either and if upstream prefers to ship a broken system, Homebrew's stance on patches makes it perfectly fine for us to ship said broken version. |
I think the main problem is I failed to communicate the situation clearly, so please let me try to describe what we’re facing and hopefully provide enough context for the situation. Python 3.12 is going to remove distutils, and along with it, support for Pip, like Homebrew, is currently relying on distutils functionalities, and have the same 3.12 deadline. We are therefore trying to rewrite things in pip to keep it working on Python 3.12 onwards. However, some of the new code, since it can’t depend on distutils and This is what the warning is about: to raise awareness to the issue, and hopefully gather enough resources and contribute to a resolution. We want pip to work on both Python 3.12 (Homebrew or otherwise), and a Python (<3.12) distributed by Homebrew, but this is not possible without help from Homebrew’s Python distribution maintainers. (Note that pip developers are not CPython developers, so we are not in the best position to come up with a solution that suits Homebrew best, although we are definitely good at checking whether a proposed solution would work!) |
That's gonna be really hard because Homebrew doesn't have a concept of package maintainers. All Homebrew maintainers maintain all packages (or the brew tool) and the public can modify packages however they see fit, as long as it's within the rules defined in docs.brew.sh |
Then I guess that sort of enhance my belief we should keep the warning until we can find someone in the public willing to come up with something :) Please do also provide any suggestions how we could improve the warning’s presentation to maximise the effect as well! |
This comment has been minimized.
This comment has been minimized.
Would the Allow Python distributors to add custom site install schemes feature make it easy enough for Homebrew (& others) to switch from distutils to sysconfig? If not, what can the Python / sysconfig people do to make Homebrew's (& others') transitions easier? If so, wouldn't it make sense for the Python / sysconfig maintainers to implement that feature before removing distutils? |
Nothing for now since pip is not going to break anything for existing Python versions. But you probably want to come back to this issue before Homebrew tries to upgrade Python to 3.11 (or more critically 3.12) and see if the issue is resolved yet and decide if you want to apply the upgrade.
Of course it does, but in the end it’s up to the downstream distributors to tell CPython what they want. If no-one says anything, CPython maintainers can only assume everyone is fine with the removal. (Which is what the b.p.o. issue you linked is expressing; FFY00 is the Python distributor for Arch Linux IIRC, so CPython maintainers are trying to understand their needs and adjust sysconfig accordingly.) |
Has anyone from Homebrew told CPython what they want / need? If not, why? If so, will CPython provide it? If they won't provide it, why? If they will provide it, what is left to discuss? (I assume this isn't the scenario, since discussion would presumably have ended if it were so) |
Currently we provide a distutils.cfg as such:
To my understanding, the way to configure
It's no different than bpo-43976, so there's not much to add there. Having a I'm happy however to be involved in any necessary discussions however.
Honestly, I don't know. I can leave a comment as a "poke" but maybe that's more annoying than helpful. |
bpo-43976 seems to indicate that Homebrew will have to implement a patch for the Python install. You (@Bo98) & @SMillerDev indicated that you don't want to do that for the long term, and possibly not even for the short term. Is that correct? @uranusjr If a patch would be required, would it be just some simple boilerplate around a few settings, rather than a significant effort? If so, would the boilerplate be stable for a long time, or might it need to be frequently changed for new Python versions? If the patch would be fairly simple & stable, would the Homebrew maintainers be amenable to using such a patch? If you aren't amenable to using a patch that is both simple & stable, why? If the patch should be fairly simple, could someone from CPython / Python / pip / whatever provide a simple patch with placeholders for the values that Homebrew (or others) would supply? Could they commit to providing updates for the simple patch of it must be modified for a new Python version? If a simple patch would cover most downstream use cases, could CPython (or whoever) just provide the equivalent of that patch either as install options for the values themselves and/or as an install option to specify a config file that provides the values? Sorry if this has all been answered before, but there are too many comments to quickly find the current status. Can the current status of everything be inserted into the initial issue comment, so everyone can get up to speed quickly? Thanks for any info. |
No, bpo-43976 is a request to add a system to customise without applying patches. We don't consider adding new files as a patch (we already do this with |
I've added a short note for end users seeing the pip warning, since that'll be what most of the traffic here will be. People interested in the implementation details can follow along with the comments. |
@Bo98 I am not faimilar with the situation for setuptools either, but setuptools is known for keeping compatibility above almost everything, so I wouldn’t be surprised if they keep supporting @rgoldberg See Debian’s patch. Essentially you need make I think this also somewhat answers your other question about why there is not a commonly maintained patch, or even upstreamed back into CPython. Each downstream distributor does things a bit differently, so their patches also need to slightly differ, and they can’t agree on what to upstream in the first place (the metioned in-draft PEP is an effort toward some kind of common ground, but it’s just very hard). I believe Red Hat’s patch is actually more popular than Debian’s (also used by at least Cygwin and MSYS2), but their setups are also significantly different from Homebrew’s. Homebrew’s setup is (from my very limited experience) actually most similar to NixOS(?) but Nix does some very fancy stuff because they have very ambitious goals not perused by anyone else. |
Sorry. I only scanned the issues & its comments. I saw some talk in the comments about "patching" |
@uranusjr must Debian's patch be updated frequently for new Python versions, or is it fairly stable? If Python requires patching instead of supporting a config file, if a patch similar to Debian's will work for Homebrew & would be stable for many Python versions, 3 dozen or so line changes in a single file to get Python working in Homebrew seems preferable to providing it broken, and to not providing new versions at all. It might not be as ideal as Python supporting a config file, but it's better than the alternatives, if Python forces patching upon everyone. |
From what I hear, the patch is pretty stable. |
Does anyone know when this issue will be solved? |
how to fixed this ? |
I had to literally go back to python3.9 and now I see this error, apparently the project I'm working on could not be upgraded, how do we fix this? |
I am getting lots of errors on homebrew because of this. Is there a way to hide these warnings on mac meanwhile? |
The solution to this problem I understand is to upgrade 3.9->3.10+ on it? |
Related: #152017 |
@Bo98 what do you think about closing this issue? I feel that we will never « fix » this in Python@3.9 (and to be fair, that’s totally OK). Most of our formulae have migrated to newer Python versions and Python@3.9 downloads are slowly decreasing. The EOL date is 2025-10, so users will have to survive with current state until then. |
If you have been directed here from a pip warning, you don't need to take any action at this stage. Nothing is currently expected to break until Python 3.12, and a full solution will be implemented well before then.
Note that as of 3.10.2, this issue no longer affects Python 3.10 and later.
Quoting @uranusjr from Homebrew/discussions#1405:
Reposting here so it won't get buried in the Discussions page. We probably want to fix
python@3.9
so it can be easily re-used forpython@3.10
.The text was updated successfully, but these errors were encountered: