uv
uv copied to clipboard
`uv pip compile`: add `--no-upgrade` flag
(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.
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.
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.