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

Remove (or ensure) git system requirement #4847

Open
wyattscarpenter opened this issue Jul 6, 2024 · 3 comments
Open

Remove (or ensure) git system requirement #4847

wyattscarpenter opened this issue Jul 6, 2024 · 3 comments
Labels
wish Not on the immediate roadmap

Comments

@wyattscarpenter
Copy link

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 using pip, you do not get git 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

$ pip install -U uv #this doesn't install git or anything.
# (I've omitted the output of this command for brevity.)

$ uv --version
uv 0.2.21 (ebfe6d8fc 2024-07-03)

$ echo "mypy\nblack @ git+https://github.com/psf/black" >requirements.txt

$ uv venv && uv pip install -r requirements.txt
Using Python 3.12.3 interpreter at: [redacted]
Creating virtualenv at: .venv
Activate with: .venv\Scripts\activate
Updating https://github.com/psf/black (HEAD)                                                                            error: Failed to download and build: `black @ git+https://github.com/psf/black`
  Caused by: Git operation failed
  Caused by: could not execute process `git init` (never executed)
  Caused by: program not found

$ uv venv && uv pip install -r requirements.txt #switching to a machine where git is installed and on the path, for comparison, and it works fine
Using Python 3.10.12 interpreter at: /usr/bin/python3
Creating virtualenv at: .venv
Activate with: source .venv/bin/activate
 Updated https://github.com/psf/black (7e2afc9)                                                                                                                                                                                              Resolved 9 packages in 29.34s
   Built black @ git+https://github.com/psf/black@7e2afc9bfdc4ec4bc3297aaa16a62d575249a5e0                                                                                                                                                   Downloaded 1 package in 7.92s
Installed 9 packages in 1m 40s
 + black==24.4.3.dev23+g7e2afc9 (from git+https://github.com/psf/black@7e2afc9bfdc4ec4bc3297aaa16a62d575249a5e0)
 + click==8.1.7
 + mypy==1.10.1
 + mypy-extensions==1.0.0
 + packaging==24.1
 + pathspec==0.12.1
 + platformdirs==4.2.2
 + tomli==2.0.1
 + typing-extensions==4.12.2
@FishAlchemist
Copy link
Contributor

I was under the impression that this PR(#3833) remove embedded Git support.
You should be able to understand the Git issue from the description of that PR.

@charliermarsh
Copy link
Member

We may eventually move to gitoxide if it grows to fit our needs, but otherwise this is sort of a non-goal right now.

@charliermarsh charliermarsh added the wish Not on the immediate roadmap label Jul 6, 2024
@zanieb
Copy link
Member

zanieb commented Jul 6, 2024

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.

@wyattscarpenter wyattscarpenter changed the title Remove git system requirement Remove (or ensure) git system requirement Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wish Not on the immediate roadmap
Projects
None yet
Development

No branches or pull requests

4 participants