Skip to content

Commit

Permalink
bump deprecation version
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Feb 12, 2020
1 parent d1de910 commit be490ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
9 changes: 5 additions & 4 deletions src/python/pants/engine/legacy/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,11 +629,12 @@ async def hydrated_targets(addresses: Addresses) -> HydratedTargets:
targets = await MultiGet(Get[HydratedTarget](Address, a) for a in addresses)
return HydratedTargets(targets)

def transitive_fingerprinted_targets(addresses: Addresses) -> FingerprintedTargetCollection:
@rule
async def transitive_fingerprinted_targets(addresses: Addresses) -> FingerprintedTargetCollection:
"""Traverse BuildFileAddresses to obtain fingerprint information for the target set."""

root_transitive_hydrated_targets = yield [Get(TransitiveHydratedTarget, Address, a)
for a in addresses]
root_transitive_hydrated_targets = await MultiGet(Get(TransitiveHydratedTarget, Address, a)
for a in addresses)
transitive_hydrated_targets = tuple(
(tht, True)
for tht in root_transitive_hydrated_targets
Expand Down Expand Up @@ -661,7 +662,7 @@ def lookup_fingerprint(tht):
for tht, was_root in transitive_hydrated_targets
]

yield FingerprintedTargetCollection(tuple(fingerprinted_targets))
return FingerprintedTargetCollection(tuple(fingerprinted_targets))


@dataclass(frozen=True)
Expand Down
12 changes: 6 additions & 6 deletions src/python/pants/rules/core/list_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class OutputFormat(Enum):
def register_options(cls, register):
super().register_options(register)
register('--provides', type=bool,
removal_version='1.24.0.dev2',
removal_version='1.28.0.dev2',
removal_hint='Use --output-format=provides instead!',
help='List only targets that provide an artifact, displaying the columns specified by '
'--provides-columns.')
Expand All @@ -37,7 +37,7 @@ def register_options(cls, register):
'address, artifact_id, repo_name, repo_url, push_db_basedir')

register('--documented', type=bool,
removal_version='1.24.0.dev2',
removal_version='1.28.0.dev2',
removal_hint='Use --output-format=documented instead!',
help='Print only targets that are documented with a description.')

Expand Down Expand Up @@ -108,19 +108,19 @@ async def list_targets(console: Console, list_options: ListOptions, addresses: A
elif documented:
output_format = List.OutputFormat.documented

# TODO: a .resolve_for_enum_variant() which allows `yield Get()` within it somehow!
# TODO: a match() method for Enums which allows `await Get()` within it somehow!
if output_format == List.OutputFormat.provides:
# To get provides clauses, we need hydrated targets.
collection = yield Get(HydratedTargets, Specs, specs)
collection = await Get[HydratedTargets](Specs, specs)
print_fn = _make_provides_print_fn(provides_columns)
elif output_format == List.OutputFormat.documented:
# To get documentation, we need hydrated targets.
collection = yield Get(HydratedTargets, Specs, specs)
collection = await Get[HydratedTargets](Specs, specs)
print_fn = _print_documented_target
elif output_format == List.OutputFormat.json:
# To get fingerprints of each target and its dependencies, we have to request that information
# specifically.
collection = yield Get(FingerprintedTargetCollection, Specs, specs)
collection = await Get[FingerprintedTargetCollection](Specs, specs)
print_fn = _print_fingerprinted_target
else:
assert output_format == List.OutputFormat.address_specs
Expand Down

0 comments on commit be490ad

Please sign in to comment.