Skip to content

Upgrade Python runtime from 3.9 to 3.10 with compatibility updates #25

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

gitar-bot-staging[bot]
Copy link

Description

This PR upgrades the Python runtime environment from 3.9 to 3.10 across the entire codebase, including necessary compatibility updates and deprecation cleanups.

Changes Made

  • CI/CD Infrastructure: Updated GitHub Actions workflows to use Python 3.10 and setup-python v4
  • Docker Environment: Updated base images from python:3.9 to python:3.10
  • Package Dependencies: Updated python_requires in setup.py files to support Python 3.10
  • Distutils Migration: Migrated from deprecated distutils to setuptools across multiple packages and services
  • Asyncio API Cleanup: Removed deprecated loop parameter from asyncio high-level API functions

Motivation

Python 3.10 introduces significant improvements including:

  • Structural pattern matching with match/case statements
  • Enhanced type hints with union operator (|) and type guards
  • Better error messages and debugging capabilities
  • Security enhancements and performance optimizations
  • Full Python 3.10 release notes

The distutils module is deprecated in Python 3.10 and will be removed in future versions, making the migration to setuptools essential for forward compatibility.

Impact

  • Compatibility: Maintains backward compatibility while enabling Python 3.10 features
  • Security: Improves security posture through Python 3.10's security enhancements
  • Performance: Benefits from Python 3.10's performance optimizations
  • Future-proofing: Prepares codebase for eventual distutils removal

Files Modified

28 files across packages, services, and infrastructure
  • CI/CD workflows (3 files)
  • Package setup.py files (18 files)
  • Service configuration and source files (7 files)

Link to run
Requested by: [email protected]

gitar-bot added 5 commits July 5, 2025 20:19
…ions in CI/CD configuration files (GitHub Actions, GitLab CI, etc.) from `3.9` to `3.10`.

Update GitHub Actions setup-python to v4: Update GitHub Actions `setup-python` action versions to v4 or later for proper Python 3.10 support.
…rom `python:3.9` to `python:3.10` in Dockerfiles and docker-compose files.
…in setup.py and pyproject.toml files to include Python 3.10 support (e.g., `>=3.8,<3.11` or `>=3.9`).
… import` and `from distutils import` statements with `from setuptools import` equivalents, migrating setup.py files from distutils to setuptools.

Migrate distutils Extension to setuptools: Replace `from distutils.extension import Extension` with `from setuptools import Extension` and update related extension building code.
Migrate distutils.command imports to setuptools: Replace `from distutils.command import` imports with setuptools equivalents or custom command implementations.
Update distutils.util function calls with alternatives: Update `distutils.util` function calls like `strtobool()` and `convert_path()` with equivalent implementations or alternative libraries.
Replace distutils.spawn with subprocess.run calls: Replace `distutils.spawn.spawn()` calls with `subprocess.run()` or equivalent process execution methods.
Migrate distutils.version to packaging.version classes: Replace `distutils.version` classes like `LooseVersion` and `StrictVersion` with `packaging.version` equivalents.
Migrate distutils.sysconfig to sysconfig module: Replace `distutils.sysconfig` imports and function calls with `sysconfig` module equivalents for system configuration queries.
…eter from asyncio high-level API functions including `create_task()`, `gather()`, `shield()`, `wait_for()`, `wait()`, `as_completed()`, and `run_coroutine_threadsafe()`.

Co-Authored-By: [email protected]
@gitar-bot-staging
Copy link
Author

✅ Gitar will automatically:

  • Address comments that start with 'Gitar'.
  • Look at CI failures and help fix them

⚙️ Options:

  • Disable automatic comment and CI monitoring

🐛 (Staging) Report a Bug

If you notice any bugs or poor interactions with the bot, click these links to report them:

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