-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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][task 2] enable Ruff F401 rule in python/paddle/base
#57388
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
f984d74
to
892b11d
Compare
from .trainer_desc import ( | ||
MultiTrainer, | ||
DistMultiTrainer, | ||
PipelineTrainer, | ||
HeterXpuTrainer, | ||
PSGPUTrainer, | ||
HeterPipelineTrainer, | ||
MultiTrainer, # noqa: F401 | ||
DistMultiTrainer, # noqa: F401 | ||
PipelineTrainer, # noqa: F401 | ||
HeterXpuTrainer, # noqa: F401 | ||
PSGPUTrainer, # noqa: F401 | ||
HeterPipelineTrainer, # noqa: F401 | ||
) | ||
from .device_worker import ( | ||
Hogwild, | ||
DownpourSGD, | ||
DownpourLite, | ||
Section, | ||
DownpourSGDOPT, | ||
HeterSection, | ||
Hogwild, # noqa: F401 | ||
DownpourSGD, # noqa: F401 | ||
DownpourLite, # noqa: F401 | ||
Section, # noqa: F401 | ||
DownpourSGDOPT, # noqa: F401 | ||
HeterSection, # noqa: F401 | ||
) |
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.
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.
done
pyproject.toml
Outdated
"__init__.py" = ["F401"] | ||
"python/paddle/base/core.py" = ["F401"] |
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.
不建议整个文件 ignore 掉,那个文件的 logging 明显是没有用的
可以参考上一条,将 libpaddle 的 import 改写为
from .libpaddle import ( # noqa: F401
xxx,
yyy,
zzz,
)
这样就只需要加一个 noqa 了
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.
done
python/paddle/base/framework.py
Outdated
@@ -66,6 +63,7 @@ | |||
'device_guard', | |||
'set_flags', | |||
'get_flags', | |||
'data_feed_pb2', |
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.
这个直接 noqa 就行,加到 __all__
会认为是公开 API 的
pyproject.toml
Outdated
@@ -89,7 +89,7 @@ ignore = [ | |||
] | |||
|
|||
[tool.ruff.per-file-ignores] | |||
# Ignore unused imports in __init__.py | |||
# Ignore unused imports in some files |
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.
这里可以恢复一下
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.
LGTMeow 🐾
python/paddle/base
PR types
Others
PR changes
Others
Description
enable Ruff F401 rule in python/paddle/base
paddle.base
check #57367