curved-television-6568
07/07/2022, 7:48 PMpants.backend.visibility.validate.VisibilityViolationError: The following 1 target is not visible to 3rdparty/python#pytest:
* 3rdparty/python/requirements.txt has visibility: ::
await MultiGet(Get(Addresses, Specs, specs) for specs in targets_visibility_specs.values()),
I get all addresses for the specs, but it excludes target generators, it would seem..3rdparty/python#fastapi
-> visibility src/python/backend/explorer::
Then if I in, say, src/python/backend/docker/rules.py
have:
import fastapi # ValidationError!
import pants.backend.explorer.graphql.rules # OK? although we now transitively depend on fastapi!
src/python/pants/backend/explorer/BUILD
__defaults__(all=dict(visibility=[f"{build_file_dir()}::"]))
And now, we’ve enforced that only code in the explorer backend may depend on fastapi, and nothing outside of the explorer backend may depend on any part of the explorer backend, effectively locking out access also transitively to the fastapi dependency to the wider pants repo.