astral-sh / uv

An extremely fast Python package installer and resolver, written in Rust.
https://astral.sh/
Apache License 2.0
14.7k stars 416 forks source link

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

Open Phlogistique opened 1 month ago

Phlogistique commented 1 month ago

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:

charliermarsh commented 1 month ago

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

charliermarsh commented 1 month ago

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...?

zanieb commented 1 month ago

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)

charliermarsh commented 1 month ago

Yeah that's fine.