Skip to content

Migrate Python Codebase to Version 3.10 #14

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gitar-bot-staging[bot]
Copy link

Upgrade Python from 3.9 to 3.10

📋 Description

This PR upgrades the Python version from 3.9 to 3.10 across the entire project infrastructure. The upgrade touches all core components including CI/CD workflows, service configurations, package setup files, and Docker images.

🎯 Motivation

  • Security & Performance: Python 3.10 provides security improvements and performance optimizations over 3.9
  • Modern Language Features: Access to new Python 3.10 features including structural pattern matching, better error messages, and improved type hints
  • Dependency Compatibility: Ensure compatibility with newer library versions that may require Python 3.10+
  • Long-term Support: Python 3.9 is approaching end-of-life, while 3.10 has longer support timeline

🔧 Changes Made

Infrastructure Updates

  • CI/CD Workflows: Updated all GitHub Actions workflows (ci-release.yml, ci-staging.yml, ci-testing-deploy.yml) to use Python 3.10
  • Docker Images: Updated base images from python:3.6-slim and python:3.9-slim to python:3.10-slim
  • Requirements: Updated requirements/PYTHON_VERSION from 3.9 to 3.10

Service Configuration Updates

  • Updated python_requires in setup.py files across all services and packages
  • Updated Python version classifiers in package metadata
  • Modified service library utils to use modern Python 3.10+ union syntax (str | Path instead of Union[str, Path])

Code Modernization

  • Deprecated Module Replacement: Replaced deprecated distutils.util.strtobool with custom implementation (distutils deprecated in Python 3.10, removed in 3.12)
  • Version Handling: Updated from distutils.version.StrictVersion to packaging.version.Version
  • Type Annotations: Modernized type hints to use Python 3.10+ union syntax

Documentation

  • Updated development documentation to reflect Python 3.10 requirement
  • Updated migration guide with new Python version requirements

🧪 Impact

  • Breaking Change: Developers must upgrade to Python 3.10 to work on this project
  • Enhanced Performance: Benefits from Python 3.10 performance improvements
  • Future-Proofing: Positions the codebase for continued compatibility with modern Python ecosystem

📚 Reference

✅ Test Plan

  • Verify all CI/CD pipelines pass with Python 3.10
  • Confirm all services build and run successfully
  • Validate package installation and dependency resolution
  • Run comprehensive test suite to ensure no regressions

Link to run
Requested by: [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant