Repository navigation
[CodeStyle] Clean up Python 3.9 compatibility code - #79290
Conversation
|
@SigureMo 麻烦有空帮忙 review 一下。已自查 diff,并验证 |
There was a problem hiding this comment.
backport 文件可以直接清理了,相关地方直接用对应类型就好了
There was a problem hiding this comment.
Done,已按建议删除 python/paddle/_typing/backport.py,并把相关引用改为直接使用 types.EllipsisType:
python/paddle/_typing/basic.pypython/paddle/_typing/__init__.py
更新后 commit: 64965e8
验证:ruff check . --target-version=py310 --select UP036、变更文件 ruff/pre-commit、python3.10 -B -m py_compile 均通过。
a248a3e to
64965e8
Compare
|
|
||
| # Backport | ||
| from .backport import EllipsisType as EllipsisType | ||
| from types import EllipsisType as EllipsisType |
There was a problem hiding this comment.
这里也不要了啊,你直接在用它的地方 from types import EllipsisType 不就好了?
There was a problem hiding this comment.
Done,已移除 python/paddle/_typing/__init__.py 里的 EllipsisType re-export;现在只在实际使用处 python/paddle/_typing/basic.py 直接 from types import EllipsisType。
更新后 commit: a5c473b
验证:ruff check . --target-version=py310 --select UP036、变更文件 ruff/pre-commit、python3.10 -B -m py_compile 均通过。
64965e8 to
a5c473b
Compare
|
/re-run all-failed |
|
代码审查结论:未发现需要阻塞合入的问题。 已重点检查本 PR 对 Python 3.9 兼容分支的清理,当前实现与 Python 3.10+ 目标一致:
建议后续等当前 |
|
CI 跟进:当前
我已在前面发过 |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (75.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #79290 +/- ##
==========================================
Coverage ? 75.00%
==========================================
Files ? 5
Lines ? 8
Branches ? 0
==========================================
Hits ? 6
Misses ? 2
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
@ShigureNyako 你去把 |
|
@SigureMo Done,已按要求把 变更: |
|
@ShigureNyako 好,这次只要 |
|
/re-run all-failed |
2 similar comments
|
/re-run all-failed |
|
/re-run all-failed |
|
@SigureMo 看到已加 目前 GitHub 状态里之前的 approval 已因增量 commit 变为 stale/dismissed, |
PR Category
Environment Adaptation
PR Types
Improvements
Description
Related to #59685.
Python 3.9 has retired, so this PR removes focused Python <3.10 compatibility code:
_typing.backportshim and usetypes.EllipsisTypedirectlyco_lnotabgeneration and Python <3.10 bytecode rotation/jump branches; keep Python 3.10 and Python 3.11+ pathsco_linetablein the Python 3.10CodeTypepath and simplify a Python <3.10 generator-send branchkw_only=Truedirectly in the SOT dataclass testremoveprefix/removesuffixCI-H / Fleet Unit test (single card)job timeout to 90min so it can exceed the 60min step runtime when neededThis PR intentionally does not change the ruff
target-version. It only handles the Python 3.9 compatibility cleanup / UP036 scope; other py310+ modernization diagnostics should be handled in separate focused PRs.Validation:
ruff check . --target-version=py310 --select UP036✅ruff check python/paddle/_typing/__init__.py python/paddle/_typing/basic.py python/paddle/jit/dy2static/convert_call_func.py python/paddle/jit/sot/opcode_translator/executor/pycode_generator.py python/paddle/jit/sot/opcode_translator/executor/variables/iter.py python/paddle/jit/sot/opcode_translator/instruction_utils/instruction_utils.py python/paddle/static/python_op.py test/sot/test_dataclass.py test/sot/test_info_collect.py✅pre-commit run --files python/paddle/_typing/__init__.py python/paddle/_typing/basic.py python/paddle/jit/dy2static/convert_call_func.py python/paddle/jit/sot/opcode_translator/executor/pycode_generator.py python/paddle/jit/sot/opcode_translator/executor/variables/iter.py python/paddle/jit/sot/opcode_translator/instruction_utils/instruction_utils.py python/paddle/static/python_op.py test/sot/test_dataclass.py test/sot/test_info_collect.py✅python3.10 -B -m py_compile python/paddle/_typing/__init__.py python/paddle/_typing/basic.py python/paddle/jit/dy2static/convert_call_func.py python/paddle/jit/sot/opcode_translator/executor/pycode_generator.py python/paddle/jit/sot/opcode_translator/executor/variables/iter.py python/paddle/jit/sot/opcode_translator/instruction_utils/instruction_utils.py python/paddle/static/python_op.py test/sot/test_dataclass.py test/sot/test_info_collect.py✅pre-commit run --files .github/workflows/H-Coverage.yml✅Focused SOT runtime tests were not runnable in this local source checkout because there is no built Paddle
libpaddle/installed wheel available (and the local Python 3.10 env also lacks test dependencynumpy).是否引起精度变化
否