genomoncology / related

Nested Object Models in Python with dictionary, YAML, and JSON transformation support
MIT License
200 stars 15 forks source link

Not compatible with python 3.7 #15

Closed olfway closed 6 years ago

olfway commented 6 years ago

Hello!

I've tried to use related with python 3.7, and unfortunately it breaks in singledispatch package:

  File "sources/server.py", line 3, in <module>
    from related import from_yaml
  File "lib/python3.7/site-packages/related/__init__.py", line 43, in <module>
    from . import dispatchers  # noqa F401
  File "lib/python3.7/site-packages/related/dispatchers.py", line 43, in <module>
    @to_dict.register(TypedSequence)  # noqa F811
  File "lib/python3.7/site-packages/singledispatch.py", line 202, in <lambda>
    return lambda f: register(cls, f)
  File "lib/python3.7/site-packages/singledispatch.py", line 205, in register
    ns.cache_token = get_cache_token()
  File "lib/python3.7/site-packages/singledispatch_helpers.py", line 159, in get_cache_token
    return ABCMeta._abc_invalidation_counter
AttributeError: type object 'ABCMeta' has no attribute '_abc_invalidation_counter'

Is it really needed with modern python? homepage says "backports 3.4 functionality to python 2.6 - 3.3."

I've tried to replace from singledispatch import singledispatch with from functools import singledispatch

and it seems it works

imaurer commented 6 years ago

Thanks for the heads up.

imaurer commented 6 years ago

Bug fixed in master. Need to push up a new version of related.

imaurer commented 6 years ago
$ pipenv run python
Python 3.7.0 (default, Aug 25 2018, 16:20:34)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from related import from_yaml
>>>