You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add NO_BINARY and NO_BINARY_PACKAGE environment variables (#11399)
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:
- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->
## Summary
This adds `NO_BINARY` and `NO_BINARY_PACKAGE` environment variables to
the uv CLI, allowing the user to specify packages to build from source
using environment variables. Its not a complete fix for #4291 as it does
not handle the `pip` subcommand.
## Test Plan
This was tested by running `uv sync` with various `UV_NO_BINARY` and
`UV_NO_BINARY_PACKAGE` environment variables set and checking that the
correct set of packages were compiled rather than taken from pre-built
wheels.
---------
Co-authored-by: Zanie Blue <contact@zanie.dev>
Copy file name to clipboardExpand all lines: docs/reference/cli.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -299,8 +299,10 @@ uv run [OPTIONS] [COMMAND]
299
299
300
300
<p>The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.</p>
301
301
302
+
<p>May also be set with the <code>UV_NO_BINARY</code> environment variable.</p>
302
303
</dd><dt><code>--no-binary-package</code> <i>no-binary-package</i></dt><dd><p>Don’t install pre-built wheels for a specific package</p>
303
304
305
+
<p>May also be set with the <code>UV_NO_BINARY_PACKAGE</code> environment variable.</p>
<p>When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.</p>
<p>The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.</p>
960
962
963
+
<p>May also be set with the <code>UV_NO_BINARY</code> environment variable.</p>
961
964
</dd><dt><code>--no-binary-package</code> <i>no-binary-package</i></dt><dd><p>Don’t install pre-built wheels for a specific package</p>
962
965
966
+
<p>May also be set with the <code>UV_NO_BINARY_PACKAGE</code> environment variable.</p>
<p>When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.</p>
<p>The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.</p>
1321
1325
1326
+
<p>May also be set with the <code>UV_NO_BINARY</code> environment variable.</p>
1322
1327
</dd><dt><code>--no-binary-package</code> <i>no-binary-package</i></dt><dd><p>Don’t install pre-built wheels for a specific package</p>
1323
1328
1329
+
<p>May also be set with the <code>UV_NO_BINARY_PACKAGE</code> environment variable.</p>
<p>When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.</p>
@@ -1692,8 +1698,10 @@ uv sync [OPTIONS]
1692
1698
1693
1699
<p>The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.</p>
1694
1700
1701
+
<p>May also be set with the <code>UV_NO_BINARY</code> environment variable.</p>
1695
1702
</dd><dt><code>--no-binary-package</code> <i>no-binary-package</i></dt><dd><p>Don’t install pre-built wheels for a specific package</p>
1696
1703
1704
+
<p>May also be set with the <code>UV_NO_BINARY_PACKAGE</code> environment variable.</p>
<p>When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.</p>
@@ -2059,8 +2067,10 @@ uv lock [OPTIONS]
2059
2067
2060
2068
<p>The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.</p>
2061
2069
2070
+
<p>May also be set with the <code>UV_NO_BINARY</code> environment variable.</p>
2062
2071
</dd><dt><code>--no-binary-package</code> <i>no-binary-package</i></dt><dd><p>Don’t install pre-built wheels for a specific package</p>
2063
2072
2073
+
<p>May also be set with the <code>UV_NO_BINARY_PACKAGE</code> environment variable.</p>
<p>When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.</p>
@@ -2404,8 +2414,10 @@ uv export [OPTIONS]
2404
2414
2405
2415
<p>The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.</p>
2406
2416
2417
+
<p>May also be set with the <code>UV_NO_BINARY</code> environment variable.</p>
2407
2418
</dd><dt><code>--no-binary-package</code> <i>no-binary-package</i></dt><dd><p>Don’t install pre-built wheels for a specific package</p>
2408
2419
2420
+
<p>May also be set with the <code>UV_NO_BINARY_PACKAGE</code> environment variable.</p>
<p>When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.</p>
@@ -2782,8 +2794,10 @@ uv tree [OPTIONS]
2782
2794
2783
2795
<p>The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.</p>
2784
2796
2797
+
<p>May also be set with the <code>UV_NO_BINARY</code> environment variable.</p>
2785
2798
</dd><dt><code>--no-binary-package</code> <i>no-binary-package</i></dt><dd><p>Don’t install pre-built wheels for a specific package</p>
2786
2799
2800
+
<p>May also be set with the <code>UV_NO_BINARY_PACKAGE</code> environment variable.</p>
<p>When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.</p>
@@ -3255,8 +3269,10 @@ uv tool run [OPTIONS] [COMMAND]
3255
3269
3256
3270
<p>The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.</p>
3257
3271
3272
+
<p>May also be set with the <code>UV_NO_BINARY</code> environment variable.</p>
3258
3273
</dd><dt><code>--no-binary-package</code> <i>no-binary-package</i></dt><dd><p>Don’t install pre-built wheels for a specific package</p>
3259
3274
3275
+
<p>May also be set with the <code>UV_NO_BINARY_PACKAGE</code> environment variable.</p>
<p>When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.</p>
<p>The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.</p>
3586
3602
3603
+
<p>May also be set with the <code>UV_NO_BINARY</code> environment variable.</p>
3587
3604
</dd><dt><code>--no-binary-package</code> <i>no-binary-package</i></dt><dd><p>Don’t install pre-built wheels for a specific package</p>
3588
3605
3606
+
<p>May also be set with the <code>UV_NO_BINARY_PACKAGE</code> environment variable.</p>
<p>When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.</p>
<p>The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.</p>
3909
3927
3928
+
<p>May also be set with the <code>UV_NO_BINARY</code> environment variable.</p>
3910
3929
</dd><dt><code>--no-binary-package</code> <i>no-binary-package</i></dt><dd><p>Don’t install pre-built wheels for a specific package</p>
3911
3930
3931
+
<p>May also be set with the <code>UV_NO_BINARY_PACKAGE</code> environment variable.</p>
<p>When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.</p>
@@ -8349,8 +8369,10 @@ uv build [OPTIONS] [SRC]
8349
8369
8350
8370
<p>The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.</p>
8351
8371
8372
+
<p>May also be set with the <code>UV_NO_BINARY</code> environment variable.</p>
8352
8373
</dd><dt><code>--no-binary-package</code> <i>no-binary-package</i></dt><dd><p>Don’t install pre-built wheels for a specific package</p>
8353
8374
8375
+
<p>May also be set with the <code>UV_NO_BINARY_PACKAGE</code> environment variable.</p>
<p>When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.</p>
0 commit comments