setuptools_scm: AttributeError: 'Version' object has no attribute 'release' after upgrade to 6.2.0

Related to #605 and #607.

I was just running a CI job to create wheels and sdist for the vispy project and it just picked up setuptools_scm 6.2.0 (released 16 minutes ago) and fails during sdist building. I noticed #607 says that modern setuptools should use pip. What is the recommended way to build an sdist package if not python setup.py sdist to avoid this error?

 Traceback (most recent call last):
  File "setup.py", line 150, in <module>
    'Framework :: IPython'
  File "/opt/hostedtoolcache/Python/3.7.11/x64/lib/python3.7/site-packages/setuptools/__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "/opt/hostedtoolcache/Python/3.7.11/x64/lib/python3.7/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/opt/hostedtoolcache/Python/3.7.11/x64/lib/python3.7/site-packages/setuptools/dist.py", line 426, in __init__
    k: v for k, v in attrs.items()
  File "/opt/hostedtoolcache/Python/3.7.11/x64/lib/python3.7/distutils/dist.py", line 292, in __init__
    self.finalize_options()
  File "/opt/hostedtoolcache/Python/3.7.11/x64/lib/python3.7/site-packages/setuptools/dist.py", line 717, in finalize_options
    ep(self)
  File "/opt/hostedtoolcache/Python/3.7.11/x64/lib/python3.7/site-packages/setuptools/dist.py", line 724, in _finalize_setup_keywords
    ep.load()(self, ep.name, value)
  File "/home/runner/work/vispy/vispy/.eggs/setuptools_scm-6.2.0-py3.7.egg/setuptools_scm/integration.py", line 29, in version_keyword
    dist.metadata.version = _get_version(config)
  File "/home/runner/work/vispy/vispy/.eggs/setuptools_scm-6.2.0-py3.7.egg/setuptools_scm/__init__.py", line 192, in _get_version
    template=config.write_to_template,
  File "/home/runner/work/vispy/vispy/.eggs/setuptools_scm-6.2.0-py3.7.egg/setuptools_scm/__init__.py", line 94, in dump_version
    version_fields = parsed_version.release
AttributeError: 'Version' object has no attribute 'release'

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@RonnyPfannschmidt Thanks again. I was able to get the correct non-yanked release installed and running without error using apt-get install python3-setuptools-scm

@ehashman that depends on your particular setup , depending on what it is, it may be a good idea to put build dependencies like pip/setuptools/setuptools_scm/wheel into layers using either pip or the system package manager

ar first glance it looks like on your case a pip based install may be fine, but i also suggest to update pip+setuptools first