Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vinibrsl opened this issue Oct 18, 2024 · 2 comments · Fixed by #8339
Closed

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

vinibrsl opened this issue Oct 18, 2024 · 2 comments · Fixed by #8339
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Contribution especially encouraged

Comments

@vinibrsl
Copy link
Contributor

vinibrsl commented Oct 18, 2024

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

@vinibrsl vinibrsl changed the title uv add --index does not accept special characters as the index name uv add --index does not accept special characters in the index name Oct 18, 2024
@zanieb
Copy link
Member

zanieb commented Oct 18, 2024

Yeah right now they must be alphanumeric

if name.chars().all(char::is_alphanumeric) {

Underscores and dashes seem pretty reasonable to me?

@zanieb zanieb added the needs-decision Undecided if this should be done label Oct 18, 2024
@charliermarsh
Copy link
Member

Yeah that seems fine.

@zanieb zanieb removed the needs-decision Undecided if this should be done label Oct 18, 2024
@charliermarsh charliermarsh added bug Something isn't working help wanted Contribution especially encouraged labels Oct 18, 2024
@charliermarsh charliermarsh removed their assignment Oct 18, 2024
@charliermarsh charliermarsh added the good first issue Good for newcomers label Oct 18, 2024
vinibrsl added a commit to vinibrsl/uv that referenced this issue Oct 18, 2024
Previously, `uv add --index` command threw an error when the index name
included characters like hyphens or underscores.

Closes astral-sh#8315
MtkN1 pushed a commit to MtkN1/uv that referenced this issue Oct 21, 2024
Previously, `uv add --index` command threw an error when the index name
included characters like hyphens or underscores.

Closes astral-sh#8315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Contribution especially encouraged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants