You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(gazelle): Add "python_visibility" directive that appends additional visibility labels (bazel-contrib#1784)
Fixesbazel-contrib#1783.
Add a new gazelle directive, `python_visibility`, that allows
users to add labels to the `visibility` attribute of generated targets.
out by the way, hence this PR), I noticed that the docs were a little
This directive acts similar to[^1] the [`go_visibility`
directive](https://github.com/bazelbuild/bazel-gazelle#directives).
The primary use case is for python projects that separate unit test
files from the python packages/modules that they test, like so:
```
packaging_tutorial/
├── LICENSE
├── pyproject.toml
├── README.md
├── src/
│ └── mypackage/
│ ├── __init__.py
│ └── foo.py
└── tests/
├── __init__.py
└── test_foo.py
```
A future PR will add an example to the `./examples` directory (issue
bazel-contrib#1775).
[^1]: At least, similar based on docs. I haven't done any actual
comparison.
Copy file name to clipboardexpand all lines: gazelle/README.md
+46
Original file line number
Diff line number
Diff line change
@@ -198,6 +198,8 @@ Python-specific directives are as follows:
198
198
| Controls the `py_test` naming convention. Follows the same interpolation rules as `python_library_naming_convention`. ||
199
199
|`# gazelle:resolve py ...`| n/a |
200
200
| Instructs the plugin what target to add as a dependency to satisfy a given import statement. The syntax is `# gazelle:resolve py import-string label` where `import-string` is the symbol in the python `import` statement, and `label` is the Bazel label that Gazelle should write in `deps`. ||
0 commit comments