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

Can't generate from GitHub commit #1585

Open
daveisfera opened this issue Feb 16, 2022 · 1 comment
Open

Can't generate from GitHub commit #1585

daveisfera opened this issue Feb 16, 2022 · 1 comment
Labels
bug Something is not working hashes Related to hashes generated via --generate-hashes vcs Related to VCS requirements

Comments

@daveisfera
Copy link

Trying to install from a GitHub commit with generate hashes but it's not working (see #700)

Environment Versions

  1. OS Type: Debian Bullseye
  2. Python version: 3.9.10
  3. pip version: 21.2.4
  4. pip-tools version: 6.4.0

Steps to replicate

  1. Add a URL for a GitHub commit to .in file (like https://github.com/jazzband/django-push-notifications/archive/6fde7302d7e85008b600a56b394a9f8841970e55.tar.gz#egg=django-push-notifications)
  2. Run pip-compile --generate-hashes
  3. Observe error output
      LookupError: setuptools-scm was unable to detect version for /tmp/pip-resolver-lk4h1q2s/django-push-notifications.
      
      Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.
      
      For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj

Expected result

Installs from a specific commit

Actual result

Gives above error

Other things I tried

I tried following the above advice with using git+https but then I get a warning about not being able to generate hashes (basically, these two errors are pointing at each other as the solution):

# WARNING: pip install will require the following package to be hashed.
# Consider using a hashable URL like https://github.com/jazzband/pip-tools/archive/SOMECOMMIT.zip
django-push-notifications @ git+https://github.com/jazzband/django-push-notifications@6fde730
@AndydeCleyre
Copy link
Contributor

This is indeed annoying. FWIW, not all packages will have that metadata problem, basically I think if they don't use setuptools-scm it will work with the archive form.

See also #994 and especially pypa/pip#6469.

@atugushev atugushev added bug Something is not working hashes Related to hashes generated via --generate-hashes vcs Related to VCS requirements labels Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working hashes Related to hashes generated via --generate-hashes vcs Related to VCS requirements
Projects
None yet
Development

No branches or pull requests

3 participants