Skip to content
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

[CodeStyle][py36] remove sys.version branch for py36 #48540

Merged
merged 2 commits into from
Dec 1, 2022

Conversation

gsq7474741
Copy link
Contributor

PR types

Others

PR changes

Others

Describe

移除通过 sys.version 判断python版本(小于3.7)的逻辑,
related works

@paddle-bot
Copy link

paddle-bot bot commented Nov 29, 2022

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Nov 29, 2022
@gsq7474741
Copy link
Contributor Author

@SigureMo

@luotao1
Copy link
Contributor

luotao1 commented Nov 30, 2022

还有一些通过sys.version_info判断的逻辑也可以删了

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

小小的代码风格建议~

其余都没有问题~

tools/dockerfile/build_scripts/ssl-check.py Show resolved Hide resolved
@SigureMo
Copy link
Member

还有一些通过 sys.version_info 判断的逻辑也可以删了

我瞅了下,貌似只有像这种 macOS + Python3 的判断了

# When value of dict is lager than 4GB ,there is a Bug on 'MAC python3'
if sys.platform == 'darwin' and sys.version_info.major == 3:

这里可以考虑移除下 and sys.version_info.major == 3,不过个人认为影响不大,不修改的话是和注释完全匹配的这样可读性也许会更好些

@SigureMo SigureMo changed the title [CodeStyle][py36] remove sys.version brunch for py36 [CodeStyle][py36] remove sys.version branch for py36 Nov 30, 2022
@luotao1
Copy link
Contributor

luotao1 commented Nov 30, 2022

不修改的话是和注释完全匹配的这样可读性也许会更好些

这块不移除是可以的,但ast3.py里还有一些需要移除,比如

if sys.version_info.minor < 5:

@SigureMo
Copy link
Member

这块不移除是可以的,但ast3.py里还有一些需要移除,比如

这是 gast(https://github.com/serge-sans-paille/gast )的文件,是一个引入到 Paddle 内部的第三方库,考虑到未来可能和 gast 原 repo 同步版本(为了兼容更高版本的 Python 语法 / AST),因此这个第三方库没有进行各种代码风格的监控,这在上一次 review 中也提了下 #48426 (comment)

@luotao1
Copy link
Contributor

luotao1 commented Nov 30, 2022

Got it.

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~

@SigureMo
Copy link
Member

SigureMo commented Dec 1, 2022

2022-11-30 20:52:49 + echo 'The following tests FAILED: '
2022-11-30 20:52:49 The following tests FAILED: 
2022-11-30 20:52:49 + echo '
2022-11-30 20:52:49             	220 - test_audio_backend (Failed)
2022-11-30 20:52:49             	220 - test_audio_backend (Failed)
2022-11-30 20:52:49             	220 - test_audio_backend (Failed)'
2022-11-30 20:52:49 + sort -u
2022-11-30 20:52:49 + grep -E test_audio_backend
2022-11-30 20:52:49             	220 - test_audio_backend (Failed)
2022-11-30 20:52:49 + exit 8

@gsq7474741 PR-CI-Mac-Python3 可以尝试 re-run 一下,这个问题这两天我的其他 PR 也遇到了,re-run 之后可能会通过

@luotao1
Copy link
Contributor

luotao1 commented Dec 1, 2022

test_audio_backend 单测已豁免

@luotao1 luotao1 merged commit da0022e into PaddlePaddle:develop Dec 1, 2022
@gsq7474741 gsq7474741 deleted the remove_sys_version branch December 1, 2022 09:54
lxsbupt pushed a commit to lxsbupt/Paddle that referenced this pull request Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants