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

--offline is not offline for "git+https" sources. #12234

Open
konstin opened this issue Mar 17, 2025 · 4 comments
Open

--offline is not offline for "git+https" sources. #12234

konstin opened this issue Mar 17, 2025 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Contribution especially encouraged

Comments

@konstin
Copy link
Member

konstin commented Mar 17, 2025

Originally posted by @andrei-korshikov in #942

I'm on uv 0.6.6 (c1a0bb8 2025-03-12). Some of my dependencies are git+https, e.g. I have

# /// script
# dependencies = [
#   "pycurl @ git+https://github.com/pycurl/pycurl.git",
#   ]
# ///

On every run of uv run --offline my_script.py I see Resolving dependencies... message and get these messages on stderr (and see corresponding traffic in Wireshark):

Updating https://github.com/pycurl/pycurl.git (HEAD)
Updated https://github.com/pycurl/pycurl.git (d92395d9fe1e18365c4e4812f4351bd6985872e1)

If this behaviour is intended, I think it should be documented. Documentation for --offline reads: "Disable network access. When disabled, uv will only use locally cached data and locally available files.", and as we see for "git+https" it is definitely not so.


Off-topic: and huge thank you for uv!:)

@konstin konstin added the bug Something isn't working label Mar 17, 2025
@charliermarsh
Copy link
Member

Yeah this seems like an oversight.

(As an aside, Updated https://github.com/pycurl/pycurl.git (d92395d9fe1e18365c4e4812f4351bd6985872e1) on its own does not always mean that we've made a network request. We show that even when checking out an already-available commit locally. But if the user is seeing Wireshark traffic then it does sound like a bug.)

@andrei-korshikov
Copy link

But if the user is seeing Wireshark traffic then it does sound like a bug.

Just for clarification. --offline without Internet access:

% uv run --offline --script sync.py
   Updating https://github.com/pycurl/pycurl.git (HEAD)
  × Failed to download and build `pycurl @ git+https://github.com/pycurl/pycurl.git`
  ├─▶ Git operation failed
  ├─▶ failed to fetch into: /home/korshikov/.cache/uv/git-v0/db/9a596e5213c3162d
  ╰─▶ process didn't exit successfully: `/usr/bin/git fetch --force --update-head-ok 'https://github.com/pycurl/pycurl.git' '+HEAD:refs/remotes/origin/HEAD'` (exit status: 128)
      --- stderr
      fatal: unable to access 'https://github.com/pycurl/pycurl.git/': Could not resolve host: github.com

@charliermarsh
Copy link
Member

charliermarsh commented Mar 17, 2025

I think we can set GIT_ALLOW_PROTOCOL=file (https://git-scm.com/docs/git)

@charliermarsh charliermarsh added good first issue Good for newcomers help wanted Contribution especially encouraged labels Mar 17, 2025
@thejchap
Copy link
Contributor

I'll take a look at this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Contribution especially encouraged
Projects
None yet
Development

No branches or pull requests

4 participants