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

setuptools_scm >= 7 source distributions (sdist) install as version 0.0 #742

Closed
jbarlow83 opened this issue Jul 5, 2022 · 0 comments
Closed

Comments

@jbarlow83
Copy link

jbarlow83 commented Jul 5, 2022

Any sdist tarball produced by setuptools_scm >= 7 configured to replace setuptools_scm_git_archive, without writing a _version.py file... will end up installed as version 0.0.

To reproduce:

  • download the attached archive - a minimal Git repo in a tarball
  • extract archive
  • confirm that git describe reports version 2.0.0
  • note that .git-archival.txt and .gitattributes are present in the documented formats
  • python -m setuptools_scm reports version 2.0.0
  • create a sdist (e.g. python -m build --sdist or python setup.py sdist, doesn't matter which is used)
  • create and activate virtual environment python -m venv v
  • install sdist to virtual environment pip install dist/setuptools_scm_sdist-2.0.0.tar.gz
  • "Successfully installed setuptools-scm-sdist-0.0"
  • python3 -c "import setuptools_scm_sdist" returns 0.0 (it just uses importlib.metadata to look up its installed version and prints it)

I included the whole Git repo in case some feature of the Git repository itself is responsible.

It does not matter if setup.py is just setup() or setup(use_scm_version=True...).

Inspecting the sdist tarballs shows PKG-INFO correct but no substitutions are made in .git_archival.txt.

Using "git archive" to manually create a tarball does produce the expected substitutions.

Versions: setuptools_scm 7.0.4, setuptools 63.1.0, Python 3.9.13, git 2.32.0
setuptools_scm_sdist.tar.gz

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

No branches or pull requests

1 participant