-
-
Notifications
You must be signed in to change notification settings - Fork 598
feat(gazelle) Remove entry point file requirements when generating rules #2998
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
base: main
Are you sure you want to change the base?
Conversation
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.
Dang, now I'll have to use some other method to enforce people to have __init__.py
files 🤣
But yeah I'm fine with this. I'm curious as to why the generation_mode project
directives were added though.
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.
Oh, and please add a note to CHANGELOG.md
, as some people (like me!) might rely on the fact that a BUILD.bazel
wasn't generated if an __init__.py
file wasn't present.
852d647
to
3ae39ee
Compare
@@ -0,0 +1 @@ | |||
# gazelle:python_generation_mode project |
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.
This is an existing test that is testing if subdirectory srcs
gets added to a py_library
target. Subdirectory sources will only be added to a py_library target in project mode.
Remove entry point file requirements when generating rules. Enable python rule generation as long as there are .py source files under the directory so all new packages will have python rules generated in the package.
The extension used to require entrypoints for generation but:
__test__.py
) is no longer required after generate py_test without __test__ #999 and feat!: Following generation mode when generating test targets #2044__main__.py
) is no longer required after feat: Creating one py_binary per main module #1584The entry point for libraries (
__init__.py
) shouldn't be required either, especially for Python 3.3 and after when namespace packages are supported.