Is it possible to include Windows wheels in the lo...
# general
r
Is it possible to include Windows wheels in the lockfile when using
[python-repos].find_links
pointing to a local directory with prebuilt wheels? The goal is to have both Linux and Windows wheels (for example
name-0.1.0-cp12-cp12-manylinux-2_35_x86_64.whl
and
name-0.1.0-cp12-cp12-win_amd64.whl
) from that local wheel directory included in the
.deps
directory of the packaged PEX file.
b
@rhythmic-church-81435 Pex lock files support Windows but, by default, Pants use of Pex limits lock files to Linux + Mac only: https://github.com/pantsbuild/pants/blob/591a4fc0804a297fe923698d643901a3fdfd1e6c/src/python/pants/backend/python/goals/lockfile.py#L140-L155 You can work around this using https://www.pantsbuild.org/stable/reference/subsystems/python#resolves_to_complete_platforms and generating a complete-platform per intended target - at least 1 for Linux, 1 for Windows if I understand the Pants code correctly. That said, the comment in the code linked above is still true. Although Pex can create locks for Windows, neither the Pex tool nor the PEX files it generates can run on Windows. I have worked on adding Windows support on and off for maybe 6 years now but never got that close to the finish line (passing all existing Pex tests). When it does support Windows, you'll see that in the "*Operating System*" Trove Classifiers section in the left pane here: https://pypi.org/project/pex/
r
Thank you. complete_platforms solves it for my use case.
b
But what are you going to do with a PEX file that contains Windows wheels since the PEX won't actually run on Windows?
r
I'm using pants in monorepo that has PyQt + PyInstaller. For Windows builds I manually inspect the packaged pex, transform it to what I need and send it to a Windows CI runner that creates an .exe out of it. Until now all dependencies had wheels that worked for both platforms but now I have to include windows and Linux separately. Maybe it's not optimal but it works.
b
Alrighty.