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

[fix] add fallback_version to scm settings #981

Merged
merged 1 commit into from
May 8, 2022
Merged

Conversation

areski
Copy link
Contributor

@areski areski commented Apr 29, 2022

Description

setuptools_scm [https://pypi.org/project/setuptools-scm/] is causing issues if you are trying to install this package directly from a zip or tar.gz.
That is expected as there is no metadata in the archive file, and the following error will raise:

      LookupError: setuptools-scm was unable to detect version for /tmp/pip-req-build-plm5aze3.

This is probably not affecting a lot of people but there is situation where it's not possible to use git to install the package, or wait for the latest version to be on pypi.

Alternative solutions

Related Issue

ref: #960 (comment)
ref: pypa/setuptools-scm#409

Proposed Solution

A quick workaround is using fallback_version see attached PR,
there is certainly more elegant solution, hopefully one that could still use the latest tag.

@codecov
Copy link

codecov bot commented Apr 29, 2022

Codecov Report

Merging #981 (c9fa8cf) into master (720fd8a) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #981   +/-   ##
=======================================
  Coverage   97.64%   97.64%           
=======================================
  Files          23       23           
  Lines        1147     1147           
  Branches      222      222           
=======================================
  Hits         1120     1120           
  Misses         12       12           
  Partials       15       15           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 720fd8a...c9fa8cf. Read the comment docs.

@jeking3
Copy link
Contributor

jeking3 commented May 8, 2022

As a workaround you can use the following requirements.txt syntax to pull a hash directly from GitHub:

django-simple-history @ git+https://github.com/jazzband/django-simple-history@<GIT HASH, BRANCH, OR TAG>#egg=django-simple-history-3.1.1+

@jeking3 jeking3 merged commit 106266f into jazzband:master May 8, 2022
@areski
Copy link
Contributor Author

areski commented May 9, 2022

Thanks for the merge and the hint, unfortunately I cannot use Git in my , only tar.gz or zip.
Thanks anyway :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants