Skip to content

Commit

Permalink
Don't resolve constraints file / lockfile if no 3rd-party requirement…
Browse files Browse the repository at this point in the history
…s used (#12488)

This is an obvious performance improvement with no downsides.

[ci skip-rust]
[ci skip-build-wheels]
  • Loading branch information
Eric-Arellano authored Aug 3, 2021
1 parent 650a9b3 commit d62a22b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ async def pex_from_targets(request: PexFromTargetsRequest, python_setup: PythonS
repository_pex: Pex | None = None
description = request.description

if python_setup.requirement_constraints:
if python_setup.requirement_constraints and requirements:
constraints_file_contents = await Get(
DigestContents,
PathGlobs(
Expand Down Expand Up @@ -288,7 +288,7 @@ async def pex_from_targets(request: PexFromTargetsRequest, python_setup: PythonS
"`[python-setup].resolve_all_constraints` is enabled, so "
"`[python-setup].requirement_constraints` must also be set."
)
elif python_setup.lockfile:
elif python_setup.lockfile and requirements:
# TODO(#12314): This does not handle the case where requirements are disjoint to the
# lockfile. We should likely regenerate the lockfile (or warn/error), as the inputs have
# changed.
Expand Down

0 comments on commit d62a22b

Please sign in to comment.