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

Git prompt hidden without --verbose flag #5107

Open
zanieb opened this issue Jul 16, 2024 · 8 comments
Open

Git prompt hidden without --verbose flag #5107

zanieb opened this issue Jul 16, 2024 · 8 comments
Labels
bug Something isn't working cli Related to the command line interface

Comments

@zanieb
Copy link
Member

zanieb commented Jul 16, 2024

The following command hung for a while:

❯ uv pip compile docs/requirements-insiders.in -o docs/requirements-insiders.txt --universal -p 3.12
Updating ssh://[email protected]/astral-sh/mkdocs-material-insiders.git (38c0b8187325c3bab386b666daf3518ac036f2f4)
The authenticity of host 'github.com (140.82.112.4)' can't be established.                                                            
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
Updating ssh://[email protected]/astral-sh/mkdocs-material-insiders.git (38c0b8187325c3bab386b666daf3518ac036f2f4)
⠹ Resolving dependencies...                                                                                             
              ^C

I cancelled it and re-ran with --verbose:

❯ uv pip compile docs/requirements-insiders.in -o docs/requirements-insiders.txt --universal -p 3.12 -v
DEBUG uv 0.2.23
DEBUG Starting Python discovery for Python 3.12
DEBUG Looking for exact match for request Python 3.12
DEBUG Searching for Python 3.12 in system path
DEBUG Found cpython 3.12.1 at `/Users/zb/workspace/uv/.venv/bin/python3` (virtual environment)
DEBUG Using Python 3.12.1 interpreter at .venv/bin/python3 for builds
DEBUG Using request timeout of 30s
DEBUG Fetching source distribution from Git: ssh://[email protected]/astral-sh/mkdocs-material-insiders.git
DEBUG Acquired lock for `ssh://github.com/astral-sh/mkdocs-material-insiders`
DEBUG Updating git source `Url { scheme: "ssh", cannot_be_a_base: false, username: "git", password: None, host: Some(Domain("github.com")), port: None, path: "/astral-sh/mkdocs-material-insiders.git", query: None, fragment: None }`
DEBUG Attempting GitHub fast path for: https://api.github.com/repos/astral-sh/mkdocs-material-insiders/commits/38c0b8187325c3bab386b666daf3518ac036f2f4
DEBUG failed to check github HTTP status client error (404 Not Found) for url (https://api.github.com/repos/astral-sh/mkdocs-material-insiders/commits/38c0b8187325c3bab386b666daf3518ac036f2f4)
DEBUG Performing a Git fetch for: ssh://[email protected]/astral-sh/mkdocs-material-insiders.git
The authenticity of host 'github.com (140.82.112.4)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? 

Then I could provide the information for the git prompt and move forward.

@zanieb zanieb added bug Something isn't working cli Related to the command line interface labels Jul 16, 2024
@charliermarsh
Copy link
Member

@ibraheemdev - Is this straightforward?

@zanieb
Copy link
Member Author

zanieb commented Jul 16, 2024

I don't see where we're gating this with the verbose flag with a casual look.

@charliermarsh
Copy link
Member

Not clear to me how this is appearing even with --verbose.

@zanieb
Copy link
Member Author

zanieb commented Jul 18, 2024

Yeah I was confused... haha. Tried to write a MRE but it just fails:

❯ cat ~/bin/git
#/usr/bin/env bash

echo "Content please"
read test

❯ uv pip install --no-cache "git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979"
Updating https://github.com/astral-test/uv-public-pypackage (0dacfd662c64cb4ceb16e6cf65a157a8b715b979)                                error: Git operation failed
  Caused by: process didn't exit successfully: `git init` (exit status: 1)
--- stdout
Content please

❯ uv pip install --no-cache "git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979" --verbose
DEBUG uv 0.2.26
DEBUG Searching for Python interpreter in system path
DEBUG Found cpython 3.12.3 at `/Users/zb/workspace/uv/.venv/bin/python3` (virtual environment)
DEBUG Using Python 3.12.3 environment at .venv/bin/python3
DEBUG Acquired lock for `.venv`
DEBUG At least one requirement is not satisfied: git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979
DEBUG Using request timeout of 30s
DEBUG Fetching source distribution from Git: https://github.com/astral-test/uv-public-pypackage
DEBUG Acquired lock for `https://github.com/astral-test/uv-public-pypackage`
DEBUG Updating git source `Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("github.com")), port: None, path: "/astral-test/uv-public-pypackage", query: None, fragment: None }`
error: Git operation failed
  Caused by: process didn't exit successfully: `git init` (exit status: 1)
--- stdout
Content please

@rhoboro
Copy link

rhoboro commented Oct 21, 2024

@zanieb @charliermarsh
Hi, I'm a big fan of uv! Thank you as always.

I have found the cause of this.
It seems that the tick of ResolverReporter is erasing the prompt for the git command.
Therefore, if this line is removed, no hang-up will occur.

root.enable_steady_tick(Duration::from_millis(200));

Could you fix this?
If you don't have time, please point me in the right direction and I'll try to create a PR.
( I am not an expert in Rust, so this may take some time 😅 )

@charliermarsh
Copy link
Member

charliermarsh commented Oct 21, 2024

Oh wow, that’s a great find and explains a lot!

@zanieb
Copy link
Member Author

zanieb commented Oct 21, 2024

@Viicos
Copy link
Contributor

Viicos commented Dec 17, 2024

I was hit by a similar issue when running:

uv pip install "git+https://github.com/typing/typing_extensions@main"

Note that the correct URL is https://github.com/python/typing_extensions. Without using the --verbose flag, I get the following output and it hangs forever:

Updating https://github.com/typing/typing_extensions (main)
Updating https://github.com/typing/typing_extensions (main)

Only when running in verbose mode, I get:

DEBUG failed to check github HTTP status client error (404 Not Found) for url (https://api.github.com/repos/typing/typing_extensions/commits/main)
DEBUG Performing a Git fetch for: https://github.com/typing/typing_extensions
Username for 'https://github.com':

I assume because the repo can't be found, uv delegates to the git CLI, and because the HTTPS URL was used, the git CLI will use HTTP auth (which is deprecated iirc, maybe it doesn't work anymore).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Related to the command line interface
Projects
None yet
Development

No branches or pull requests

4 participants