[CodeStyle] Clean up Python 3.10 type-hint diagnostics#79291
Conversation
SigureMo
left a comment
There was a problem hiding this comment.
另外我觉得 UP035、UP007 也可以在这个 PR 里一起做了呀,都是类型提示相关的改动
|
整体看这组改动只是把 需要注意的兼容性前提是:这些文件现在会直接使用 测试风险方面, |
e88e247 to
ef578ce
Compare
|
已按建议补充到同一个 PR,见 ef578ce。 这次一起清理了全仓 py310 target 下的
|
ef578ce to
47869a3
Compare
47869a3 to
76466a0
Compare
|
/re-run all-failed |
1 similar comment
|
/re-run all-failed |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #79291 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 85
Lines ? 119
Branches ? 0
===========================================
Hits ? 119
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/re-run all-failed |
4 similar comments
|
/re-run all-failed |
|
/re-run all-failed |
|
/re-run all-failed |
|
/re-run all-failed |
|
这个 PR 先别 rerun 了,相关问题等 #79289 解决了再说吧 |
|
@ShigureNyako #79289 和 #79290 合入了,merge 下最新代码,并解决下冲突,另外 ruff 的 target-version 可以改成 3.10 了,ruff 全量扫一下,修一下吧 |
|
对了,不许 force-push! |
Co-authored-by: Codex <noreply@openai.com> # Conflicts: # python/paddle/vision/transforms/transforms.py
Co-authored-by: Codex <noreply@openai.com>
|
已按要求处理,且没有 force-push:
本地验证通过:
后续仍不会 force-push。 |
Remove obsolete RUF100 suppressions and the inactive FA100 token from the evaluated Optional torch.device coverage, keeping the active UP045 suppressions. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
|
@ShigureNyako static check 挂了,得跟进了 不过喵的 static-check 里怎么有个下载的日志,导致完全看不到报错了,关键信息我提取了下: 你顺带看看那个一大堆下载日志是谁输出的,如果可以的话(如果复杂的话就不要改了,毕竟涉及示例代码),不要让它在日志里输出这么多,真离谱 |
|
已跟进 static-check,normal push 追加了修复提交 处理内容:
本地已过:
本地 |
SigureMo
left a comment
There was a problem hiding this comment.
别改人家代码语义
- 如果是我们类型上哪里有问题,就补全
- 如果实在不行,就 ignore
感觉就 datasets 下的文件改的合理,其他的都重新 review 下吧
|
已按 review 调整,normal push 追加了 处理内容:
本地验证通过:
|
|
已继续按 review 调整,normal push 追加
本地验证通过:
|
|
@ShigureNyako static-check 又挂了,自己想办法拉日志修复吧 |
|
已跟进最新 本次 fresh log 里剩余 3 个 sample-code type checking 问题,都是 inline
只调整 ignore code,不改变示例运行语义。 本地验证通过:
|
|
已继续跟进最新 原因是 # type: ignore[misc,arg-type]只调整 inline ignore code,不改变示例运行语义。 本地验证通过:
|
Co-authored-by: Nyakku Shigure <sigure.qaq@gmail.com>
|
/re-run all-failed |
PR Category
Environment Adaptation
PR Types
Deprecations
Description
Related to #79289 and #79290.
This PR cleans Python 3.10 type-hint modernization diagnostics and enables Ruff's Python 3.10 target:
developafter [Typing] Upgrade mypy to 2.1.0 and target Python 3.10 #79289/[CodeStyle] Clean up Python 3.9 compatibility code #79290 and resolve the resulting conflict without force-pushtarget-version = "py310"UP035/UP007/UP045diagnostics by modernizing type-hint syntax and removing now-obsolete typing importstest/compat/test_torch_proxy.pycoverage for evaluatedtorch.device | Nonebehavior# type: ignoresuppressions that became unused after the type-hint cleanupValidation:
ruff check . --fix✅ruff check .✅git diff --check upstream/develop...HEAD✅python3.10py_compile for 132 modified Python files ✅pre-commit run --files $(git diff --name-only --diff-filter=ACMRT upstream/develop...HEAD)✅是否引起精度变化
否