careful-address-89803
09/01/2022, 5:40 PMpython_distribution
?flat-zoo-31952
09/01/2022, 5:48 PMcareful-address-89803
09/01/2022, 6:00 PMpip install
. I'm open to anything that lets us specify exact versions. Currently we use pants to generate a poetry-style lockfile and then use pip-compile
to write that to a file and then slurp that file in setup.py
, which is gross, but it would be great if I could have pants replace all of that in a python_distribution
careful-address-89803
09/01/2022, 6:04 PMhundreds-father-404
09/01/2022, 6:10 PMpython_requirement
targets (which usually come from a requirements.txt
) to set up install_requires
. Generally, Python distributions don't have a mechanism for locks, outside of pants
So the best you can do is pin the version of every dependency to an exact version. Although that can make using the distribution really brittleflat-zoo-31952
09/01/2022, 6:17 PMcareful-address-89803
09/01/2022, 7:08 PMgenerate_lockfiles
is usable for version-pinning dependencies (with some finessing). But it doesn't look like there's an out-of-the-box way to get Pants to version-pin our dependencies in a python_distribution. We'll be fine continuing to use the setup.py.
Thanks for your help!hundreds-father-404
09/01/2022, 7:32 PMgenerate-lockfiles
would help here. it doesn't impact what metadata the distribution is built withwitty-crayon-22786
09/01/2022, 9:48 PMgenerate-lockfiles
is sufficient to later consume in a distribution, in the sense that the lockfile specifies a universe of valid deps.witty-crayon-22786
09/01/2022, 9:50 PMpex --lock=$lockfile -f=$dir-containing-my-wheel $req-for-my-wheel
… to have PEX resolve from the lockfilewitty-crayon-22786
09/01/2022, 9:50 PM