Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2891,7 +2891,7 @@ pub struct InitArgs {
/// Initialize a build-backend of choice for the project.
///
/// Implicitly sets `--package`.
#[arg(long, value_enum, conflicts_with_all=["script", "no_package"])]
#[arg(long, value_enum, conflicts_with_all=["script", "no_package"], env = EnvVars::UV_INIT_BUILD_BACKEND)]
pub build_backend: Option<ProjectBuildBackend>,

/// Invalid option name for build backend.
Expand Down
4 changes: 4 additions & 0 deletions crates/uv-static/src/env_vars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ impl EnvVars {
/// Specifies the "bin" directory for installing tool executables.
pub const UV_TOOL_BIN_DIR: &'static str = "UV_TOOL_BIN_DIR";

/// Equivalent to the `--build-backend` argument for `uv init`. Determines the default backend
/// to use when creating a new project.
pub const UV_INIT_BUILD_BACKEND: &'static str = "UV_INIT_BUILD_BACKEND";

/// Specifies the path to the directory to use for a project virtual environment.
///
/// See the [project documentation](../concepts/projects/config.md#project-environment-path)
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ uv init [OPTIONS] [PATH]
<p>Disables creating extra files like <code>README.md</code>, the <code>src/</code> tree, <code>.python-version</code> files, etc.</p>
</dd><dt id="uv-init--build-backend"><a href="#uv-init--build-backend"><code>--build-backend</code></a> <i>build-backend</i></dt><dd><p>Initialize a build-backend of choice for the project.</p>
<p>Implicitly sets <code>--package</code>.</p>
<p>Possible values:</p>
<p>May also be set with the <code>UV_INIT_BUILD_BACKEND</code> environment variable.</p><p>Possible values:</p>
<ul>
<li><code>hatch</code>: Use <a href="https://pypi.org/project/hatchling">hatchling</a> as the project build backend</li>
<li><code>flit</code>: Use <a href="https://pypi.org/project/flit-core">flit-core</a> as the project build backend</li>
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ Provides the HTTP Basic authentication username for a named index.
The `name` parameter is the name of the index. For example, given an index named `foo`,
the environment variable key would be `UV_INDEX_FOO_USERNAME`.

### `UV_INIT_BUILD_BACKEND`

Equivalent to the `--build-backend` argument for `uv init`. Determines the default backend
to use when creating a new project.

### `UV_INSECURE_HOST`

Equivalent to the `--allow-insecure-host` argument.
Expand Down
Loading