swaroopch / edn_format

EDN reader and writer implementation in Python, using PLY (lex, yacc)
https://swaroopch.com/2012/12/24/edn-format-python/
Other
131 stars 31 forks source link

DeprecationWarnings with Python 3.7 #55

Closed dmajda closed 5 years ago

dmajda commented 5 years ago

When warnings are enabled, warnings like these are printed on importing edn_format with Python 3.7:

/Users/dmajda/tmp/warnings/edn_format/.venv/lib/python3.7/site-packages/edn_format/immutable_dict.py:7: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class ImmutableDict(collections.Mapping):
/Users/dmajda/tmp/warnings/edn_format/.venv/lib/python3.7/site-packages/edn_format/immutable_list.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class ImmutableList(collections.Sequence, collections.Hashable):
/Users/dmajda/tmp/warnings/edn_format/.venv/lib/python3.7/site-packages/edn_format/immutable_list.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class ImmutableList(collections.Sequence, collections.Hashable):

It would be good if edn_format was warning-free. In our specific case, the warnings pollute the test suite output.

Steps to reproduce

$ python3 --version
Python 3.7.0
$ python3 -m venv .venv
$ . .venv/bin/activate
$ pip3 install edn_format
[...]
$ python3 -Wall -c 'import edn_format'
/Users/dmajda/tmp/warnings/edn_format/.venv/lib/python3.7/site-packages/edn_format/immutable_dict.py:7: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class ImmutableDict(collections.Mapping):
/Users/dmajda/tmp/warnings/edn_format/.venv/lib/python3.7/site-packages/edn_format/immutable_list.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class ImmutableList(collections.Sequence, collections.Hashable):
/Users/dmajda/tmp/warnings/edn_format/.venv/lib/python3.7/site-packages/edn_format/immutable_list.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class ImmutableList(collections.Sequence, collections.Hashable):
swaroopch commented 5 years ago

@dmajda Version 0.6.2 is uploaded to PyPI.

dmajda commented 5 years ago

Thanks for a quick fix!