Skip to content

Commit

Permalink
Plumb --elide-unused-requires-dist.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Jan 24, 2025
1 parent a36b3fa commit d4dc3e5
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pex/resolve/lockfile/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Constraint,
DistMetadata,
ProjectNameAndVersion,
Requirement,
is_tar_sdist,
is_zip_sdist,
)
Expand All @@ -42,6 +43,7 @@
VCSArtifact,
)
from pex.resolve.locker import Locker
from pex.resolve.lockfile import requires_dist
from pex.resolve.lockfile.download_manager import DownloadManager
from pex.resolve.lockfile.model import Lockfile
from pex.resolve.pep_691.fingerprint_service import FingerprintService
Expand Down Expand Up @@ -508,7 +510,19 @@ def _lock_build_system(
source_artifacts="\n".join(source_artifacts),
)
)
return build_system_table, result.locked_resolves
return (
build_system_table,
(
tuple(
requires_dist.remove_unused_requires_dist(
tuple(Requirement.parse(req) for req in build_system_table.requires), lr
)
for lr in result.locked_resolves
)
if lock_configuration.elide_unused_requires_dist
else result.locked_resolves
),
)


def _lock_build_systems(
Expand Down

0 comments on commit d4dc3e5

Please sign in to comment.