Does pants support visibility for libraries? For ...
# general
f
Does pants support visibility for libraries? For example:
Copy code
visibility = ["//visibility:public"]
f
Pants does not have a visibility feature like Bazel does. Targets (including libraries) are always visible across the repo.
f
Ok, thanks ^_^
h
It's frequently requested tho and we'd love to add it!
j
What purpose does a visibility feature serve?
h
Restricting parts of your codebase to other parts, so that, for example, team B doesn't start complaining when they depend on team A's hacky util code that they never meant to be used by others and then team A makes a change that breaks team B It's similar motivation to visibility systems in other languages that aren't Python, like Java, Rust, C++. Python doesn't have visibility and relies on convention with
_
prefixes
😂 1
j
What?
donoteventhinkofimporting-
prefix isn't a sufficient visibility system?
😂 1
f
The visibility option will allow the codebase to be cleaner and be used only from the exposed interfaces.