rules_python
rules_python copied to clipboard
fix(gazelle): delete invalid py_library and use correct NonEmptyAttrs for py_*
visibilityshould not be a NonEmptyAttr- when
python_generation_modeis set topackage, if__init__.pyis deleted, thepy_librarygenerated for this package before should be deleted automatically.
changelog has been added.
It requires two test part.
- Existing tests to ensure that everything is normal.
- Make a empty folder only has BUILD with a
py_libraryrule generated by gazelle before. After gazelle, BUILD will be empty.
But I have no idea who to add test about 2.
For 2. you should be able to construct a test similar to how we have them in https://github.com/bazelbuild/rules_python/tree/main/gazelle/python/testdata
You can have the bazel file before running gazelle and after running gazelle, where the test framework will ensure that it works as you expect it to.
test added @aignas
ping @aignas
could we continue?