trying out the new pex-based lockfiles in 2.11, an...
# general
trying out the new pex-based lockfiles in 2.11, and running into a roadblock. not sure if a bug in pants/pex or a side effect of my repo’s ugly dependency tree 🤔 I’m running on an intel mac in my
I have:
Copy code
this works fine with vanilla
pip install
, but when I run
./pants generate-lockfiles
I get the failure:
Copy code
ERROR: Cannot install numpy==1.19.5 and opencv-python-headless== because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit <>
The conflict is caused by:
     The user requested numpy==1.19.5
     opencv-python-headless depends on numpy>=1.21.2; python_version >= "3.6" and platform_system == "Darwin" and platform_machine == "arm64"
I checked the
for that version of
and confirmed that the newer numpy version is only required when running on ARM (see here). Is it a mistake that pex lockfile generation is trying to resolve a dependency for
platform_machine == "arm64"
when I’m running on an intel mac? or is this the correct behavior because the lockfile is trying to support both intel and m1 macs?
It's the latter. Pants asks Pex unconditionally to create a
--style universal
lock. That means resolve for all platforms (and all Python versions implied by any relevant interpreter constraints configured in the repo).
I was afraid you’d say that 🙂 but makes sense to me
There is currently no way to tell Pex universal, except for these platforms.
I'll think on if that is possible for Pex to support. It seems like it would be.
👍 1
We also could still add some modeling to pants to indicate that you do not want a universal lock. Even though many organizations will need a universal lock because not everyone uses the exact same platform, I can imagine some teams will be consistent. John has pointed out the security implications of not using universal I only paused to try to tackle that because the Python sub system is already so damn complex and I did not want to add anything until we finish removing the old stuff like poetry