AndreaCensi / contracts

PyContracts is a Python package that allows to declare constraints on function parameters and return values. Contracts can be specified using Python3 annotations, or inside a docstring. PyContracts supports a basic type system, variables binding, arithmetic constraints, and has several specialized contracts and an extension API.
http://andreacensi.github.io/contracts/
Other
398 stars 62 forks source link

hello warrning due to deprecation #82

Open LucaPaterlini opened 5 years ago

LucaPaterlini commented 5 years ago

hello, those warnings are really ugly in my console (python3.7), my I ask you to update the import or to allow me to open a pull request for it?

Regards, LP

=============================== warnings summary =============================== /usr/local/lib/python3.7/dist-packages/past/types/oldstr.py:5 /usr/local/lib/python3.7/dist-packages/past/types/oldstr.py:5: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import Iterable

/usr/local/lib/python3.7/dist-packages/past/builtins/misc.py:4 /usr/local/lib/python3.7/dist-packages/past/builtins/misc.py:4: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import Mapping

/usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:19 /usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:19: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working m_new_contract('Container', ist(collections.Container))

/usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:23 /usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:23: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working m_new_contract('Hashable', ist(collections.Hashable))

/usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:27 /usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:27: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working m_new_contract('Iterator', ist(collections.Iterator))

/usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:28 /usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:28: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working m_new_contract('Sized', ist(collections.Sized))

/usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:29 /usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:29: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working m_new_contract('Callable', ist(collections.Callable))

/usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:30 /usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:30: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working m_new_contract('Sequence', ist(collections.Sequence))

/usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:31 /usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:31: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working m_new_contract('Set', ist(collections.Set))

/usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:32 /usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:32: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working m_new_contract('MutableSequence', ist(collections.MutableSequence))

/usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:33 /usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:33: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working m_new_contract('MutableSet', ist(collections.MutableSet))

/usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:35 /usr/local/lib/python3.7/dist-packages/contracts/library/miscellaneous_aliases.py:35: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working m_new_contract('MutableMapping', ist(collections.MutableMapping))

-- Docs: https://docs.pytest.org/en/latest/warnings.html

slorg1 commented 5 years ago

Hi,

It seems like this is a dupe of: https://github.com/AndreaCensi/contracts/issues/72

Thank you.

Best.