<#2050 Creating foreign locks (`--style universal`...
# github-notifications
q
#2050 Creating foreign locks (`--style universal` or `--platform` / `--complete-platform`) can fail for some sdists. Issue created by jsirois Currently locks that contain sdist-artifact-only projects build a wheel from the sdist to get the METADATA needed for the lock: pex/pex/resolve/lockfile/create.py Lines 197 to 205 in </pantsbuild/pex/commit/9491a4548247f6541e4216246a0a3f9234a0794d|9491a45> This can fail if the sdist builds a platform-specific wheel and the local platform is either incompatible with the sdist or does not have the proper libraries installed. Pex should be able to avoid these failures for well behaved platform-specific sdists by using https://peps.python.org/pep-0517/#prepare-metadata-for-build-wheel to get wheel METADATA instead. The bulk of the machinery already exists here and all that needs be changed is to add a new public function that calls the
prepare-metadata-for-build-wheel
PEP-517 hook instead: pex/pex/build_system/pep_517.py Lines 79 to 136 in </pantsbuild/pex/commit/4fd613ab4fe50ac27396f2339ad9aae2d63c398b|4fd613a> Unfortunately, this hook is not mandatory though; so a fallback to building a wheel will need to be maintained. pantsbuild/pex