Skip to content

Commit

Permalink
put back removed rule
Browse files Browse the repository at this point in the history
  • Loading branch information
tdyas committed Jan 3, 2025
1 parent bb5025f commit 8b29507
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/python/pants/backend/python/util_rules/pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
)
from pants.backend.python.util_rules import pex_cli, pex_requirements
from pants.backend.python.util_rules.interpreter_constraints import InterpreterConstraints
from pants.backend.python.util_rules.pex_cli import PexCliProcess, maybe_log_pex_stderr
from pants.backend.python.util_rules.pex_cli import PexCliProcess, PexPEX, maybe_log_pex_stderr
from pants.backend.python.util_rules.pex_environment import (
CompletePexEnvironment,
PexEnvironment,
Expand Down Expand Up @@ -1372,5 +1372,21 @@ async def determine_venv_pex_resolve_info(venv_pex: VenvPex) -> PexResolveInfo:
return parse_repository_info(process_result.stdout.decode())


@rule
async def determine_pex_resolve_info(pex_pex: PexPEX, pex: Pex) -> PexResolveInfo:
process_result = await Get(
ProcessResult,
PexProcess(
pex=Pex(digest=pex_pex.digest, name=pex_pex.exe, python=pex.python),
argv=[pex.name, "repository", "info", "-v"],
input_digest=pex.digest,
extra_env={"PEX_MODULE": "pex.tools"},
description=f"Determine distributions found in {pex.name}",
level=LogLevel.DEBUG,
),
)
return parse_repository_info(process_result.stdout.decode())


def rules():
return [*collect_rules(), *pex_cli.rules(), *pex_requirements.rules(), *stripped_source_rules()]

0 comments on commit 8b29507

Please sign in to comment.