happy-kitchen-89482
07/02/2021, 9:16 PMpython_library
X depends on a python_distribution
Y then X effectively depends on all of the libraries Y depends on, transitively, as sources, and nothing special happens with Y itself. You could replace it with its direct deps with no change in behavior. But what the author of that dep probably intended is for X to depend on the wheel built from Y. An example of where this is useful is when you have a python_distribution
that builds native code via a custom setup.py
(this is now possible! See https://github.com/pantsbuild/pants/pull/12250). AFAICT today we handle this as a special case, only for running tests, via runtime_package_dependencies
. But it seems like we should do this generically?runtime_package_dependencies
vs just dependencies
runtime_package_dependencies
runtime_package_dependencies
and depending on it means depending on the artifact it creates? So at the very least what we do today for tests we should do uniformly?hundreds-father-404
07/02/2021, 9:20 PMBut in that case it seems like any target could have runtime_package_dependencies and depending on it means depending on the artifact it creates?What does it mean for a Pex to depend on a built PEX? Or some Python library code to depend on a built PEX?
average-vr-56795
07/02/2021, 9:31 PMenough-analyst-54434
07/02/2021, 9:34 PMdependencies=['a/target:address@whl']
Where `@`'s would be registered by rules and dependencies on `@`'s would get the corresponding registered rule run against them with the product being a file(set).witty-crayon-22786
07/02/2021, 9:37 PMdeps
or data
list. @average-vr-56795 would know better about whether the syntax still exists.@
syntax got co-opted into “variants”, which eventually became multiple Params, and the syntax was dropped (although we still reserve the character)BUILD
syntax)average-vr-56795
07/02/2021, 9:44 PMdeps
vs runtime_deps
); another is that you can name explicit files in some contexts (e.g. in a pkg_zip rule you can reference :foo
or foo_deploy.jar
and the latter will be a fat jar of transitive deps) but that only really applies when you're depending on a literal file copy, rather than wanting metadata like a classpath.
A key difference between Bazel and Pants here is that in Bazel each rule pushes providers up the graph (so the dependency decides in what ways it can be consumed, and the depending rule picks one of them), whereas Pants pulls rule classes up the graph (the depender can decide to do interesting transforms itself)enough-analyst-54434
07/02/2021, 9:45 PM@
is a distraction - I intend none of the cross meaning with the old @
- just a disambiguator since I lazily assumed .
may already be allowed in address names.average-vr-56795
07/02/2021, 9:46 PMwitty-crayon-22786
07/02/2021, 9:48 PMField
type for a target, and if it is not declared literally on the target, it can be computed for the targetaverage-vr-56795
07/02/2021, 9:51 PMpython_distribution
as something which in some way pretends to be a python_library
without any dependencies as far as things depending on it are concerned, but retains the dependency information for other contexts where that's needed... I'm not sure what exactly that would look like model-wise these dayswitty-crayon-22786
07/02/2021, 9:51 PMFields
are still conceptually treated as inputs… even when they might be a PythonSources
field generated from a ProtobufSources
field (example from HEAD)happy-kitchen-89482
07/02/2021, 9:53 PMfiles
target containing the built artifactaverage-vr-56795
07/02/2021, 9:54 PMwitty-crayon-22786
07/02/2021, 9:58 PMpython_library
consuming python_distribution
to mean different things in different contexts, we either need new syntax or new attributes. we don’t have the data
vs deps
split, so we only have one list. if we had two attributes you’d put the python_distribution
in your data
list if you wanted loose files, or deps
if the other thing.happy-kitchen-89482
07/02/2021, 9:58 PMaverage-vr-56795
07/02/2021, 10:02 PMhappy-kitchen-89482
07/02/2021, 10:03 PMsetup.py
) we don't have to worry about dep inference creating conflictsaverage-vr-56795
07/02/2021, 10:05 PMhappy-kitchen-89482
07/02/2021, 10:06 PMaverage-vr-56795
07/02/2021, 10:09 PMprovides
attribute on v1 JVM rules? Tagging the explicit metadata so you can handle the conflict smoothly