Replace distutils.dir_util.create_tree()
due to deprecated module disutils
#1161
Labels
backend
Backend related task/PR
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/
The text was updated successfully, but these errors were encountered: