Remove distutils usages for Python 3.10 #19064
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #19059.
Version parsing capabilities when building provider packages is now provided by
packaging.version.Version
instead. Non-Python software version parsing (sqlite) is re-implemented with regex.Usages of
strtobool
are replaced by theto_boolean
utility function in theairflow.utils.strings
module. This function is a bit more permissive thanstrtobool
, but should be good enough for how Airflow uses it for. This function is available since 2.0 and should be safe for usages in provider packages as well.The
copy_file
usage is replaced byshutils.copy2()
, which is good enough for Airflow's needs.The distutils reference in setup.py is kept since the file is only used at build-time against setuptools, which patches the distutils import with a vendored copy and is not deprecated.
See also Migration Advice in PEP 632.