bitter-ability-32190
08/04/2022, 7:34 PMdependencies
field, and therefore falls short when presented when unexpected targets.
I encourage everyone to read it, reflect on it, and comment with thoughts. It's an ambitious proposal (and will take a community effort to implement if agreed on) so I'm also going to explicitly ask readers to read the whole thing before commenting, and comment from a place of collaboration (and not from a place of challenge).
The TL;DR is:
1. shifting from one monolithic dependencies
field to several more specialized dependencies fields (e.g file_deps
, typecheck_deps
)
2. Treating the "file" as the root understanding of most dependenciesambitious-actor-36781
08/04/2022, 9:16 PMbitter-ability-32190
08/04/2022, 9:26 PMif I as a user have said "this depends on this" then ... include those in the sandbox?That's at the core of #2 in the TL;DR. Most times the dependency represents file(s) placed in a sandbox, and we should lean into that
Isn't the type of the dependency inferred from the target type?It's actually more complicated than that, today. The type of the dependency is determined from the type of one of a few key fields on the target type, and possibly their subclass. E.g. since `python_source`'s
source
field is a PythonSourceField
, rules that care about PythonSourceField
and SourceField
can request the source.
There's also a secret secondary battle I'm fighting, which is that I might not know or care how a target is consumed when declaring the target. Namely file
v resource
. This proposal solves that and takes it a step further.ambitious-actor-36781
08/04/2022, 9:44 PMambitious-actor-36781
08/04/2022, 9:47 PMCodeGen(some_yaml)->some_python
source dep, or file dep?bitter-ability-32190
08/04/2022, 9:59 PMambitious-actor-36781
08/04/2022, 10:02 PMbitter-ability-32190
08/04/2022, 10:03 PMbitter-ability-32190
08/04/2022, 10:04 PMbitter-ability-32190
08/05/2022, 12:40 AMproud-dentist-22844
08/10/2022, 4:53 AMdependencies
to make its target specific behavior clear and then add more deps fields to cover current shortcomings with asset usage. So, for python_sources
you have the python_deps
field (renamed/aliased from dependencies
) and then add file_deps
, and resource_deps
. That does not lean all the way into files like you suggested. Iām not sure if that UX differs substantially from what you recommended. Putting python deps (files, or req/package deps) in files_deps
feels odd, but it would be consistent from target to target - so which aspect of dependencies
is most important? Consistent naming across target types or the current target-specific behavior (python uses python)?bitter-ability-32190
08/10/2022, 11:15 AMbitter-ability-32190
08/10/2022, 12:01 PMpython_typecheck_deps
proud-dentist-22844
08/10/2022, 6:00 PMpython_source
depends on another python file, but as a file
, not as python code. For example, when the python_source needs to run the dependent python in a subprocess instead of importing it.bitter-ability-32190
08/10/2022, 6:00 PMfile_deps
python_source
wouldn't have a PYTHONPATH
pointing to it. Which is the right thing to dobitter-ability-32190
08/12/2022, 12:54 AM