rich-london-74860
06/01/2023, 8:03 PMrequires
used to generate our wheel files have loose constraints (in general, we use ~=
instead of ==
), which means that dependency versions are set when the wheel file is installed, not when it is built, so 2 spark clusters created at 2 different points in time could have a different set of dependencies.
This is not a problem in our the pants
monorepo because pants
freezes all dependency versions in lockfiles. This is also not a problem for our docker containers because in that case, the dependency is installed in the container at build time (unfortunately, our spark cloud provider puts a lot of limitations on docker so this is not an option for spark).
Is there an option for the python_distribution
target (or the setup_py
target inside the python_distribution
target) to modify requires
to use ==
constraints for versions in the lockfile?
To put this another way, I want a requirements.txt
file that has loose dependency constraints, but a wheel file with hard-pinned ==
constraints, the specific version used being the one that’s set in the lockfile.
Would it be possible to write a custom target that does this?
If so, then where would I start?refined-addition-53644
06/01/2023, 8:30 PMcurved-television-6568
06/01/2023, 8:31 PMsetup()
call is calculated in this rule: https://github.com/pantsbuild/pants/blob/main/src/python/pants/backend/python/util_rules/package_dists.py#L588-L724 so looking at that may be a first good step at figuring out a way to customize it…rich-london-74860
06/01/2023, 8:32 PMpex
file 😢rich-london-74860
06/01/2023, 8:33 PMcurved-television-6568
06/01/2023, 8:33 PMcurved-television-6568
06/01/2023, 8:34 PMcurved-television-6568
06/01/2023, 8:37 PMrich-london-74860
06/01/2023, 8:37 PMcurved-television-6568
06/01/2023, 8:37 PMcurved-television-6568
06/01/2023, 8:38 PMcurved-television-6568
06/01/2023, 8:38 PMcurved-television-6568
06/01/2023, 8:38 PMcurved-television-6568
06/01/2023, 8:39 PMrich-london-74860
06/01/2023, 8:39 PMcurved-television-6568
06/01/2023, 8:39 PMhappy-kitchen-89482
06/02/2023, 1:01 AMhappy-kitchen-89482
06/02/2023, 1:01 AMhappy-kitchen-89482
06/02/2023, 1:02 AMhappy-kitchen-89482
06/02/2023, 1:02 AMcurved-television-6568
06/02/2023, 2:45 PMcurved-television-6568
06/02/2023, 2:45 PMrich-london-74860
06/02/2023, 3:34 PMthird_party_dependency_version_scheme=exact
is exactly what we wanthappy-kitchen-89482
06/02/2023, 3:52 PM