mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 02:22:19 +00:00
Add index URLs when provided via uv add --index
or --default-index
(#7746)
## Summary The behavior is as follows: - If you provide `--index` or `--default-index` on the command-line, we add those indexes to the `pyproject.toml` (with names, if provided, as in `--index pytorch=https://download.pytorch.org/whl/cu121`. - If you provide `--index-url` or `--default-index`, we warn, but don't add the indexes to the file. (This seems wrong -- why not add them?) - If you provide an index with a name or URL that already exists, we remove that entry, and add the new index to the top of the list (since it now has highest priority). - If you provide a `--default-index`, and an index already has `default = true`, we remove that entry, since it won't be used anymore. We do _not_ pin packages to specific indexes yet.
This commit is contained in:
parent
1925922770
commit
ad24cee7c6
7 changed files with 1037 additions and 5 deletions
|
@ -768,6 +768,10 @@ impl<T> Maybe<T> {
|
|||
Maybe::None => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_some(&self) -> bool {
|
||||
matches!(self, Maybe::Some(_))
|
||||
}
|
||||
}
|
||||
|
||||
/// Parse a string into an [`IndexUrl`], mapping the empty string to `None`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue