cool-yacht-37128
08/24/2022, 7:38 AMbitter-ability-32190
08/24/2022, 11:14 AMpytorch
.enough-analyst-54434
08/24/2022, 12:25 PM--style {strict, sources, universal}
and Pants always uses universal
today.
The universal mode creates 1 lock that must work for the complete range of interpreters and machines implied by --interpreter-constraint
and any --target-system
specified (Pants always passes --target-system mac --target-system linux
).
The strict and sources modes, on the other hand, use --interpreter-constraint
on the local machine to find all interpreters meeting those constraints and then, for each interpreter, creates a lock and all of these locks are stored in the one lock file. When the lock is later consumed to produce a PEX for a specific interpreter, the best-fit lock is selected from the lock file. The only difference between strict and sources is that strict locks exactly what each selected interpreter needs and no more whereas sources also locks the sdist associated with each wheel locked if there is an sdist. A challenge using these modes is to ensure the machine you create the lock on has all the interpreters needed installed. Otherwise, if you have --interpreter-constraint ">3.7,<3.10"
and you create the strict or sources lock on a machine with only Python 3.8, the lock file will only contain a single lock for the Python 3.8 interpreter but not 3.7, 3.9 or 3.10 (and even that is simplistic since real artifact in the wild have constraints like `Requires-Python >=3.7.2`; so to cover all bases you really need every minor release of Python too unless you know your resolve real well and know this is not a factor. With universal mode, the lock create command can safely be run on any machine.enough-analyst-54434
08/24/2022, 12:44 PMbitter-ability-32190
08/24/2022, 12:47 PMbitter-ability-32190
08/24/2022, 12:50 PMenough-analyst-54434
08/24/2022, 12:51 PMpytorch==1.2.2; <marker1>
pytorch==1.2.2+_cu102; <marker2>
You'd arrange marker1 and marker2 to be mutually exclusive.enough-analyst-54434
08/24/2022, 12:52 PMenough-analyst-54434
08/24/2022, 12:52 PMenough-analyst-54434
08/24/2022, 12:53 PMbitter-ability-32190
08/24/2022, 1:02 PMenough-analyst-54434
08/24/2022, 1:03 PMenough-analyst-54434
08/24/2022, 1:04 PMbitter-ability-32190
08/24/2022, 1:05 PMenough-analyst-54434
08/24/2022, 1:15 PMenough-analyst-54434
08/24/2022, 1:16 PMenough-analyst-54434
08/24/2022, 1:17 PMbitter-ability-32190
08/24/2022, 1:19 PM