billions-keyboard-33102
07/05/2022, 9:00 AMpython_sources
https://www.pantsbuild.org/docs/reference-python_sources
In the docs under dependencies
it says:
This augments any dependencies inferred by Pants, such as by analyzing your importsIs there a way to disable the automatic import analysis and just use the manual list? I want to be explicit about the dependencies that’s all.
ambitious-actor-36781
07/05/2022, 9:02 AMbillions-keyboard-33102
07/05/2022, 9:02 AMhundreds-father-404
07/05/2022, 2:34 PMpython_sources
(plural) and only use python_source
targets. But that's a disaster to maintain. The precision gives you much finer-grained caching and better project introspection, like --changed-since
2) Dependency inference tends to be more accurate. W/ explicit deps, it's easy to forget to remove deps from BUILD files. It's also sometimes possible to leave off a real dep because a transitive dependency includes it
3) Manual BUILD file management is a pain, and engineers often get frustrated
What's your thinking around wanting to be explicit?happy-kitchen-89482
07/05/2022, 3:53 PMbillions-keyboard-33102
07/05/2022, 3:57 PMsubsystem1
, subsystem2
, subsystem3
. I have a map in my head that subsystem1
depends on subsystem2
, but not subsystem3
.
Another example, I would also consider it strange if some authorisation code imported a testing library.
Explicit dependencies seemed a nice way of enforcing these things.
EDIT: yes the ticket you linked describes this better!happy-kitchen-89482
07/05/2022, 3:57 PMhappy-kitchen-89482
07/05/2022, 3:58 PMbillions-keyboard-33102
07/05/2022, 3:58 PMbillions-keyboard-33102
11/21/2022, 12:33 PMbillions-keyboard-33102
12/08/2022, 3:33 PM2.16.dev0
I haven’t figured out how to allow visibility for the python_requirements (<http://requirements.in|requirements.in>
)
15:27:49.65 [WARN] Dependency rule violation for some/path.py:../../../../some on //:requirements#pyyaml
Using this in my BUILD file:
__dependencies_rules__(
("*", ".", "//:requirements#*", "?*"),
("*", "!*"), # Allow all by default, with a warning
)
I will wait for the documentation! 🤔