mirror of
https://github.com/astral-sh/uv.git
synced 2025-12-06 18:06:54 +00:00
Fetch pyproject.toml from GitHub API (#10765)
## Summary When resolving Git metadata, we may be able to fetch the metadata from GitHub directly in some cases. This is _way_ faster, since we don't need to perform many Git operations and, in particular, don't need to clone the repo. This only works in the following cases: - The Git repository is public. Otherwise, I believe you need an access token, which we don't have. - The `pyproject.toml` has static metadata. - The `pyproject.toml` has no `tool.uv.sources`. Otherwise, we need to lower them... And, if there are any paths or workspace sources, that requires an install path (i.e., we need the content on-disk). - The project is in the repo root. If it's in a subdirectory, it could be a workspace member. And if it's a workspace member, there could be sources defined in the workspace root. But we can't know without fetching the workspace root -- and we need the workspace in order to find the root... Closes #10568.
This commit is contained in:
parent
b2d06f01cc
commit
5ee4cf6ff5
5 changed files with 254 additions and 30 deletions
|
|
@ -102,7 +102,7 @@ impl GitReference {
|
|||
}
|
||||
|
||||
/// Converts the [`GitReference`] to a `str` that can be used as a revision.
|
||||
pub(crate) fn as_rev(&self) -> &str {
|
||||
pub fn as_rev(&self) -> &str {
|
||||
match self {
|
||||
Self::Tag(rev) => rev,
|
||||
Self::Branch(rev) => rev,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue