Upgrade Python from 3.9 to 3.10 and migrate deprecated APIs #24
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.
Upgrade Python version from 3.9 to 3.10 across the entire project
This PR comprehensively upgrades the project to Python 3.10, addressing all breaking changes and deprecations introduced in the new version.
Key Changes
distutils
imports withsetuptools
equivalents and modern alternativesloop
parameters from high-level asyncio functionsetype
parameter toexc
in traceback functionspython:3.9
topython:3.10
in all Dockerfilespython_requires
in setup.py files to support Python 3.10Migration Details
🔗 distutils Migration
from distutils.core import
→from setuptools import
from distutils.extension import Extension
→from setuptools import Extension
distutils.util
functions with equivalent implementationsdistutils.spawn.spawn()
→subprocess.run()
distutils.version
classes →packaging.version
equivalentsdistutils.sysconfig
→sysconfig
moduleformatter
module usage🔄 asyncio API Updates
loop
parameter fromcreate_task()
,gather()
,shield()
,wait_for()
,wait()
,as_completed()
, andrun_coroutine_threadsafe()
📝 traceback API Updates
traceback.format_exception(etype, value, tb)
→traceback.format_exception(exc, value, tb)
Why This Upgrade?
Python 3.10 brings significant improvements and deprecates several modules that will be removed in Python 3.12. This upgrade ensures:
Files Changed
Related: Python 3.10 Release Notes | PEP 632 - distutils Deprecation
Link to run
Requested by: [email protected]