Skip to content

uv add --index does not accept special characters in the index name #8315

@vinibrsl

Description

@vinibrsl

uv throws an error when adding a custom index with a name that includes characters like hyphens or underscores. While the equal sign (=) is understandably restricted as the separator, other characters should be allowed in the index name.

$ uv add --index my_custom_index=https://customindex.test/path/to/index my_package
error: invalid value 'my_custom_index=https://customindex.test/path/to/index' for '--index <INDEX>': relative URL without a base

For more information, try '--help'.

If I rename my_custom_index to mycustomindex, the command works as expected, e.g. uv add --index mycustomindex=https://customindex.test/path/to/index my_package.

Version

$ uv --version
uv 0.4.24 (b9cd54913 2024-10-17)

Related: #7746

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomershelp wantedContribution especially encouraged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions