go-macaroon-bakery / py-macaroon-bakery

Python code to implement the httpbakery conventions
GNU Lesser General Public License v3.0
9 stars 24 forks source link

Mapping import deprecation fix #77

Closed nicbus closed 5 years ago

nicbus commented 5 years ago

When running pytest on our project Lighter, which is using this library, with python 3.7 on Debian Buster we receive this warning:

/path/to/env/lib/python3.7/site-packages/macaroonbakery/checkers/_auth_context.py:6
  /path/to/env/lib/python3.7/site-packages/macaroonbakery/checkers/_auth_context.py:6: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working      
    class AuthContext(collections.Mapping):

As stated here:

Deprecated since version 3.3, will be removed in version 3.9: Moved Collections Abstract Base Classes to the collections.abc module. For backwards compatibility, they continue to be visible in this module through Python 3.8. collections.Mapping has been moved to collections.abc.Mapping, hence we're proposing a code change that should not break backwards compatibility.