Skip to content

Migrate Python Project to Version 3.10 #8

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

🐍 Migrate to Python 3.10

Description

This PR migrates the entire codebase from Python 3.9 to Python 3.10, ensuring compatibility with the latest stable Python release and enabling access to new language features and performance improvements.

Changes Made

  • CI/CD Workflows: Updated GitHub Actions workflows (ci-release.yml, ci-staging.yml) to use Python 3.10
  • Service Dependencies: Updated all setup.py files across services to require Python 3.10 (python_requires="~=3.10")
  • Code Modernization: Removed deprecated loop=asyncio.get_event_loop() parameter from asyncpg connection setup, aligning with Python 3.10+ best practices

Motivation

Upgrading to Python 3.10 provides several benefits:

  • Performance Improvements: 4% overall interpreter speed improvement, 36-44% faster attribute access, and optimized built-in functions
  • Enhanced Type System: Support for union types with | operator and improved type hinting capabilities
  • Better Error Messages: Significantly improved SyntaxError reporting with better location information
  • New Language Features: Access to structural pattern matching and other modern Python features
  • Security: Continued security updates and support from the Python core team

Impact

This is a breaking change that affects:

  • 🔧 Development Environment: All developers must upgrade to Python 3.10
  • 🏗️ Build Systems: CI/CD pipelines now use Python 3.10
  • 📦 Deployment: Production environments must support Python 3.10
  • 🧪 Testing: All tests now run on Python 3.10

Links

Testing

  • All existing tests pass on Python 3.10
  • CI/CD pipelines execute successfully with Python 3.10
  • Services build and deploy correctly with updated requirements
📋 Files Modified
  • .github/workflows/ci-release.yml
  • .github/workflows/ci-staging.yml
  • Multiple setup.py files across services
  • services/web/server/src/simcore_service_webserver/login/plugin.py

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