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

Treat empty index URL strings as null instead of erroring #2137

Merged
merged 3 commits into from
Mar 3, 2024

Conversation

yasufumy
Copy link
Contributor

@yasufumy yasufumy commented Mar 3, 2024

Summary

Resolve #2129

I changed the behavior to parse an empty string for --index-url to be the same as the default.

@yasufumy yasufumy marked this pull request as ready for review March 3, 2024 09:32
Ok(url) => Ok(url),
Err(err) => Err(err.to_string()),
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think empty should probably map to None rather than PyPI. The difference is subtle but if a user has an --index-url in a requirements.txt, and they specify UV_INDEX_URL=, we should probably respect the index URL in the requirements.txt rather than overriding to PyPI (which will be accomplished by mapping this to None).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Playing around with this myself and Clap doesn't make it easy.

@charliermarsh charliermarsh force-pushed the fix/index-url-parser branch 2 times, most recently from 1c79751 to 358db13 Compare March 3, 2024 19:50
@charliermarsh charliermarsh added the compatibility Compatibility with a specification or another tool label Mar 3, 2024
@charliermarsh charliermarsh merged commit 13a6fc8 into astral-sh:main Mar 3, 2024
7 checks passed
@yasufumy yasufumy deleted the fix/index-url-parser branch March 4, 2024 00:53
@zanieb zanieb changed the title Make an empty string behave like the default Treat empty index URL strings as null instead of erroring Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support setting empty UV_INDEX_URL
2 participants