-
-
Notifications
You must be signed in to change notification settings - Fork 632
Description
🚀 feature request
Relevant Rules
gazelle python BUILD file generator.
Description
I have a repo organized as follows:
- a
- b
- d
- e.py
- d
- c.py
- f.py
- m
- n.py
- o.py
- p.py
- b
I'd like to generate BUILD files that have an individual py_library for each python file. As I understand it, the existing package generation mode will make py_librarys for //a:a, //a:b, //a/b:d, and //a:m in the example above.
Instead, I'd like a file generation mode that makes py_librarys for //a:c, //a/b/d:e, //a:f, //a/m:n, //a/m:o, //a/m:p. This would let me preserve the existing repo structure and file imports in different files (from a.b.d import e).
Describe the solution you'd like
See above.
With enough pointers I could potentially take on the modifications, but wondering if there's reasons this isn't implemented.
Describe alternatives you've considered
I could reorganize my imports to match what the existing package rules expect. However, that would be a huge undertaking and break our existing Pants BUILD rules.