Is your feature request related to a problem? Please describe.
For Python lockfiles, when resolver = "uv" is set, resolves_to_constraints_file no longer works.
We currently rely on uv pip compile to generate a lockfile and use that as the source of truth for generating the Pants project lockfile. This is because we prefer using uv pip compile to manage package upgrades.
Describe the solution you'd like
It would be great if the resolves_to_constraints_file and resolver = "uv" combination can be supported. We currently have a workaround described below.
Describe alternatives you've considered
We currently use a multi-step workaround:
uv pip compile to generate a requirements.lock
- generate a temp
uv project
uv add -c requirements.lock to generate a uv.lock
pants generate-lockfiles --resolve=python-default --python-resolves="{'python-default': 'uv.lock'}" to transform the uv.lock into the Pants project uv lockfile, python-default.lock
It seems that it should therefore work? I may be missing nuances here.
Additional context
With my workaround approach, I had issues with custom indexes and had to specify them twice in pyproject.toml and pants.toml.
Is your feature request related to a problem? Please describe.
For Python lockfiles, when
resolver = "uv"is set,resolves_to_constraints_fileno longer works.We currently rely on
uv pip compileto generate a lockfile and use that as the source of truth for generating the Pants project lockfile. This is because we prefer usinguv pip compileto manage package upgrades.Describe the solution you'd like
It would be great if the
resolves_to_constraints_fileandresolver = "uv"combination can be supported. We currently have a workaround described below.Describe alternatives you've considered
We currently use a multi-step workaround:
uv pip compileto generate arequirements.lockuvprojectuv add -c requirements.lockto generate auv.lockpants generate-lockfiles --resolve=python-default --python-resolves="{'python-default': 'uv.lock'}"to transform theuv.lockinto the Pants projectuvlockfile,python-default.lockIt seems that it should therefore work? I may be missing nuances here.
Additional context
With my workaround approach, I had issues with custom indexes and had to specify them twice in
pyproject.tomlandpants.toml.