Skip to content

Commit

Permalink
Fix lock artifact fingerprint downloads to respect platforms.
Browse files Browse the repository at this point in the history
The needed patches were only being applied for universal lock creation and not
for foreign (abbreviated or complete) platform lock creation.
  • Loading branch information
jsirois committed Jun 7, 2024
1 parent 394c941 commit 27d586a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pex/resolve/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from pex.common import safe_mkdir, safe_mkdtemp
from pex.hashing import Sha256
from pex.jobs import Job, Raise, SpawnedJob, execute_parallel
from pex.pip import foreign_platform
from pex.pip.download_observer import DownloadObserver
from pex.pip.installation import get_pip
from pex.pip.tool import PackageIndexConfiguration, Pip
Expand Down Expand Up @@ -109,10 +110,10 @@ def _download(
break

# Although we don't actually need to observe the download, we do need to patch Pip to not
# care about wheel tags, environment markers or Requires-Python. The locker's download
# observer does just this for universal locks with no target system or requires python
# restrictions.
download_observer = DownloadObserver(
# care about wheel tags, environment markers or Requires-Python if the lock target is
# either foreign or universal. The locker.patch below handles the universal case or else
# generates no patches if the lock is not universal.
download_observer = foreign_platform.patch(self.target) or DownloadObserver(
analyzer=None,
patch_set=locker.patch(lock_configuration=self.lock_configuration),
)
Expand Down

0 comments on commit 27d586a

Please sign in to comment.