witty-crayon-22786
05/21/2020, 12:34 AMhundreds-father-404
05/21/2020, 12:35 AMwitty-crayon-22786
05/21/2020, 12:36 AMhundreds-father-404
05/21/2020, 12:45 AMawait Get[Addresses](DependenciesRequest(tgt[Dependencies]))
or
await Get[Addresses](ResolveDependenciesRequest(tgt[Dependencies]))
I like the latter for being more clear, but weāll also type this a fair amount so maybe too longwitty-crayon-22786
05/21/2020, 12:54 AMwitty-crayon-22786
05/21/2020, 12:56 AMhundreds-father-404
05/21/2020, 12:56 AMDependencies -> Addresses
, because it would break with the subclass ProtobufDependencies
.
Same reason we need the wrapping HydrateSourcesRequest
hundreds-father-404
05/21/2020, 12:56 AMwitty-crayon-22786
05/21/2020, 12:59 AMwitty-crayon-22786
05/21/2020, 1:00 AM@rule
to produce Addresses? ⦠ie should that be the union here�witty-crayon-22786
05/21/2020, 1:01 AMaverage-vr-56795
05/21/2020, 8:11 PMhundreds-father-404
05/21/2020, 8:15 PMAddresses
3) write a rule
And it makes call sites much more complex.
from pants.backend.python.target_types import EntryPoint, HydrateEntryPointRequest, HydratedEntryPoint
await Get[HydratedEntryPoint](HydrateEntryPoint(tgt.get(EntryPoint))
print(hydrated_entry_point.value)
vs.
from pants.backend.python.target_types import EntryPoint
print(tgt.get(EntryPoint).value)
average-vr-56795
05/21/2020, 8:17 PMhundreds-father-404
05/21/2020, 8:20 PMI still suggest that means we need to work out how to improve our syntaxGenerally agreed with this sentiment. But weāre also running up against natural constraints of the engine that we are unlikely to want to change. For example, needing a new request type and a result type will likely always be the case, afaict. The engine is exceptionally magical, in a good way. But sometimes plain and simple Python is more appropriate. ā
We should work out how to do that kind of transition in the future without breaking the worldAgreed
hundreds-father-404
05/21/2020, 8:31 PMwitty-crayon-22786
05/21/2020, 8:33 PMFor example, needing a new request type and a result type will likely always be the case, afaict.only if we continue to encourage subclassing of fields for as many usecases as we currently do. i mentioned the possibility of breaking out the pluggable logic there into another type
witty-crayon-22786
05/21/2020, 8:34 PMwitty-crayon-22786
05/21/2020, 10:00 PMwitty-crayon-22786
05/21/2020, 10:19 PMwitty-crayon-22786
05/21/2020, 10:22 PMhundreds-father-404
05/27/2020, 6:22 AM@rule
async def transitive_target(wrapped_root: WrappedTarget) -> TransitiveTarget:
root = wrapped_root.target
if not root.has_field(Dependencies):
return TransitiveTarget(root, ())
dependency_addresses = await Get[Addresses](DependenciesRequest(root[Dependencies]))
Unregistering the protobuf rule fixes it all.hundreds-father-404
05/27/2020, 9:34 PMhundreds-father-404
05/27/2020, 9:36 PMpants.ini
impacts everyone.
We canāt remove a bunch of things like V1 isort and filedeps
until this deprecation lands.witty-crayon-22786
05/27/2020, 11:00 PMwitty-crayon-22786
05/28/2020, 6:40 PMwitty-crayon-22786
05/28/2020, 6:40 PMhundreds-father-404
05/28/2020, 7:18 PMhundreds-father-404
05/28/2020, 8:35 PMobject
for contrib_plugin
is that we need access to the targetās relative path (spec path). Does this mean I need to use context_aware_object_factory
?witty-crayon-22786
05/28/2020, 8:59 PM