https://pantsbuild.org/ logo
#general
Title
# general
f

fresh-architect-74417

04/27/2021, 10:12 PM
Does pants support visibility for libraries? For example:
Copy code
visibility = ["//visibility:public"]
f

fast-nail-55400

04/27/2021, 10:17 PM
Pants does not have a visibility feature like Bazel does. Targets (including libraries) are always visible across the repo.
f

fresh-architect-74417

04/27/2021, 10:18 PM
Ok, thanks ^_^
h

hundreds-father-404

04/27/2021, 10:37 PM
It's frequently requested tho and we'd love to add it!
j

jolly-midnight-72759

04/28/2021, 1:36 PM
What purpose does a visibility feature serve?
h

hundreds-father-404

04/28/2021, 3:50 PM
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

jolly-midnight-72759

04/28/2021, 4:04 PM
What?
donoteventhinkofimporting-
prefix isn't a sufficient visibility system?
😂 1
f

fresh-architect-74417

04/28/2021, 5:19 PM
The visibility option will allow the codebase to be cleaner and be used only from the exposed interfaces.
5 Views