uv icon indicating copy to clipboard operation
uv copied to clipboard

`uv pip compile`: add `--no-upgrade` flag

Open gotmax23 opened this issue 1 year ago • 2 comments

(Version: uv 0.1.9)

It would be nice if uv pip compile had a --no-upgrade flag to reverse --upgrade. In my projects' nox configurations, we have something like

@nox.session(name="pip-compile")
def pip_compile(session):
    session.run("pip-compile", "requirements.in", "-o", "requirements.txt", "--upgrade", *session.posargs)

so --upgrade is the default operation, but sometimes we want to disable that behavior with nox -e pip-compile -- --no-upgrade.

gotmax23 avatar Feb 23 '24 04:02 gotmax23

Could you just drop --upgrade from that command when you see --no-upgrade? I think allowing multiple conflicting arguments to be passed leads to too much ambiguity.

zanieb avatar Feb 23 '24 04:02 zanieb

Could you just drop --upgrade from that command when you see --no-upgrade?

We could, but that would definitely make it more complicated.

I think allowing multiple conflicting arguments to be passed leads to too much ambiguity.

For what it's worth, allowing to invert boolean CLI flags with a --no-FLAG option is popular amongst CLI interfaces.

gotmax23 avatar Feb 23 '24 05:02 gotmax23