mirror of https://github.com/astral-sh/uv
Add env arg UV_NO_EDITABLE (#12773)
<!-- 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 <!-- What's the purpose of the change? What does it do, and why? --> Adds the env arg `UV_NO_EDITABLE`. Closes #12735 ## Test Plan <!-- How was it tested? -->  I could not find a place where to add tests, any help would be appreciated --------- Co-authored-by: Aria Desires <aria.desires@gmail.com>
This commit is contained in:
parent
719bab307c
commit
ef68fca591
|
|
@ -2865,7 +2865,7 @@ pub struct RunArgs {
|
||||||
|
|
||||||
/// Install any editable dependencies, including the project and any workspace members, as
|
/// Install any editable dependencies, including the project and any workspace members, as
|
||||||
/// non-editable.
|
/// non-editable.
|
||||||
#[arg(long)]
|
#[arg(long, value_parser = clap::builder::BoolishValueParser::new(), env = EnvVars::UV_NO_EDITABLE)]
|
||||||
pub no_editable: bool,
|
pub no_editable: bool,
|
||||||
|
|
||||||
/// Do not remove extraneous packages present in the environment.
|
/// Do not remove extraneous packages present in the environment.
|
||||||
|
|
@ -3146,7 +3146,7 @@ pub struct SyncArgs {
|
||||||
|
|
||||||
/// Install any editable dependencies, including the project and any workspace members, as
|
/// Install any editable dependencies, including the project and any workspace members, as
|
||||||
/// non-editable.
|
/// non-editable.
|
||||||
#[arg(long)]
|
#[arg(long, value_parser = clap::builder::BoolishValueParser::new(), env = EnvVars::UV_NO_EDITABLE)]
|
||||||
pub no_editable: bool,
|
pub no_editable: bool,
|
||||||
|
|
||||||
/// Do not remove extraneous packages present in the environment.
|
/// Do not remove extraneous packages present in the environment.
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,11 @@ impl EnvVars {
|
||||||
/// will compile Python source files to bytecode after installation.
|
/// will compile Python source files to bytecode after installation.
|
||||||
pub const UV_COMPILE_BYTECODE: &'static str = "UV_COMPILE_BYTECODE";
|
pub const UV_COMPILE_BYTECODE: &'static str = "UV_COMPILE_BYTECODE";
|
||||||
|
|
||||||
|
/// Equivalent to the `--no-editable` command-line argument. If set, uv
|
||||||
|
/// installs any editable dependencies, including the project and any workspace members, as
|
||||||
|
/// non-editable
|
||||||
|
pub const UV_NO_EDITABLE: &'static str = "UV_NO_EDITABLE";
|
||||||
|
|
||||||
/// Equivalent to the `--no-binary` command-line argument. If set, uv will install
|
/// Equivalent to the `--no-binary` command-line argument. If set, uv will install
|
||||||
/// all packages from source. The resolver will still use pre-built wheels to
|
/// all packages from source. The resolver will still use pre-built wheels to
|
||||||
/// extract package metadata, if available.
|
/// extract package metadata, if available.
|
||||||
|
|
|
||||||
|
|
@ -5392,6 +5392,16 @@ fn sync_no_editable() -> Result<()> {
|
||||||
+ root==0.1.0 (from file://[TEMP_DIR]/)
|
+ root==0.1.0 (from file://[TEMP_DIR]/)
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
|
uv_snapshot!(context.filters(), context.sync().env(EnvVars::UV_NO_EDITABLE, "1"), @r"
|
||||||
|
success: true
|
||||||
|
exit_code: 0
|
||||||
|
----- stdout -----
|
||||||
|
|
||||||
|
----- stderr -----
|
||||||
|
Resolved 2 packages in [TIME]
|
||||||
|
Audited 2 packages in [TIME]
|
||||||
|
");
|
||||||
|
|
||||||
// Remove the project.
|
// Remove the project.
|
||||||
fs_err::remove_dir_all(&child)?;
|
fs_err::remove_dir_all(&child)?;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -225,6 +225,12 @@ Equivalent to the `--no-config` command-line argument. If set, uv will not read
|
||||||
any configuration files from the current directory, parent directories, or user configuration
|
any configuration files from the current directory, parent directories, or user configuration
|
||||||
directories.
|
directories.
|
||||||
|
|
||||||
|
### `UV_NO_EDITABLE`
|
||||||
|
|
||||||
|
Equivalent to the `--no-editable` command-line argument. If set, uv
|
||||||
|
installs any editable dependencies, including the project and any workspace members, as
|
||||||
|
non-editable
|
||||||
|
|
||||||
### `UV_NO_ENV_FILE`
|
### `UV_NO_ENV_FILE`
|
||||||
|
|
||||||
Ignore `.env` files when executing `uv run` commands.
|
Ignore `.env` files when executing `uv run` commands.
|
||||||
|
|
|
||||||
|
|
@ -345,6 +345,7 @@ uv run [OPTIONS] [COMMAND]
|
||||||
|
|
||||||
</dd><dt id="uv-run--no-editable"><a href="#uv-run--no-editable"><code>--no-editable</code></a></dt><dd><p>Install any editable dependencies, including the project and any workspace members, as non-editable</p>
|
</dd><dt id="uv-run--no-editable"><a href="#uv-run--no-editable"><code>--no-editable</code></a></dt><dd><p>Install any editable dependencies, including the project and any workspace members, as non-editable</p>
|
||||||
|
|
||||||
|
<p>May also be set with the <code>UV_NO_EDITABLE</code> environment variable.</p>
|
||||||
</dd><dt id="uv-run--no-env-file"><a href="#uv-run--no-env-file"><code>--no-env-file</code></a></dt><dd><p>Avoid reading environment variables from a <code>.env</code> file</p>
|
</dd><dt id="uv-run--no-env-file"><a href="#uv-run--no-env-file"><code>--no-env-file</code></a></dt><dd><p>Avoid reading environment variables from a <code>.env</code> file</p>
|
||||||
|
|
||||||
<p>May also be set with the <code>UV_NO_ENV_FILE</code> environment variable.</p>
|
<p>May also be set with the <code>UV_NO_ENV_FILE</code> environment variable.</p>
|
||||||
|
|
@ -1749,6 +1750,7 @@ uv sync [OPTIONS]
|
||||||
|
|
||||||
</dd><dt id="uv-sync--no-editable"><a href="#uv-sync--no-editable"><code>--no-editable</code></a></dt><dd><p>Install any editable dependencies, including the project and any workspace members, as non-editable</p>
|
</dd><dt id="uv-sync--no-editable"><a href="#uv-sync--no-editable"><code>--no-editable</code></a></dt><dd><p>Install any editable dependencies, including the project and any workspace members, as non-editable</p>
|
||||||
|
|
||||||
|
<p>May also be set with the <code>UV_NO_EDITABLE</code> environment variable.</p>
|
||||||
</dd><dt id="uv-sync--no-extra"><a href="#uv-sync--no-extra"><code>--no-extra</code></a> <i>no-extra</i></dt><dd><p>Exclude the specified optional dependencies, if <code>--all-extras</code> is supplied.</p>
|
</dd><dt id="uv-sync--no-extra"><a href="#uv-sync--no-extra"><code>--no-extra</code></a> <i>no-extra</i></dt><dd><p>Exclude the specified optional dependencies, if <code>--all-extras</code> is supplied.</p>
|
||||||
|
|
||||||
<p>May be provided multiple times.</p>
|
<p>May be provided multiple times.</p>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue