Skip to content

Commit

Permalink
Don't install Pex-style lockfile when no requirements used (pantsbuil…
Browse files Browse the repository at this point in the history
…d#15706)

Closes pantsbuild#15705.

[ci skip-rust]
[ci skip-build-wheels]
  • Loading branch information
Eric-Arellano committed May 31, 2022
1 parent c45e0cf commit e3ac5ce
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/python/pants/backend/python/util_rules/pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,18 +428,19 @@ async def build_pex(
loaded_lockfile = request.requirements.from_superset
# NB: This is also validated in the constructor.
assert loaded_lockfile.is_pex_native
requirements_digests.append(loaded_lockfile.lockfile_digest)
argv.extend(["--lock", loaded_lockfile.lockfile_path])
argv.extend(pex_lock_resolver_args)

if loaded_lockfile.metadata:
validate_metadata(
loaded_lockfile.metadata,
request.interpreter_constraints,
loaded_lockfile.original_lockfile,
request.requirements.req_strings,
python_setup,
)
if request.requirements.req_strings:
requirements_digests.append(loaded_lockfile.lockfile_digest)
argv.extend(["--lock", loaded_lockfile.lockfile_path])
argv.extend(pex_lock_resolver_args)

if loaded_lockfile.metadata:
validate_metadata(
loaded_lockfile.metadata,
request.interpreter_constraints,
loaded_lockfile.original_lockfile,
request.requirements.req_strings,
python_setup,
)
else:
assert request.requirements.from_superset is None

Expand Down

0 comments on commit e3ac5ce

Please sign in to comment.