-
Notifications
You must be signed in to change notification settings - Fork 23
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 is to be removed from the standard library in Python 3.12 #63
Comments
The easiest short-term workaround is to runtime-require setuptools on Python 3.12+. I.e. add to setup.py: setup(
...,
install_requires(['setuptools>=60;python_version>="3.12"']),
...,
) EDIT: Added |
It is not a hard runtime dependency IMO. The |
It seems like this project imports from distutils: argparse-manpage/build_manpages/build_manpages.py Lines 8 to 9 in 28151c2
If build_manpages isn't a "core" part of this, maybe it needs to have extras dependendencies? |
In that case, you would do something like this in setup.py: https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#optional-dependencies setup(
...,
extras_require={
"build-manpages": ['setuptools;python_version>="3.12"'],
},
) And in build_manpages.py: try:
from distutils.core import Command
from distutils.errors import DistutilsOptionError
except ImportError:
raise ImportError(
'To use the build_manpages tool on Python 3.12+, '
'you need to install argparse-manpage[build-manpages].'
) And in the README, you recommend adding |
I think you’ll find that even the CLI tool requires In argparse-manpage/build_manpages/cli.py Line 10 in 34017d1
…which imports argparse-manpage/build_manpages/build_manpage.py Lines 12 to 13 in 34017d1
In the unreleased
…and that still unconditionally imports argparse-manpage/build_manpages/build_manpages.py Lines 8 to 9 in 28151c2
…so one still sees:
|
Thank you for the detailed analysis. I plan a release soon, so let's keep v3 aside now.
Hm, importing cli.py really implies importing init.py, and thus distutils? |
Always. |
You can wrap the entire thing that uses the classes in the try-except block from my comment. |
Let's separate the Manpage generating logic (the new 'argparse_manpage' module) from the part which helps the user to override the setuptools commands (continues to be named 'build_manpages'). Fixes: #63
Let's separate the Manpage generating logic (the new 'argparse_manpage' module) from the part which helps the user to override the setuptools commands (continues to be named 'build_manpages'). Fixes: #63
To use the build_manpages tool on Python 3.12+, argparse-manpage needs setuptools; depend on argparse-manpage[setuptools] to ensure this keeps working. See: praiskup/argparse-manpage#63
In accordance with PEP 0632,
distutils
will be removed from the Python 3.12 standard library.In order to retain compatibility with Python 3.12, it may be sufficient to add a runtime dependency on
setuptools
. See the relevant Fedora Linuxpython-devel
mailing list thread; regarding potential incompatibilities, see pypa/setuptools#3532.The text was updated successfully, but these errors were encountered: