-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
{CI} Add check __init__.py file in all extensions #5620
Conversation
Add check for init.py file |
7b2e870
to
0438623
Compare
e0c6c01
to
0438623
Compare
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.
Just a small comment, no other questions
I think an alternative solution is to use |
if os.path.isdir(src_d_full): | ||
for d in os.listdir(src_d_full): | ||
if d.startswith('azext_'): | ||
# root_dir: azure-cli-extensions\src\ext_name\azext_ext_name |
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.
Nice comment! It makes the code very easy to understand! 👍
This is a very good suggestion, it solves the problem fundamentally, but we need to modify the setup.py files of all extensions What worries me the most are some of the effects it might have:
|
""" Check if the vendored_sdks directory contains __init__.py in all extensions """ | ||
ref = [] | ||
# SRC_PATH: azure-cli-extensions\src | ||
for src_d in os.listdir(SRC_PATH): |
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.
Is it better to only check the extension that the PR is working on?
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.
os.walk
is very fast, it takes less than six seconds to check all the files, and the incremental check takes more time and effort.
Check if the vendored_sdks directory contains
__init__.py
in all extensions.Will exclude empty vendored_sdks dir, for example:
azure-cli-extensions\src\containerapp-preview\azext_containerapp_preview\vendored_sdks
is a empty dir that didn't contain any files.Test screenshot: