Conversation
Signed-off-by: Hao Wu <skyw@nvidia.com>
Signed-off-by: Hao Wu <skyw@nvidia.com>
Signed-off-by: Hao Wu <skyw@nvidia.com>
Greptile SummaryThis PR completes the migration to Python 3.12 by removing all compatibility fallbacks and updating the codebase to use modern Python 3.10+ type annotation syntax. The changes include: Type System Updates:
Configuration Updates:
Documentation Updates:
No functional changes are introduced. The migration is clean, consistent across all files, and aligns with the project's stated goal of dropping Python 3.10 support. All changes are backward-compatible with Python 3.12+. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Old as Old Approach<br/>(Python 3.10 Support)
participant New as New Approach<br/>(Python 3.12 Only)
Note over Old: Try/Except Import Pattern
Old->>Old: try: from typing import override
Old->>Old: except ImportError: <br/>from typing_extensions import override
Note over Old: Module loads compatible version
Note over New: Direct Import Pattern
New->>New: from typing import override
Note over New: Guaranteed availability in 3.12+
Note over Old: Type Annotations (Old Style)
Old->>Old: from typing import List, Tuple, Optional
Old->>Old: param: List[str]
Old->>Old: param: Tuple[int, int]
Old->>Old: param: Optional[int]
Note over New: Type Annotations (Modern Style)
New->>New: from typing import override
New->>New: param: list[str]
New->>New: param: tuple[int, int]
New->>New: param: int | None
Note over Old: Dependencies
Old->>Old: torch, absl-py, typing-extensions
Note over New: Dependencies
New->>New: torch, absl-py
Note over New: (typing-extensions removed)
|
There was a problem hiding this comment.
Additional Comments (1)
-
README.md, line 12 (link)logic: Badge still shows Python 3.10+ but documentation now requires Python 3.12
15 files reviewed, 1 comment
Signed-off-by: Hao Wu <skyw@nvidia.com>
There was a problem hiding this comment.
Additional Comments (3)
-
pyproject.toml, line 23 (link)logic: Python version requirement should be updated to
>=3.12to match the PR's goal of migrating to Python 3.12. The README and docs now state Python 3.12 is required, but this hasn't been updated here. -
pyproject.toml, line 109 (link)logic: Ruff target version should be updated from
py310topy312to reflect the new minimum Python version. -
pyproject.toml, line 60 (link)logic:
typing-extensionsis no longer needed as a dependency since the code now requires Python 3.12, which has all the needed typing features built-in (likeoverride). This should be removed.
16 files reviewed, 3 comments
Signed-off-by: Hao Wu <skyw@nvidia.com>
|
/ok to test 6953c88 |
Update type annotation to remove old syntax and fallback paths.
Update document to reflect required python version.
No functional change.
Python 3.12 is default version for ubuntu 24.04 LTS. Next release tag close to 26.04 time frame will move to Python 3.12. Release v0.1.0 will be the last support for python 3.10.