Skip to content
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

Replace distutils.dir_util.create_tree() due to deprecated module disutils #1161

Open
abragtim opened this issue Mar 8, 2023 · 0 comments
Open
Labels
backend Backend related task/PR

Comments

@abragtim
Copy link
Collaborator

abragtim commented Mar 8, 2023

Specification

In Python 3.10 and 3.11, distutils will be formally marked as deprecated. All known issues will be closed at this time. import distutils will raise a deprecation warning. New issues that would be considered release blocking may still be fixed, but support for new tools or platforms will not be added.

❗Code that imports distutils will no longer work from Python 3.12.

Migration Advice

Note

This section suggests some alternative replacements for popular functionality that is being formally deprecated with this PEP. It is current at time of writing, but is not kept up to date.

For these modules or types, setuptools is the best substitute:

distutils.ccompiler
distutils.cmd.Command
distutils.command
distutils.config
distutils.core.Distribution
distutils.errors
For these modules or types, use the standards-defined Python Packaging Authority packages specified:

distutils.version — use the packaging package
For these modules or functions, use the standard library module shown:

distutils.fancy_getopt — use the argparse module
distutils.spawn.find_executable — use the shutil.which function
distutils.spawn.spawn — use the subprocess.run function
distutils.sysconfig — use the sysconfig module
distutils.util.get_platform — use the platform module

❗ For these functions, and any others not mentioned here, you will need to reimplement the functionality yourself. The legacy documentation can be found at https://docs.python.org/3.9/distutils/apiref.html

distutils.dir_util.create_tree
distutils.util.change_root
distutils.util.strtobool

Source: https://peps.python.org/pep-0632/

@abragtim abragtim added the backend Backend related task/PR label Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related task/PR
Projects
None yet
Development

No branches or pull requests

1 participant