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 get proper version from sdist after version 7.0 #735

Closed
djhoese opened this issue Jun 27, 2022 · 2 comments
Closed

Can't get proper version from sdist after version 7.0 #735

djhoese opened this issue Jun 27, 2022 · 2 comments

Comments

@djhoese
Copy link

djhoese commented Jun 27, 2022

My projects have been using setuptools-scm for some time now and have recently started breaking for users installing the sdist .tar.gz now that setuptools-scm 7.x is getting installed. Setuptools-scm seems to be overwriting the produced satpy/version.py when the wheel is built from the sdist during pip install. The wheel ends up with a version of 0.0 in the filename while the metadata in the sdist has 0.36.0. We use setuptools_scm_git_archive to pull the information from git tags.

Here is how I'm reproducing it:

conda create -y -n test_satpy_version python=3.9 setuptools pip build satpy
conda activate test_satpy_version
conda uninstall --force -y satpy

That's the base environment. Our package has a lot of C-based dependencies so it is easier to install from conda. If we download the most recent version from PyPI and build a wheel from it...

wget "https://files.pythonhosted.org/packages/78/63/fb97b0cc15c43058cc6c2942bd9a1deb89864800d7c5ae048633226fd096/satpy-0.36.0.tar.gz#sha256=f1c201f1d53dfda27856576461079eb9d78531e21ddc055baea20cb47f114107"
tar -xzf satpy-0.36.0.tar.gz
cd satpy-0.36.0

cat satpy/version.py
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = '0.36.0'
version_tuple = (0, 36, 0)

python -m build -w .
# ...
Successfully built satpy-0.0-py2.py3-none-any.whl

cat satpy/version.py
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = '0.0'
__version_tuple__ = version_tuple = (0, 0)

At first I thought it might be because of the hacky workaround we're using from #190 in our setup.py:

try:
    # HACK: https:/pypa/setuptools_scm/issues/190#issuecomment-351181286
    # Stop setuptools_scm from including all repository files
    import setuptools_scm.integration
    setuptools_scm.integration.find_files = lambda _: []
except ImportError:
    pass

but even if I remove that. commit the change, generate an sdist, untar the sdist, and run python -m build -w . for it I still get a wheel version of 0.0.

If I force the version of setuptools_scm in my pyproject.toml to 6.4.2 (the version before 7.x) then it works fine.

Any ideas what I'm missing?

@djhoese
Copy link
Author

djhoese commented Jun 27, 2022

Related #727

@djhoese
Copy link
Author

djhoese commented Jun 27, 2022

Ah looks like that fix hasn't been released yet. This looks like it is fixed when I install from github and run the command line version:

pip install git+https:/pypa/setuptools_scm.git

python -m setuptools_scm
/home/davidh/miniconda3/envs/test_satpy_version/lib/python3.9/site-packages/setuptools_scm/git.py:284: UserWarning: git archive did not support describe output
  warnings.warn("git archive did not support describe output")
0.36.1

And it left the satpy/version.py as it was. I'll close this for now and wait for the next release.

@djhoese djhoese closed this as completed Jun 27, 2022
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