-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Typing] Paddle 的 CI 中引入 mypy 对于 API 中 docstring 的示例代码的类型检查 #63901
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
b8c2201
add type_hints for ci
megemini 5dab33d
add type_hints unittest
megemini c11b093
tmp test for type hints
megemini 436175f
change mypy version
megemini f6927c2
from __future__ import annotations
megemini c4ba2bf
tmp math.py docstring trigger ci
megemini 9fba61a
tmp trigger ci
megemini 36ba294
tmp debug mypy
megemini 68354cb
fix paddle_build.sh
megemini 7c2a715
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
megemini 9654c26
setup with pyi
megemini 732aff8
force reinstall
megemini 458802a
setup.py type hints
megemini 363ec84
restore math.py
megemini 41aa797
update print_signatures.py for trigger type annotation ci
megemini c8775e3
update print_signatures.py member_dict for trigger type annotation ci
megemini 0dae862
restore print_signatures.py
megemini 5c996a0
get_api_md5 with ArgSpec & update unittest
megemini ce613b2
change math.py type annotation
megemini fb6cef6
change math.py type annotation return
megemini edc4b23
change math.py type annotation scale & stanh
megemini 9857d86
update paddle_build.sh
megemini a7ed18c
[Update] type checker
megemini 51fda55
tmp math.py, test=type_checking
megemini 98dc1df
tmp math.py, test=type_checking
megemini eb1f468
tmp math.py, test=type_checking
megemini c75c574
tmp math.py, test=type_checking
megemini 495d0b7
tmp math.py & fix paddle_build.sh, test=type_checking
megemini 40b66c7
type checking on title
megemini 0181f23
reduce log
megemini e7be07d
change mypy cache dir abspath
megemini 618c3b9
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
megemini 72067ed
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
megemini 37ae0ab
[Change] paddle_build.sh func
megemini cf37661
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
megemini 5cc0c4b
[Update] filter api
megemini f9c381e
[Update] pyproject.toml & process pool for run
megemini 06dee11
[Update] restore math.py
megemini ae07a13
[Update] restore math.py
megemini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
关于这块的
mypy_cache
有个小问题,如果我根据 shell 脚本来跑,这个路径将会是在tools/.mypy_cache
, 而不是${PADDLE_ROOT}/.mypy_cache
。是故意这么设计的嘛emmmThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个有什么影响吗?
pyproject.toml
可以配置另外,刚好有个问题请教一下!
我这里
paddle_build.sh
中的run_type_checking
参考的check_run_sot_ci
:但是,
$(git log -1 --pretty=format:"%s" | grep -w "test=type_checking" || true)
没有效果,所以去掉了,只使用了 title 的判断条件 ~我本地
$(git log -1 --pretty=format:"%s" | grep -w "test=type_checking" || true)
没问题 ~这是咋回事儿?有啥办法?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
影响就是,这样就会生成和维护两份缓存了
可以把
git log -1
改成git log -10
或者更大,因为 ci 在运行之前会git pull upstream develop
所以导致没有命中我们想要的 commit (sot那个我自己来修吧, 感谢大佬发现的问题)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅 我草率了 ... ... 当时没想这么多 ... ...
那我在
type_checking.py
里面改为绝对路径吧 ~感谢!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gouzil 已修改 ~