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
distutils no longer part of Python 3.12 - error due to missing dependency #1031
Comments
I proposed a fix, someone can create a PR from this example: |
Indeed I have created #1033 |
It's a bit rough that this forces setuptools on everyone that has babel in their dependency chain - is there a plan to remove it again eventually? Could this be made an optional feature? |
@sigma67 It wouldn't be impossible, but right now CLI use will require it (since it was, way back when, easier to wrap the setuptools-based commands in optparse magic than the other way around). I wish I knew how many people actually depended on the setuptools command extensions. |
Thanks for addressing this so quickly despite initial concerns 💖 |
Overview Description
babel has some code that tries to use "setuptools" or fall back to "distutils".
babel/babel/messages/frontend.py
Line 54 in 76677ea
"distutils" used to be shipped with Python. Additionally, "setuptools" used to be ensured by virtualenvs. But both of these are gone with Python 3.12 so now babel ends up using a dependency that it never declared.
babel/setup.py
Line 64 in 76677ea
From my assessment, it seems it would be correct to add a dependency on setuptools directly.
Either only for python_version>=3.12 or perhaps always add this dependency and drop the distutils fallback code.
Workaround:
pip install setuptools
Steps to Reproduce
Install babel not in virtualenv and run it under Python 3.12
Actual Results
https://github.com/mkdocs/mkdocs/actions/runs/6382007433/job/17355070257
Expected Results
No error
Background
https://docs.python.org/3.12/whatsnew/3.12.html#distutils
The text was updated successfully, but these errors were encountered: