average-australia-85137
09/27/2022, 8:13 PMPythonSetup.requirement_constraints
to find the lockfile & copy that into the docker image, and then emit a pip install command using the constraints.
I think I can do the same thing with the resolved lock files(s) but... I'm not sure how to get the name/contents of that file?
I can find the normalized_value of PythonRequirementResolveField
but unless it's specified (I think?) it just is 'python-default'? should I just hardcode something in there? or... something? idk? is there.. an example how pex installs pip stuff? Also very open to the idea that i'm totally barking up the wrong tree!
thanks!average-australia-85137
09/28/2022, 7:45 PMhundreds-father-404
09/28/2022, 11:24 PMaverage-australia-85137
09/29/2022, 3:31 PMhundreds-father-404
09/29/2022, 3:36 PMPythonSubsystem.resolves
to get the path to your n == 1
lockfile. Then treat it like you treated constraints.txt
I recommend adding an AssertionError if n > 1, so that you know to redo this plugin when you have multiple resolvesaverage-australia-85137
09/29/2022, 3:36 PMhundreds-father-404
09/29/2022, 3:37 PMpex3 lock export
by using Pex directly to convert to requirements.txt, although it's a lossy operation
although it's a lossy operationI think the main challenge is platform-agnosticism. Pex lockfiles work with multiple platforms, whereas I want to say
pex3 lock export
only works with the specified platform (defaulting to current). You may want to specify --platform
to Pexaverage-australia-85137
09/29/2022, 6:33 PMpip install package==xyz -c lockfile.txt
into my dockerfile?average-australia-85137
09/29/2022, 6:35 PM(test) [nate@ragin-cajun pants-docker]$ pip install flask -c 3rdparty/python/default.lock
seems to workhundreds-father-404
09/29/2022, 6:36 PM[python].lockfile_generator
. But it has several issues, including sometimes issues with nonsensical environment markers for transitive deps, and not supporting [python-repos]
average-australia-85137
09/29/2022, 6:39 PMPANTS_GENERATE_LOCKFILES_CUSTOM_COMMAND
to use pip-compile to generate something?hundreds-father-404
09/29/2022, 6:44 PMpip install
to work with it.. is default.lock
a JSON file?hundreds-father-404
09/29/2022, 6:45 PMPANTS_GENERATE_LOCKFILES_CUSTOM_COMMANDThat solely impacts the comment in the header, not actually what Pants runs
average-australia-85137
09/29/2022, 6:48 PMansicolors==1.1.8
attrs==22.1.0; python_version >= "3.7"
certifi==2022.9.24; python_version >= "3.7" and python_version < "4"
average-australia-85137
09/29/2022, 6:50 PMPythonRequirementFileSourcesField
no longer workshundreds-father-404
09/29/2022, 6:54 PMaverage-australia-85137
09/29/2022, 7:07 PMaverage-australia-85137
09/29/2022, 8:40 PMpip-tools
additional variant to the lockfile_generator option? would that entail a huge amount of work to be compatible with pex_binaries etc? (which is also able to generate hashes)hundreds-father-404
09/29/2022, 9:15 PM--hash
hundreds-father-404
09/29/2022, 9:16 PMwould there be some way to add a pip-tools additional variant to the lockfile_generator option? would that entail a huge amount of work to be compatible with pex_binaries etc? (which is also able to generate hashes)we tried using pip-compile before switching to Poetry, then developing Pex. It had several issues, including that it does not attempt to support other platforms. A Linux-generated lockfile may fail on macOS
average-australia-85137
09/29/2022, 9:37 PMaverage-australia-85137
10/03/2022, 5:38 PM