Using `pex lock create` how can I have it resolve ...
# general
h
Using
pex lock create
how can I have it resolve a package in the same way that pip does? I’m looking for the most recent version (that abides by the other flags I’ve set), yet it returns the lowest compatible version. Is there an option I’m missing?
w
Can you give the full command you're using, what it's generating, and what you're expecting?
h
Copy code
pex3 lock create "private_package" --pre --style universal --index-url <private_index> --platform macosx_14_0_x86_64-cp-39-cp39 --platform macosx_14_0_arm64-cp-39-cp39 --platform linux_x86_64-cp-39-cp39 --platform linux_aarch64-cp-39-cp39 --interpreter-constraint 'CPython>=3.9'
And this is returning the earliest version of
private_package
that is compatible, whereas I’m looking for the latest
It creates the lockfile successfully, in case that wasn’t clear
Alternatively is there a way to use pex’s resolver directly rather than creating a lockfile? Similar to how
pip search
used to function
c
pex’s resolver directly
Pex does not have it's own resolver, it calls out to pip! If you up the logging and/or
ps
you ought be be able to see exactly what pip is doing. If I do:
Copy code
pex3 lock create cowsay --pre --style universal --platform macosx_14_0_x86_64-cp-39-cp39 --platform macosx_14_0_arm64-cp-39-cp39 --platform linux_x86_64-cp-39-cp39 --platform linux_aarch64-cp-39-cp39 --interpreter-constraint 'CPython>=3.9'
which matches the latest version at https://pypi.org/project/cowsay/#history If I were to hazard a guess, my recollection is that
--platform
(as opposed to
--complete-platform
) is something of a sharp tool https://github.com/pantsbuild/pants/issues/19978
h
Hm, that’s strange as I’m seeing the opposite with a private package. I’ll take a look at trying with
--complete-platforms
instead.