Open wyattscarpenter opened 3 months ago
I was under the impression that this PR(https://github.com/astral-sh/uv/pull/3833) remove embedded Git support. You should be able to understand the Git issue from the description of that PR.
We may eventually move to gitoxide if it grows to fit our needs, but otherwise this is sort of a non-goal right now.
Our git operations are definitely non-trivial too as we need to support resolving all sorts of references, various authentication schemes, and optimizations like sparse checkouts. Once a suitable library is available we could consider support again but the system git
client gives the most complete set of functionality.
I am confused about the README of uv saying
uv's Git implementation is based on Cargo.
and then cargo's README
Optional system libraries:
The build will automatically use vendored versions of the following libraries. However, if they are provided by the system and can be found with pkg-config, then the system libraries will be used instead:
libcurl — Used for network transfers. libgit2 — Used for fetching git dependencies. libssh2 — Used for SSH access to git repositories. libz (aka zlib) — Used for data compression. It is recommended to use the vendored versions as they are the versions that are tested to work with Cargo.
Thus I expected there would be no need to have git installed
We don't use libgit2 anymore, it doesn't support enough functionality. Originally, we copied much of Cargo's implementation though — Cargo can fallback to git if you ask it to.
As far as I can tell, Git is required to be installed on the host system in order for pip git sources to work. This is bad, from a software engineering perspective, because a program should not require other programs in order to work. It is also bad because when you install
uv
usingpip
, you do not getgit
as well (which would be another way of avoiding the dependency failure).This behavior is understandable, because pip also works like this, but unless using the git executable as pip would is crucial for compatibility reasons, I think uv should just support the git operations itself (and also, I guess, the Mercurial, Subversion, and Bazaar operations, detailed on https://pip.pypa.io/en/stable/topics/vcs-support/). As I understand it, the required operations are basically just downloading and unpacking the repo, so it shouldn't be that hard™.
Example