From 8d93fe93755d1bf052ffff649bd7d010f3bb0fc0 Mon Sep 17 00:00:00 2001 From: Mariatta Wijaya Date: Tue, 12 Feb 2019 09:52:30 -0800 Subject: [PATCH 1/5] Make it compatible with Python 3.7+ --- .travis.yml | 8 ++++++++ tox.ini | 3 +++ uritemplate/orderedset.py | 6 +++--- uritemplate/variable.py | 6 +++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ea6648d..f6d0206 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,14 @@ matrix: env: TOXENV=py35 - python: 3.6 env: TOXENV=py36 + - python: 3.7 + dist: xenial + env: TOXENV=py37 + - python: 3.7-dev + dist: xenial + env: TOXENV=py37dev + - python: nightly + dist: xenial - env: TOXENV=pep8 install: diff --git a/tox.ini b/tox.ini index 7bd6405..e8e8668 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,9 @@ envlist = py34, py35, py36, + py37, + py37dev, + nightly, pep8, [testenv] diff --git a/uritemplate/orderedset.py b/uritemplate/orderedset.py index f21c9cb..700f06a 100644 --- a/uritemplate/orderedset.py +++ b/uritemplate/orderedset.py @@ -3,16 +3,16 @@ from weakref import proxy try: - import collections.abc as collections_abc + from collections.abc import MutableSet except ImportError: - import collections as collections_abc + from collections import MutableSet class Link(object): __slots__ = 'prev', 'next', 'key', '__weakref__' -class OrderedSet(collections_abc.MutableSet): +class OrderedSet(MutableSet): 'Set the remembers the order elements were added' # Big-O running times for all methods are the same as for regular sets. # The internal self.__map dictionary maps keys to links in a doubly linked diff --git a/uritemplate/variable.py b/uritemplate/variable.py index a3bd4ce..2504ca5 100644 --- a/uritemplate/variable.py +++ b/uritemplate/variable.py @@ -18,9 +18,9 @@ import sys try: - import collections.abc as collections_abc + from collections.abc import MutableMapping except ImportError: - import collections as collections_abc + from collections import MutableMapping if sys.version_info.major == 2: import urllib @@ -364,7 +364,7 @@ def list_test(value): def dict_test(value): - return isinstance(value, (dict, collections_abc.MutableMapping)) + return isinstance(value, (dict, MutableMapping)) try: From 39cc66250f06c2d6da81d86ac8babb0e480fbaa7 Mon Sep 17 00:00:00 2001 From: Mariatta Date: Tue, 12 Feb 2019 10:04:50 -0800 Subject: [PATCH 2/5] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index f6d0206..3435be8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ matrix: env: TOXENV=py37dev - python: nightly dist: xenial + env: TOXENV=nightly - env: TOXENV=pep8 install: From 3e13540ccc4705c4e1881c5c77fc0c8406b20cfa Mon Sep 17 00:00:00 2001 From: Mariatta Date: Tue, 12 Feb 2019 10:10:11 -0800 Subject: [PATCH 3/5] Update AUTHORS.rst --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 2581f4d..d7a8e31 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -13,3 +13,4 @@ Contributors - Philippe Ombredanne - Thierry Bastian - Thomas Grainger +- Mariatta From 7884b1650edf61ea921649a6d090cd34dc74f0cc Mon Sep 17 00:00:00 2001 From: Mariatta Date: Tue, 12 Feb 2019 16:04:43 -0800 Subject: [PATCH 4/5] Update orderedset.py --- uritemplate/orderedset.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uritemplate/orderedset.py b/uritemplate/orderedset.py index 700f06a..f21c9cb 100644 --- a/uritemplate/orderedset.py +++ b/uritemplate/orderedset.py @@ -3,16 +3,16 @@ from weakref import proxy try: - from collections.abc import MutableSet + import collections.abc as collections_abc except ImportError: - from collections import MutableSet + import collections as collections_abc class Link(object): __slots__ = 'prev', 'next', 'key', '__weakref__' -class OrderedSet(MutableSet): +class OrderedSet(collections_abc.MutableSet): 'Set the remembers the order elements were added' # Big-O running times for all methods are the same as for regular sets. # The internal self.__map dictionary maps keys to links in a doubly linked From c1763f811d640b28520fc5cdb8495bf60e4dee85 Mon Sep 17 00:00:00 2001 From: Mariatta Date: Tue, 12 Feb 2019 16:05:47 -0800 Subject: [PATCH 5/5] Update variable.py --- uritemplate/variable.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uritemplate/variable.py b/uritemplate/variable.py index 2504ca5..a3bd4ce 100644 --- a/uritemplate/variable.py +++ b/uritemplate/variable.py @@ -18,9 +18,9 @@ import sys try: - from collections.abc import MutableMapping + import collections.abc as collections_abc except ImportError: - from collections import MutableMapping + import collections as collections_abc if sys.version_info.major == 2: import urllib @@ -364,7 +364,7 @@ def list_test(value): def dict_test(value): - return isinstance(value, (dict, MutableMapping)) + return isinstance(value, (dict, collections_abc.MutableMapping)) try: