Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add python_visibility gazelle directive #1783

Copy link
Copy link
@dougthor42

Description

@dougthor42
Issue body actions

🚀 feature request

Relevant Rules

  • gazelle

Description

Summary: Add a py(thon)_visibility gazelle directive that acts like the go_visibility directive. This directive would append additional labels to the visibility attribute on generated targets.

Example:

# gazelle:python_visibility //tests:__pkg__
# gazelle:python_visibility //bar:baz

py_library(
    name = "directive_python_visibility",
    srcs = ["foo.py"],
    visibility = [
        "//:__subpackages__",
        "//bar:baz",
        "//tests:__pkg__",
    ],
)

Describe the solution you'd like

I have a branch that does this already. I'm mostly making this Issue for discussion before I submit the PR.

Branch: https://github.com/dougthor42/rules_python/tree/gazelle-python-visibility

Describe alternatives you've considered

Manually adding other vis labels is the only other option I've found. That's not really an option when adding gazelle to an existing, large project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.