forked from ITISFoundation/osparc-simcore
-
Notifications
You must be signed in to change notification settings - Fork 2
Upgrade Python from 3.9 to 3.10 with deprecated API modernization #28
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
gitar-bot-staging
wants to merge
5
commits into
master
Choose a base branch
from
gitar/0197efd0-c38d-7ea3-961f-4156d508018d-0197efd3-be28-7363-bdf3-ca0d81a46d9e
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Upgrade Python from 3.9 to 3.10 with deprecated API modernization #28
gitar-bot-staging
wants to merge
5
commits into
master
from
gitar/0197efd0-c38d-7ea3-961f-4156d508018d-0197efd3-be28-7363-bdf3-ca0d81a46d9e
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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`). Update Python dependencies for 3.10 compatibility: Update requirements.txt files to include version constraints compatible with Python 3.10 for all dependencies.
… 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.
…om parser import` statements with equivalent `ast` module usage, converting parser module functions like `parser.expr()` to `ast.parse(..., mode='eval')`. Remove loop parameter from asyncio API functions: Remove `loop` parameter from asyncio high-level API functions including `create_task()`, `gather()`, `shield()`, `wait_for()`, `wait()`, `as_completed()`, and `run_coroutine_threadsafe()`. Fix numeric literals followed by keywords spacing: Fix numeric literals immediately followed by keywords by adding whitespace between the number and keyword (e.g., `0in` becomes `0 in`). Update traceback.format_exception parameter name etype to exc: Replace `traceback.format_exception(etype, value, tb)` parameter name `etype` with `exc` in traceback module function calls. Migrate formatter imports to string formatting: Replace `import formatter` and `from formatter import` statements by migrating to string formatting methods or removing formatter module usage entirely. Update threading.Thread deprecated name methods: Replace deprecated `threading.Thread.setName()` and `threading.Thread.getName()` with `threading.Thread.name` property access. Migrate ssl.match_hostname() to ssl context verification: Replace deprecated `ssl.match_hostname()` function calls with equivalent hostname verification using ssl context or urllib3. Replace importlib.abc.Loader.load_module with exec_module: Replace `importlib.abc.Loader.load_module()` calls with `importlib.abc.Loader.exec_module()` method implementations. Update importlib module loading patterns: Replace deprecated `importlib.util.module_for_loader` decorator with updated importlib patterns for module loading. Replace `imp` module with `importlib` equivalents: Replace deprecated `imp` module imports with `importlib` equivalents for dynamic module importing and loading. Replace asyncio.coroutine with async def syntax: Replace `asyncio.coroutine` decorator with native `async def` function definitions for coroutine creation. Replace utf_8_sig with Standard BOM Handling: Replace `encodings.utf_8_sig` references with proper BOM handling using standard encoding methods. Co-authored-by: naveen@gitar.ai <naveen@gitar.ai>
✅ Gitar will automatically:
⚙️ Options:
🐛 (Staging) Report a BugIf 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
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.
This PR upgrades the entire codebase from Python 3.9 to Python 3.10, including comprehensive modernization of deprecated Python APIs and modules.
Changes
parser
module →ast
moduledistutils
→setuptools
imp
module →importlib
asyncio.coroutine
decorator →async def
syntaxssl.match_hostname()
→ ssl context verificationthreading.Thread.setName()/.getName()
→.name
propertyimportlib.abc.Loader.load_module()
→exec_module()
formatter
module → string formatting methodsImpact
Python 3.10 Benefits
Python 3.10 introduces several improvements including structural pattern matching, better error messages, performance optimizations, and new typing features. See the official Python 3.10 release notes for complete details.
This upgrade ensures the codebase stays current with Python's evolution and removes technical debt from deprecated APIs.
Link to run
Requested by: naveen@gitar.ai