Repository navigation
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request broadens the project's compatibility by downgrading the minimum required Python version from 3.12 to 3.11. This involved a comprehensive refactoring of modern Python 3.12 type parameter syntax to use the more widely supported Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly downgrades the Python requirement from 3.12 to 3.11. The changes to convert PEP 695 type parameter syntax to the backward-compatible TypeVar/Generic pattern are well-implemented across the Python source files. The updates to pyproject.toml and CI workflows are also consistent with the downgrade. However, I've found a critical issue in the Dockerfile related to a hardcoded dependency installation that will likely cause the build to fail.
chore: add Python 3.11 support (requires-python >=3.11,<3.13) Convert PEP 695 type parameter syntax (Python 3.12+) to TypeVar/Generic (Python 3.11 compatible) across 5 source files. Widen requires-python to >=3.11,<3.13 to support both Python 3.11 and 3.12. Docker image and CI workflows remain on Python 3.12. Key changes: - Replace class[T]/def[T] PEP 695 syntax with TypeVar + Generic[T] - pyproject.toml: requires-python >=3.11,<3.13, add 3.11 classifier - ruff target-version py311 (lowest supported version) - Regenerate uv.lock for dual 3.11+3.12 resolution
Convert PEP 695 type parameter syntax (Python 3.12+) to TypeVar/Generic (Python 3.11 compatible) across 5 source files. Widen requires-python to >=3.11,<3.13 to support both Python 3.11 and 3.12. Docker image and CI workflows remain on Python 3.12. Key changes: - Replace class[T]/def[T] PEP 695 syntax with TypeVar + Generic[T] - pyproject.toml: requires-python >=3.11,<3.13, add 3.11 classifier - ruff target-version py311 (lowest supported version) - Regenerate uv.lock for dual 3.11+3.12 resolution
…project#991) Convert PEP 695 type parameter syntax (Python 3.12+) to TypeVar/Generic (Python 3.11 compatible) across 5 source files. Widen requires-python to >=3.11,<3.13 to support both Python 3.11 and 3.12. Docker image and CI workflows remain on Python 3.12. Key changes: - Replace class[T]/def[T] PEP 695 syntax with TypeVar + Generic[T] - pyproject.toml: requires-python >=3.11,<3.13, add 3.11 classifier - ruff target-version py311 (lowest supported version) - Regenerate uv.lock for dual 3.11+3.12 resolution
…project#991) Convert PEP 695 type parameter syntax (Python 3.12+) to TypeVar/Generic (Python 3.11 compatible) across 5 source files. Widen requires-python to >=3.11,<3.13 to support both Python 3.11 and 3.12. Docker image and CI workflows remain on Python 3.12. Key changes: - Replace class[T]/def[T] PEP 695 syntax with TypeVar + Generic[T] - pyproject.toml: requires-python >=3.11,<3.13, add 3.11 classifier - ruff target-version py311 (lowest supported version) - Regenerate uv.lock for dual 3.11+3.12 resolution
Description
Add Python 3.11 support by converting PEP 695 type parameter syntax (Python 3.12+) to the backward-compatible TypeVar/Generic pattern, and widening
requires-pythonto>=3.11,<3.13. Docker image and CI workflows remain on Python 3.12 — no rebuild needed.Reference implementation (code changes only): https://github.com/HwVanICI/AReaL/tree/downgrade-python-3.11
Related Issue
N/A
Type of Change
Changes
Python Source (PEP 695 → TypeVar/Generic)
areal/api/cli_args.py:def load_expr_config[ConfigT](...)→ConfigT = TypeVar("ConfigT")+ regular function signatureareal/infra/async_task_runner.py: 4 classes (TimedResult[T],_TaskInput[T],_Task[T],AsyncTaskRunner[T]) →Generic[T]withT = TypeVar("T")areal/infra/workflow_executor.py:BatchTaskDispatcher[TInput: WithTaskID, TResult]→Generic[TInput, TResult]with bound TypeVarsareal/models/mcore/common.py:def check_and_construct_configs[T: TransformerConfig](...)→T = TypeVar("T", bound=TransformerConfig)areal/utils/functional/vocab_parallel.py:def _chunked_apply[T: (...)](...)→T = TypeVar("T", torch.Tensor, tuple[...])Build & Configuration
pyproject.toml:requires-pythonwidened to>=3.11,<3.13; addedPython :: 3.11classifier; rufftarget-version→py311uv.lock: Regenerated for dual Python 3.11 + 3.12 resolution (addsasync-timeoutfor 3.11)Unchanged
Checklist
jb build docs/gemini review)Breaking Change Details (if applicable):
N/A
Additional Context