Migrate Python Codebase from 3.9 to 3.10 #4
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 Runtime to 3.10
Description
This pull request upgrades the entire project from Python 3.9 to Python 3.10, implementing a comprehensive migration across all services, packages, and development tools. The upgrade modernizes the codebase to leverage Python 3.10's enhanced features while maintaining compatibility and security.
Key Changes
distutils
modules with modern alternatives (setuptools
,packaging
)pyproject.toml
files to all packages and servicesMotivation
Python 3.10 brings significant improvements that benefit this project:
match
/case
statements for cleaner data handlingX | Y
), Parameter Specification Variables, and Type GuardsFull Python 3.10 release notes
The migration also addresses deprecation warnings and prepares the codebase for future Python versions by replacing modules like
distutils
that will be removed in Python 3.12.Impact
Files Changed
Core Configuration (168 files modified):
requirements/PYTHON_VERSION
: Updated to 3.10pyproject.toml
files: Added modern packaging configurationCode Modernization:
distutils.util.strtobool
→setuptools.dist.strtobool
distutils.version.StrictVersion
→packaging.version.Version
Testing
The systematic approach across 10 commits ensures each migration rule was applied consistently:
Each commit maintains build integrity while progressively updating components.
Link to run