uv icon indicating copy to clipboard operation
uv copied to clipboard

`uv pip compile --upgrade` can fail when `uv pip compile` succeeds if `requirements.txt` contains pre-release

Open Phlogistique opened this issue 1 year ago • 4 comments

My requirements.in contains a package which depends on betterproto>=2.0.0b6. The requirements.txt was initially generated using pip and contains betterproto==2.0.0b6.

Running uv pip compile works, but uv pip compile --upgrade refuses to pick up that pre-release version, and therefore fails resolution.

I would think it would be more intuitive for either:

  • uv pip compile to fail if any pre-release version is already in requirements.txt, or
  • uv pip compile --upgrade to accept pre-releases if they are already in requirements.txt

Phlogistique avatar May 15 '24 08:05 Phlogistique

I think "uv pip compile --upgrade to accept pre-releases if they are already in requirements.txt" does make sense.

charliermarsh avatar May 15 '24 14:05 charliermarsh

I would probably say the same of yanked packages... If you run with --upgrade, and your lockfile uses a yanked package, we should probably allow you to continue using it...?

charliermarsh avatar May 16 '24 16:05 charliermarsh

That's a little more dubious imo. If something is yanked you ought to be pushed to resolve it. If you want to keep using the yanked version you should have to pin? Can we consider that separately? (see #3644)

zanieb avatar May 17 '24 02:05 zanieb

Yeah that's fine.

charliermarsh avatar May 17 '24 13:05 charliermarsh