Add --exact flag to uv run (#10198)

## Summary

`uv run --exact` will remove any unnecessary packages prior to running
the given command. (By default, `uv run` uses "inexact" semantics.)

Closes https://github.com/astral-sh/uv/issues/7838.
This commit is contained in:
Charlie Marsh
2024-12-27 11:43:30 -05:00
committed by GitHub
parent 0bc33e87b8
commit 49a2b6f85c
6 changed files with 97 additions and 2 deletions
+4
View File
@@ -148,6 +148,10 @@ uv run [OPTIONS] [COMMAND]
<p>Can be provided multiple times, with subsequent files overriding values defined in previous files.</p>
<p>May also be set with the <code>UV_ENV_FILE</code> environment variable.</p>
</dd><dt><code>--exact</code></dt><dd><p>Perform an exact sync, removing extraneous packages.</p>
<p>When enabled, uv will remove any extraneous packages from the environment. By default, <code>uv run</code> will make the minimum necessary changes to satisfy the requirements.</p>
</dd><dt><code>--exclude-newer</code> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system&#8217;s configured time zone.</p>