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

v6.1.0 breaks setuptools_scm_git_archive — AttributeError: 'NoneType' object has no attribute 'version_cls' #615

Closed
sbraz opened this issue Aug 28, 2021 · 6 comments · Fixed by #616

Comments

@sbraz
Copy link
Contributor

sbraz commented Aug 28, 2021

HI,
I think a minor release should not break packages so I am creating a report here (I will also create one at https://github.com/Changaco/setuptools_scm_git_archive/).

Commit fbadf5b broke setuptools_scm_git_archive. Here is an example traceback:

/usr/local/lib/python3.9/site-packages/setuptools_scm/version.py:212: UserWarning: meta invoked without explicit configuration, will use defaults where required.
  warnings.warn(
Traceback (most recent call last):
  File "/pikepdf-2.16.1/setup.py", line 38, in <module>
    __version__ = get_version()
  File "/usr/local/lib/python3.9/site-packages/setuptools_scm/__init__.py", line 170, in get_version
    return _get_version(config)
  File "/usr/local/lib/python3.9/site-packages/setuptools_scm/__init__.py", line 174, in _get_version
    parsed_version = _do_parse(config)
  File "/usr/local/lib/python3.9/site-packages/setuptools_scm/__init__.py", line 127, in _do_parse
    version = _version_from_entrypoints(config) or _version_from_entrypoints(
  File "/usr/local/lib/python3.9/site-packages/setuptools_scm/__init__.py", line 65, in _version_from_entrypoints
    version = _call_entrypoint_fn(root, config, ep.load())
  File "/usr/local/lib/python3.9/site-packages/setuptools_scm/__init__.py", line 54, in _call_entrypoint_fn
    return fn(root)
  File "/usr/local/lib/python3.9/site-packages/setuptools_scm_git_archive/__init__.py", line 21, in parse
    return archival_to_version(data)
  File "/usr/local/lib/python3.9/site-packages/setuptools_scm_git_archive/__init__.py", line 15, in archival_to_version
    return meta(versions[0])
  File "/usr/local/lib/python3.9/site-packages/setuptools_scm/version.py", line 216, in meta
    parsed_version = _parse_tag(tag, preformatted, config)
  File "/usr/local/lib/python3.9/site-packages/setuptools_scm/version.py", line 195, in _parse_tag
    version_cls = config.version_cls or VERSION_CLASS
AttributeError: 'NoneType' object has no attribute 'version_cls'

This can be easily reproduced with this Dockerfile:

FROM python:3.9
RUN wget -nv https://github.com/pikepdf/pikepdf/archive/v2.16.1.tar.gz
RUN tar xf v2.16.1.tar.gz
WORKDIR pikepdf-2.16.1

RUN pip3 install setuptools_scm_git_archive
# Bad 
RUN pip3 install git+https://github.com/pypa/setuptools_scm@fbadf5b060cdd7ec1fb3d29d885868b7b756497c

# The parent commit was still good
#RUN pip3 install git+https://github.com/pypa/setuptools_scm@b8451688b9cb295136c0154c7c59c25a9d88f844

RUN python setup.py --version
@RonnyPfannschmidt
Copy link
Contributor

thanks for the note, the version has been pulled as it showed a number of other bugs/regressions around setuptools itself

its a bug nonetheless

@sbraz
Copy link
Contributor Author

sbraz commented Aug 28, 2021

Thanks for the reply. Yes, I noticed that both 6.1.0 and 6.2.0 were missing from PyPI and we at Gentoo have already blocked 6.2.0 entirely because of the setuptools_scm[tom] breakage, maybe we should do the same with 6.1.0.

@RonnyPfannschmidt
Copy link
Contributor

@sbraz yes, please block them

the next release will include 3 bugfixes

  • adding the extra again
  • ensuring we break on outdated/broken setuptools
  • allowing to pass none as config

gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Aug 29, 2021
Upstream confirms that both versions have several bugs and have been
pulled off PyPI:
pypa/setuptools-scm#615 (comment)

This also lifts the version restriction added to
dev-python/setuptools_scm_git_archive in
e313b12
since the problematic version is now masked.

Bug: https://bugs.gentoo.org/810808
Signed-off-by: Louis Sautier <[email protected]>
RonnyPfannschmidt added a commit to RonnyPfannschmidt/setuptools_scm that referenced this issue Aug 29, 2021
* fix pypa#612: depend on packaging to ensure version parsing parts
* fix pypa#611: correct the typo that hid away the toml extra and add it in ``setup.py`` as well
* fix pypa#615: restore support for the git_archive plugin which doesn't pass over the config
@mgorny
Copy link
Contributor

mgorny commented Aug 30, 2021

Could you please consider removing the two newest releases from pypi? Right now random packages are forcing <6.1.0 (in various ways), and cleaning this up after the next release is going to be painful.

@RonnyPfannschmidt
Copy link
Contributor

They are yanked

@jasonmlkang
Copy link

FYI, mine is fixed after updating pip to the latest version.

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