diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 7dfbfc8e12fa..2afd40a50f42 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -3718,26 +3718,26 @@ pub struct GenerateShellCompletionArgs { #[derive(Args)] #[allow(clippy::struct_excessive_bools)] pub struct IndexArgs { - /// The URL of the Python package index (by default: ). + /// The URLs of packages indexes to use when resolving dependencies. /// /// Accepts either a repository compliant with PEP 503 (the simple repository API), or a local /// directory laid out in the same format. /// - /// The index given by this flag is given lower priority than all other - /// indexes specified via the `--extra-index-url` flag. - #[arg(long, env = "UV_DEFAULT_INDEX", value_parser = parse_default_index_source, help_heading = "Index options")] - pub default_index: Option>, + /// All indexes provided via this flag take priority over the index specified by + /// `--default-index` (which defaults to PyPI). When multiple `--index` flags are + /// provided, earlier values take priority. + #[arg(long, env = "UV_INDEX", value_delimiter = ' ', value_parser = parse_index_source, help_heading = "Index options")] + pub index: Option>>, - /// Extra URLs of package indexes to use, in addition to `--index-url`. + /// The URL of the default package index (by default: ). /// /// Accepts either a repository compliant with PEP 503 (the simple repository API), or a local /// directory laid out in the same format. /// - /// All indexes provided via this flag take priority over the index specified by - /// `--index-url` (which defaults to PyPI). When multiple `--extra-index-url` flags are - /// provided, earlier values take priority. - #[arg(long, env = "UV_INDEX", value_delimiter = ' ', value_parser = parse_index_source, help_heading = "Index options")] - pub index: Option>>, + /// The index given by this flag is given lower priority than all other indexes specified via + /// the `--index` flag. + #[arg(long, env = "UV_DEFAULT_INDEX", value_parser = parse_default_index_source, help_heading = "Index options")] + pub default_index: Option>, /// The URL of the Python package index (by default: ). /// @@ -3746,6 +3746,8 @@ pub struct IndexArgs { /// /// The index given by this flag is given lower priority than all other /// indexes specified via the `--extra-index-url` flag. + /// + /// (Deprecated: use `--default-index` instead.) #[arg(long, short, env = "UV_INDEX_URL", value_parser = parse_index_url, help_heading = "Index options")] pub index_url: Option>, @@ -3757,6 +3759,8 @@ pub struct IndexArgs { /// All indexes provided via this flag take priority over the index specified by /// `--index-url` (which defaults to PyPI). When multiple `--extra-index-url` flags are /// provided, earlier values take priority. + /// + /// (Deprecated: use `--index` instead.) #[arg(long, env = "UV_EXTRA_INDEX_URL", value_delimiter = ' ', value_parser = parse_index_url, help_heading = "Index options")] pub extra_index_url: Option>>, diff --git a/crates/uv-settings/src/settings.rs b/crates/uv-settings/src/settings.rs index aee371cd3bb3..5cbbf80c97e2 100644 --- a/crates/uv-settings/src/settings.rs +++ b/crates/uv-settings/src/settings.rs @@ -296,15 +296,13 @@ pub struct ResolverOptions { #[serde(rename_all = "kebab-case")] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ResolverInstallerOptions { - /// The indexes to use when resolving dependencies. + /// The package indexes to use when resolving dependencies. /// /// Accepts either a repository compliant with [PEP 503](https://peps.python.org/pep-0503/) /// (the simple repository API), or a local directory laid out in the same format. /// /// Indexes are considered in the order in which they're defined, such that the first-defined - /// index has the highest priority. Further, the indexes provided by this setting are given - /// higher priority than any indexes specified via [`index_url`](#index-url) or - /// [`extra_index_url`](#extra-index-url). + /// index has the highest priority. /// /// If an index is marked as `explicit = true`, it will be used exclusively for those /// dependencies that select it explicitly via `[tool.uv.sources]`, as in: @@ -319,9 +317,9 @@ pub struct ResolverInstallerOptions { /// torch = { index = "pytorch" } /// ``` /// - /// If an index is marked as `default = true`, it will be moved to the front of the list of - /// the list of indexes, such that it is given the highest priority when resolving packages. - /// Additionally, marking an index as default will disable the PyPI default index. + /// Marking an index as `default = true` will disable the PyPI default index and move the + /// index to the end of the prioritized list, such that it is used when a package is not found + /// on any other index. #[option( default = "\"[]\"", value_type = "dict", @@ -338,7 +336,9 @@ pub struct ResolverInstallerOptions { /// (the simple repository API), or a local directory laid out in the same format. /// /// The index provided by this setting is given lower priority than any indexes specified via - /// [`extra_index_url`](#extra-index-url). + /// [`extra_index_url`](#extra-index-url) or [`index`](#index). + /// + /// (Deprecated: use `index` instead.) #[option( default = "\"https://pypi.org/simple\"", value_type = "str", @@ -353,10 +353,13 @@ pub struct ResolverInstallerOptions { /// (the simple repository API), or a local directory laid out in the same format. /// /// All indexes provided via this flag take priority over the index specified by - /// [`index_url`](#index-url). When multiple indexes are provided, earlier values take priority. + /// [`index_url`](#index-url) or [`index`](#index) with `default = true`. When multiple indexes + /// are provided, earlier values take priority. /// /// To control uv's resolution strategy when multiple indexes are present, see /// [`index_strategy`](#index-strategy). + /// + /// (Deprecated: use `index` instead.) #[option( default = "[]", value_type = "list[str]", diff --git a/docs/reference/cli.md b/docs/reference/cli.md index ffbc8005c120..46e3d6b5e5dc 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -116,11 +116,11 @@ uv run [OPTIONS]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--directory directory

Change to the given directory prior to running the command.

@@ -148,6 +148,8 @@ uv run [OPTIONS]

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -161,11 +163,11 @@ uv run [OPTIONS]
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -188,6 +190,8 @@ uv run [OPTIONS]

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--isolated

Run the command in an isolated virtual environment.

@@ -663,11 +667,11 @@ uv add [OPTIONS] >

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--dev

Add the requirements as development dependencies

@@ -697,6 +701,8 @@ uv add [OPTIONS] >

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -710,11 +716,11 @@ uv add [OPTIONS] >
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -737,6 +743,8 @@ uv add [OPTIONS] >

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--keyring-provider keyring-provider

Attempt to use keyring for authentication for index URLs.

@@ -1001,11 +1009,11 @@ uv remove [OPTIONS] ...

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--dev

Remove the packages from the development dependencies

@@ -1027,6 +1035,8 @@ uv remove [OPTIONS] ...

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -1040,11 +1050,11 @@ uv remove [OPTIONS] ...
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -1067,6 +1077,8 @@ uv remove [OPTIONS] ...

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--keyring-provider keyring-provider

Attempt to use keyring for authentication for index URLs.

@@ -1315,11 +1327,11 @@ uv sync [OPTIONS]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--directory directory

Change to the given directory prior to running the command.

@@ -1345,6 +1357,8 @@ uv sync [OPTIONS]

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -1358,11 +1372,11 @@ uv sync [OPTIONS]
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -1385,6 +1399,8 @@ uv sync [OPTIONS]

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--inexact

Do not remove extraneous packages present in the environment.

@@ -1638,11 +1654,11 @@ uv lock [OPTIONS]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--directory directory

Change to the given directory prior to running the command.

@@ -1662,6 +1678,8 @@ uv lock [OPTIONS]

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -1673,11 +1691,11 @@ uv lock [OPTIONS]
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -1700,6 +1718,8 @@ uv lock [OPTIONS]

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--keyring-provider keyring-provider

Attempt to use keyring for authentication for index URLs.

@@ -1927,11 +1947,11 @@ uv export [OPTIONS]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--directory directory

Change to the given directory prior to running the command.

@@ -1955,6 +1975,8 @@ uv export [OPTIONS]

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -1978,11 +2000,11 @@ uv export [OPTIONS]
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -2005,6 +2027,8 @@ uv export [OPTIONS]

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--keyring-provider keyring-provider

Attempt to use keyring for authentication for index URLs.

@@ -2250,11 +2274,11 @@ uv tree [OPTIONS]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--depth, -d depth

Maximum display depth of the dependency tree

@@ -2277,6 +2301,8 @@ uv tree [OPTIONS]

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -2290,11 +2316,11 @@ uv tree [OPTIONS]
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -2317,6 +2343,8 @@ uv tree [OPTIONS]

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--invert

Show the reverse dependencies for the given package. This flag will invert the tree and display the packages that depend on the given package

@@ -2638,11 +2666,11 @@ uv tool run [OPTIONS] [COMMAND]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--directory directory

Change to the given directory prior to running the command.

@@ -2662,6 +2690,8 @@ uv tool run [OPTIONS] [COMMAND]

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -2675,11 +2705,11 @@ uv tool run [OPTIONS] [COMMAND]
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -2702,6 +2732,8 @@ uv tool run [OPTIONS] [COMMAND]

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--isolated

Run the tool in an isolated virtual environment, ignoring any already-installed tools

@@ -2940,11 +2972,11 @@ uv tool install [OPTIONS]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--directory directory

Change to the given directory prior to running the command.

@@ -2964,6 +2996,8 @@ uv tool install [OPTIONS]

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -2977,11 +3011,11 @@ uv tool install [OPTIONS]
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -3004,6 +3038,8 @@ uv tool install [OPTIONS]

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--keyring-provider keyring-provider

Attempt to use keyring for authentication for index URLs.

@@ -3238,11 +3274,11 @@ uv tool upgrade [OPTIONS] ...

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--directory directory

Change to the given directory prior to running the command.

@@ -3262,6 +3298,8 @@ uv tool upgrade [OPTIONS] ...

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -3271,11 +3309,11 @@ uv tool upgrade [OPTIONS] ...
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -3298,6 +3336,8 @@ uv tool upgrade [OPTIONS] ...

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--keyring-provider keyring-provider

Attempt to use keyring for authentication for index URLs.

@@ -4804,11 +4844,11 @@ uv pip compile [OPTIONS] ...

Used to reflect custom build scripts and commands that wrap uv pip compile.

May also be set with the UV_CUSTOM_COMPILE_COMMAND environment variable.

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--directory directory

Change to the given directory prior to running the command.

@@ -4840,6 +4880,8 @@ uv pip compile [OPTIONS] ...

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -4851,11 +4893,11 @@ uv pip compile [OPTIONS] ...
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -4878,6 +4920,8 @@ uv pip compile [OPTIONS] ...

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--keyring-provider keyring-provider

Attempt to use keyring for authentication for index URLs.

@@ -5216,11 +5260,11 @@ uv pip sync [OPTIONS] ...

This is equivalent to pip’s --constraint option.

May also be set with the UV_CONSTRAINT environment variable.

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--directory directory

Change to the given directory prior to running the command.

@@ -5242,6 +5286,8 @@ uv pip sync [OPTIONS] ...

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -5251,11 +5297,11 @@ uv pip sync [OPTIONS] ...
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -5278,6 +5324,8 @@ uv pip sync [OPTIONS] ...

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--keyring-provider keyring-provider

Attempt to use keyring for authentication for index URLs.

@@ -5566,11 +5614,11 @@ uv pip install [OPTIONS] |--editable This is equivalent to pip’s --constraint option.

May also be set with the UV_CONSTRAINT environment variable.

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--directory directory

Change to the given directory prior to running the command.

@@ -5598,6 +5646,8 @@ uv pip install [OPTIONS] |--editable All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -5607,11 +5657,11 @@ uv pip install [OPTIONS] |--editable
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -5634,6 +5684,8 @@ uv pip install [OPTIONS] |--editable The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--keyring-provider keyring-provider

Attempt to use keyring for authentication for index URLs.

@@ -6757,11 +6809,11 @@ uv venv [OPTIONS] [PATH]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--directory directory

Change to the given directory prior to running the command.

@@ -6781,6 +6833,8 @@ uv venv [OPTIONS] [PATH]

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -6790,11 +6844,11 @@ uv venv [OPTIONS] [PATH]
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -6817,6 +6871,8 @@ uv venv [OPTIONS] [PATH]

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--keyring-provider keyring-provider

Attempt to use keyring for authentication for index URLs.

@@ -7018,11 +7074,11 @@ uv build [OPTIONS] [SRC]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

-
--default-index default-index

The URL of the Python package index (by default: <https://pypi.org/simple>).

+
--default-index default-index

The URL of the default package index (by default: <https://pypi.org/simple>).

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

--directory directory

Change to the given directory prior to running the command.

@@ -7042,6 +7098,8 @@ uv build [OPTIONS] [SRC]

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

(Deprecated: use --index instead.)

+

May also be set with the UV_EXTRA_INDEX_URL environment variable.

--find-links, -f find-links

Locations to search for candidate distributions, in addition to those found in the registry indexes.

@@ -7051,11 +7109,11 @@ uv build [OPTIONS] [SRC]
--help, -h

Display the concise help for this command

-
--index index

Extra URLs of package indexes to use, in addition to --index-url.

+
--index index

The URLs of additional package indexes to use.

Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

-

All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

+

All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

May also be set with the UV_INDEX environment variable.

--index-strategy index-strategy

The strategy to use when resolving against multiple index URLs.

@@ -7078,6 +7136,8 @@ uv build [OPTIONS] [SRC]

The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

+

(Deprecated: use --default-index instead.)

+

May also be set with the UV_INDEX_URL environment variable.

--keyring-provider keyring-provider

Attempt to use keyring for authentication for index URLs.

diff --git a/docs/reference/settings.md b/docs/reference/settings.md index 7e37b47f5526..3419f51e60ba 100644 --- a/docs/reference/settings.md +++ b/docs/reference/settings.md @@ -577,11 +577,14 @@ Accepts either a repository compliant with [PEP 503](https://peps.python.org/pep (the simple repository API), or a local directory laid out in the same format. All indexes provided via this flag take priority over the index specified by -[`index_url`](#index-url). When multiple indexes are provided, earlier values take priority. +[`index_url`](#index-url) or [`index`](#index) with `default = true`. When multiple indexes +are provided, earlier values take priority. To control uv's resolution strategy when multiple indexes are present, see [`index_strategy`](#index-strategy). +(Deprecated: use `index` instead.) + **Default value**: `[]` **Type**: `list[str]` @@ -643,9 +646,7 @@ Accepts either a repository compliant with [PEP 503](https://peps.python.org/pep (the simple repository API), or a local directory laid out in the same format. Indexes are considered in the order in which they're defined, such that the first-defined -index has the highest priority. Further, the indexes provided by this setting are given -higher priority than any indexes specified via [`index_url`](#index-url) or -[`extra_index_url`](#extra-index-url). +index has the highest priority. If an index is marked as `explicit = true`, it will be used exclusively for those dependencies that select it explicitly via `[tool.uv.sources]`, as in: @@ -660,9 +661,9 @@ explicit = true torch = { index = "pytorch" } ``` -If an index is marked as `default = true`, it will be moved to the front of the list of -the list of indexes, such that it is given the highest priority when resolving packages. -Additionally, marking an index as default will disable the PyPI default index. +Marking an index as `default = true` will disable the PyPI default index and move the +index to the end of the prioritized list, such that it is used when a package is not found +on any other index. **Default value**: `"[]"` @@ -731,7 +732,9 @@ Accepts either a repository compliant with [PEP 503](https://peps.python.org/pep (the simple repository API), or a local directory laid out in the same format. The index provided by this setting is given lower priority than any indexes specified via -[`extra_index_url`](#extra-index-url). +[`extra_index_url`](#extra-index-url) or [`index`](#index). + +(Deprecated: use `index` instead.) **Default value**: `"https://pypi.org/simple"` diff --git a/uv.schema.json b/uv.schema.json index 18a5cfb7800f..dbdca349f95d 100644 --- a/uv.schema.json +++ b/uv.schema.json @@ -128,7 +128,7 @@ ] }, "extra-index-url": { - "description": "Extra URLs of package indexes to use, in addition to `--index-url`.\n\nAccepts either a repository compliant with [PEP 503](https://peps.python.org/pep-0503/) (the simple repository API), or a local directory laid out in the same format.\n\nAll indexes provided via this flag take priority over the index specified by [`index_url`](#index-url). When multiple indexes are provided, earlier values take priority.\n\nTo control uv's resolution strategy when multiple indexes are present, see [`index_strategy`](#index-strategy).", + "description": "Extra URLs of package indexes to use, in addition to `--index-url`.\n\nAccepts either a repository compliant with [PEP 503](https://peps.python.org/pep-0503/) (the simple repository API), or a local directory laid out in the same format.\n\nAll indexes provided via this flag take priority over the index specified by [`index_url`](#index-url) or [`index`](#index) with `default = true`. When multiple indexes are provided, earlier values take priority.\n\nTo control uv's resolution strategy when multiple indexes are present, see [`index_strategy`](#index-strategy).\n\n(Deprecated: use `index` instead.)", "type": [ "array", "null" @@ -169,7 +169,7 @@ ] }, "index-url": { - "description": "The URL of the Python package index (by default: ).\n\nAccepts either a repository compliant with [PEP 503](https://peps.python.org/pep-0503/) (the simple repository API), or a local directory laid out in the same format.\n\nThe index provided by this setting is given lower priority than any indexes specified via [`extra_index_url`](#extra-index-url).", + "description": "The URL of the Python package index (by default: ).\n\nAccepts either a repository compliant with [PEP 503](https://peps.python.org/pep-0503/) (the simple repository API), or a local directory laid out in the same format.\n\nThe index provided by this setting is given lower priority than any indexes specified via [`extra_index_url`](#extra-index-url) or [`index`](#index).\n\n(Deprecated: use `index` instead.)", "anyOf": [ { "$ref": "#/definitions/IndexUrl"