greatscottgadgets / libgreat

a library to help you do Great things
BSD 3-Clause "New" or "Revised" License
31 stars 25 forks source link

build failing on newer python versions #27

Closed gozu42 closed 6 months ago

gozu42 commented 2 years ago

libgreat is not compatible with newer python versions.

greatfet/libgreat/host $ python setup.py build
WARNING: The wheel package is not available.
Traceback (most recent call last):
  File "/home/user/greatfet/libgreat/host/setup.py", line 24, in <module>
    setup(
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib64/python3.10/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 455, in __init__
    _Distribution.__init__(self, {
  File "/usr/lib64/python3.10/distutils/dist.py", line 292, in __init__
    self.finalize_options()
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 807, in finalize_options
    ep(self)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 814, in _finalize_setup_keywords
    ep.load()(self, ep.name, value)
  File "/home/user/greatfet/libgreat/host/.eggs/even_better_setuptools_git_version-1.0.7-py3.10.egg/even_better_setuptools_git_version.py", line 83, in validate_version_config
    if not isinstance(config, collections.Mapping):
AttributeError: module 'collections' has no attribute 'Mapping'
$ python -V
Python 3.10.0
$ cat /etc/fedora-release 
Fedora release 35 (Thirty Five)

it seems to be the change mentioned here:

Deprecated since version 3.3, will be removed in version 3.10: Moved Collections Abstract Base Classes to the collections.abc module.

googling for "python collections.Mapping removed" finds various other projects dealing with the issue, so probably a backwards-compatible way to change this can be found in one of them.

phillid commented 2 years ago

This appears to be a bug in ktemkin/even-better-setuptools-git-version which is used to setup/build libgreat.

FWIW, patching collections.Mapping to collections.abc.Mapping in the unpacked egg during the build at least unblocks me, but even-better-setup-tools-git-version seems like a bit of a hot potato perhaps. Or maybe I should view the chain of forks as testament to open source perseverance :smiley:

antoinevg commented 6 months ago

Fixed in https://github.com/greatscottgadgets/libgreat/pull/32