From 1f546efd77446fd9616e7ad93e371dc1c2cf22fd Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 22 Nov 2016 15:39:28 +0000 Subject: Point to the new PyPI name --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 2780d7b..6e4ea38 100644 --- a/README.rst +++ b/README.rst @@ -48,7 +48,7 @@ Installing :: - pip install uritemplate.py + pip install uritemplate License ------- -- cgit v1.2.3 From 9c9485fe3db3505bad912efe093113bf98ed214c Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sat, 28 Jan 2017 11:18:44 -0800 Subject: Test against Python 3.6 on Travis --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index b7c9b48..c4783f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,8 @@ matrix: env: TOXENV=py34 - python: 3.5 env: TOXENV=py35 + - python: 3.6 + env: TOXENV=py36 - env: TOXENV=pep8 install: -- cgit v1.2.3 From 1555ffebc1be2055e2bf7b4a0afe638113b59ae2 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sat, 28 Jan 2017 11:19:04 -0800 Subject: Test against Python 3.6 --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 9d86da0..a1d7cc4 100644 --- a/tox.ini +++ b/tox.ini @@ -6,6 +6,7 @@ envlist = py33, py34, py35, + py36, pep8, [testenv] -- cgit v1.2.3 From 0a78fbd582d66e5b53282d2f37e129501e0e47a4 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sat, 28 Jan 2017 11:19:32 -0800 Subject: List Python 3.6 as supported --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 59f03ba..7f37118 100644 --- a/setup.py +++ b/setup.py @@ -34,6 +34,7 @@ setup( 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: Implementation :: CPython', ], ) -- cgit v1.2.3 From d22480684878f707b0193943d8ed8e441729cbea Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Fri, 7 Apr 2017 14:07:44 +0200 Subject: Fixed deprecation warnings in python 3.6.1 --- uritemplate/template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uritemplate/template.py b/uritemplate/template.py index c9d7c7e..ceca8eb 100644 --- a/uritemplate/template.py +++ b/uritemplate/template.py @@ -18,7 +18,7 @@ What do you do? import re from uritemplate.variable import URIVariable -template_re = re.compile('{([^\}]+)}') +template_re = re.compile('{([^}]+)}') def _merge(var_dict, overrides): -- cgit v1.2.3 From 942d0b8a66fdae9c1e4c6e087a330122beecd3f4 Mon Sep 17 00:00:00 2001 From: Ian Stapleton Cordasco Date: Sat, 8 Jul 2017 17:15:24 -0500 Subject: Add .mailmap to map old name to new name --- .mailmap | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .mailmap diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000..6f9a0eb --- /dev/null +++ b/.mailmap @@ -0,0 +1,2 @@ +Ian Stapleton Cordasco Ian Cordasco +Ian Stapleton Cordasco Ian Cordasco -- cgit v1.2.3 From 6eaef88a8309e6a913872d07b6bea421c6960713 Mon Sep 17 00:00:00 2001 From: Ian Stapleton Cordasco Date: Wed, 26 Jul 2017 06:51:25 -0500 Subject: Update project for new organization home Update AUTHORS.rst with names of contributors thus far and fix-up my name in some places. Further, include both licenses in our packaging. --- AUTHORS.rst | 13 ++++++++++++- README.rst | 11 +++++------ setup.py | 5 +++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 55848f0..2581f4d 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -1,4 +1,15 @@ Development Lead ---------------- -- Ian Cordasco +- Ian Stapleton Cordasco + +Contributors +------------ + +- Brett Cannon +- Daniel Imhoff +- Eugene Eeo +- Jeff Potter +- Philippe Ombredanne +- Thierry Bastian +- Thomas Grainger diff --git a/README.rst b/README.rst index 6e4ea38..2c9d98d 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ uritemplate =========== -Documentation_ -- GitHub_ -- BitBucket_ -- Travis-CI_ +Documentation_ -- GitHub_ -- Travis-CI_ Simple python library to deal with `URI Templates`_. The API looks like @@ -56,9 +56,8 @@ License Modified BSD license_ -.. _Documentation: http://uritemplate.rtfd.org/ -.. _GitHub: https://github.com/sigmavirus24/uritemplate -.. _BitBucket: https://bitbucket.org/icordasc/uritemplate -.. _Travis-CI: https://travis-ci.org/sigmavirus24/uritemplate +.. _Documentation: https://uritemplate.readthedocs.io/ +.. _GitHub: https://github.com/python-hyper/uritemplate +.. _Travis-CI: https://travis-ci.org/python-hyper/uritemplate .. _URI Templates: http://tools.ietf.org/html/rfc6570 -.. _license: https://github.com/sigmavirus24/uritemplate/blob/master/LICENSE +.. _license: https://github.com/python-hyper/uritemplate/blob/master/LICENSE diff --git a/setup.py b/setup.py index 7f37118..210576a 100644 --- a/setup.py +++ b/setup.py @@ -13,11 +13,12 @@ setup( long_description="\n\n".join([open("README.rst").read(), open("HISTORY.rst").read()]), license="BSD 3-Clause License or Apache License, Version 2.0", - author="Ian Cordasco", + author="Ian Stapleton Cordasco", author_email="graffatcolmingov@gmail.com", url="https://uritemplate.readthedocs.org", packages=packages, - package_data={'': ['LICENSE', 'AUTHORS.rst']}, + package_data={'': ['LICENSE', 'LICENSE.APACHE', 'LICENSE.BSD', + 'AUTHORS.rst']}, include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', -- cgit v1.2.3 From d4ce8c74cef9dd8ef246b3ce5689fc488c511834 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 6 Sep 2018 16:49:51 +0300 Subject: Fix pep8 --- tests/test_uritemplate.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/test_uritemplate.py b/tests/test_uritemplate.py index b1abc96..7448be0 100644 --- a/tests/test_uritemplate.py +++ b/tests/test_uritemplate.py @@ -544,24 +544,24 @@ class TestURIVariable(TestCase): class TestVariableModule(TestCase): def test_is_list_of_tuples(self): - l = [(1, 2), (3, 4)] - self.assertEqual(variable.is_list_of_tuples(l), (True, l)) + a_list = [(1, 2), (3, 4)] + self.assertEqual(variable.is_list_of_tuples(a_list), (True, a_list)) - l = [1, 2, 3, 4] - self.assertEqual(variable.is_list_of_tuples(l), (False, None)) + a_list = [1, 2, 3, 4] + self.assertEqual(variable.is_list_of_tuples(a_list), (False, None)) def test_list_test(self): - l = [1, 2, 3, 4] - self.assertEqual(variable.list_test(l), True) + a_list = [1, 2, 3, 4] + self.assertEqual(variable.list_test(a_list), True) - l = str([1, 2, 3, 4]) - self.assertEqual(variable.list_test(l), False) + a_list = str([1, 2, 3, 4]) + self.assertEqual(variable.list_test(a_list), False) def test_list_of_tuples_test(self): - l = [(1, 2), (3, 4)] - self.assertEqual(variable.dict_test(l), False) + a_list = [(1, 2), (3, 4)] + self.assertEqual(variable.dict_test(a_list), False) - d = dict(l) + d = dict(a_list) self.assertEqual(variable.dict_test(d), True) -- cgit v1.2.3 From becb8d266366edbcaf204ebaa7bbef6cf82e4d86 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 6 Sep 2018 16:56:39 +0300 Subject: Drop support for EOL Python --- .travis.yml | 4 ---- old/uritemplate.py/uritemplatepy-setup.py | 5 ++--- setup.py | 4 +--- tox.ini | 3 --- uritemplate/variable.py | 4 ++-- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index c4783f4..ea6648d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,8 @@ sudo: false matrix: include: - - python: 2.6 - env: TOXENV=py26 - python: 2.7 env: TOXENV=py27 - - python: 3.3 - env: TOXENV=py33 - python: 3.4 env: TOXENV=py34 - python: 3.5 diff --git a/old/uritemplate.py/uritemplatepy-setup.py b/old/uritemplate.py/uritemplatepy-setup.py index 430d519..ebececb 100644 --- a/old/uritemplate.py/uritemplatepy-setup.py +++ b/old/uritemplate.py/uritemplatepy-setup.py @@ -11,6 +11,7 @@ setup( author_email="graffatcolmingov@gmail.com", url="https://uritemplate.readthedocs.org", install_requires=["uritemplate>=2.0"], + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', @@ -19,13 +20,11 @@ setup( 'Intended Audience :: Developers', 'Programming Language :: Python', 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: Implementation :: CPython', ], ) diff --git a/setup.py b/setup.py index 210576a..cae605c 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,7 @@ setup( package_data={'': ['LICENSE', 'LICENSE.APACHE', 'LICENSE.BSD', 'AUTHORS.rst']}, include_package_data=True, + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', @@ -28,11 +29,8 @@ setup( 'Intended Audience :: Developers', 'Programming Language :: Python', 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', diff --git a/tox.ini b/tox.ini index a1d7cc4..7bd6405 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,6 @@ [tox] envlist = - py26, py27, - py32, - py33, py34, py35, py36, diff --git a/uritemplate/variable.py b/uritemplate/variable.py index 1842830..7fb02ff 100644 --- a/uritemplate/variable.py +++ b/uritemplate/variable.py @@ -18,9 +18,9 @@ What do you do? import collections import sys -if (2, 6) <= sys.version_info < (2, 8): +if sys.version_info.major == 2: import urllib -elif (3, 3) <= sys.version_info < (4, 0): +elif sys.version_info.major == 3: import urllib.parse as urllib -- cgit v1.2.3 From 910f60597444da9b9ffc680f73050f6d67083403 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 6 Sep 2018 16:59:32 +0300 Subject: Upgrade Python syntax with pyupgrade https://github.com/asottile/pyupgrade --- tests/test_from_fixtures.py | 2 +- uritemplate/variable.py | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/test_from_fixtures.py b/tests/test_from_fixtures.py index 70d6553..c21d395 100644 --- a/tests/test_from_fixtures.py +++ b/tests/test_from_fixtures.py @@ -20,7 +20,7 @@ def load_examples(filename): def expected_set(expected): if isinstance(expected, list): return set(expected) - return set([expected]) + return {expected} class FixtureMixin(object): diff --git a/uritemplate/variable.py b/uritemplate/variable.py index 7fb02ff..0d2e695 100644 --- a/uritemplate/variable.py +++ b/uritemplate/variable.py @@ -149,11 +149,11 @@ class URIVariable(object): return None if explode: return self.join_str.join( - '%s=%s' % (name, quote(v, safe)) for v in value + '{}={}'.format(name, quote(v, safe)) for v in value ) else: value = ','.join(quote(v, safe) for v in value) - return '%s=%s' % (name, value) + return '{}={}'.format(name, value) if dict_test(value) or tuples: if not value: @@ -161,21 +161,21 @@ class URIVariable(object): items = items or sorted(value.items()) if explode: return self.join_str.join( - '%s=%s' % ( + '{}={}'.format( quote(k, safe), quote(v, safe) ) for k, v in items ) else: value = ','.join( - '%s,%s' % ( + '{},{}'.format( quote(k, safe), quote(v, safe) ) for k, v in items ) - return '%s=%s' % (name, value) + return '{}={}'.format(name, value) if value: value = value[:prefix] if prefix else value - return '%s=%s' % (name, quote(value, safe)) + return '{}={}'.format(name, quote(value, safe)) return name + '=' def _label_path_expansion(self, name, value, explode, prefix): @@ -234,35 +234,35 @@ class URIVariable(object): if list_test(value) and not tuples: if explode: expanded = join_str.join( - '%s=%s' % ( + '{}={}'.format( name, quote(v, safe) ) for v in value if v is not None ) return expanded if expanded else None else: value = ','.join(quote(v, safe) for v in value) - return '%s=%s' % (name, value) + return '{}={}'.format(name, value) if dict_test(value) or tuples: items = items or sorted(value.items()) if explode: return join_str.join( - '%s=%s' % ( + '{}={}'.format( quote(k, safe), quote(v, safe) ) for k, v in items if v is not None ) else: expanded = ','.join( - '%s,%s' % ( + '{},{}'.format( quote(k, safe), quote(v, safe) ) for k, v in items if v is not None ) - return '%s=%s' % (name, expanded) + return '{}={}'.format(name, expanded) value = value[:prefix] if prefix else value if value: - return '%s=%s' % (name, quote(value, safe)) + return '{}={}'.format(name, quote(value, safe)) return name -- cgit v1.2.3 From 12c9fdf6cc413d2b227302181d20456361d94e3b Mon Sep 17 00:00:00 2001 From: Lee Skillen Date: Wed, 31 Jan 2018 16:21:43 +0000 Subject: Make variable ordering deterministic --- uritemplate/api.py | 4 ++- uritemplate/orderedset.py | 83 +++++++++++++++++++++++++++++++++++++++++++++++ uritemplate/template.py | 6 ++-- 3 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 uritemplate/orderedset.py diff --git a/uritemplate/api.py b/uritemplate/api.py index 37c7c45..5ad2815 100644 --- a/uritemplate/api.py +++ b/uritemplate/api.py @@ -6,6 +6,8 @@ uritemplate.api This module contains the very simple API provided by uritemplate. """ + +from uritemplate.orderedset import OrderedSet from uritemplate.template import URITemplate @@ -68,4 +70,4 @@ def variables(uri): # => {'username', 'repository'} """ - return set(URITemplate(uri).variable_names) + return OrderedSet(URITemplate(uri).variable_names) diff --git a/uritemplate/orderedset.py b/uritemplate/orderedset.py new file mode 100644 index 0000000..94f4733 --- /dev/null +++ b/uritemplate/orderedset.py @@ -0,0 +1,83 @@ +# From: https://github.com/ActiveState/code/blob/master/recipes/Python/576696_OrderedSet_with_Weakrefs/ + +import collections +from weakref import proxy + +class Link(object): + __slots__ = 'prev', 'next', 'key', '__weakref__' + +class OrderedSet(collections.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 list. + # The circular doubly linked list starts and ends with a sentinel element. + # The sentinel element never gets deleted (this simplifies the algorithm). + # The prev/next links are weakref proxies (to prevent circular references). + # Individual links are kept alive by the hard reference in self.__map. + # Those hard references disappear when a key is deleted from an OrderedSet. + + def __init__(self, iterable=None): + self.__root = root = Link() # sentinel node for doubly linked list + root.prev = root.next = root + self.__map = {} # key --> link + if iterable is not None: + self |= iterable + + def __len__(self): + return len(self.__map) + + def __contains__(self, key): + return key in self.__map + + def add(self, key): + # Store new key in a new link at the end of the linked list + if key not in self.__map: + self.__map[key] = link = Link() + root = self.__root + last = root.prev + link.prev, link.next, link.key = last, root, key + last.next = root.prev = proxy(link) + + def discard(self, key): + # Remove an existing item using self.__map to find the link which is + # then removed by updating the links in the predecessor and successors. + if key in self.__map: + link = self.__map.pop(key) + link.prev.next = link.next + link.next.prev = link.prev + + def __iter__(self): + # Traverse the linked list in order. + root = self.__root + curr = root.next + while curr is not root: + yield curr.key + curr = curr.next + + def __reversed__(self): + # Traverse the linked list in reverse order. + root = self.__root + curr = root.prev + while curr is not root: + yield curr.key + curr = curr.prev + + def pop(self, last=True): + if not self: + raise KeyError('set is empty') + key = next(reversed(self)) if last else next(iter(self)) + self.discard(key) + return key + + def __repr__(self): + if not self: + return '%s()' % (self.__class__.__name__,) + return '%s(%r)' % (self.__class__.__name__, list(self)) + + def __str__(self): + return self.__repr__() + + def __eq__(self, other): + if isinstance(other, OrderedSet): + return len(self) == len(other) and list(self) == list(other) + return not self.isdisjoint(other) diff --git a/uritemplate/template.py b/uritemplate/template.py index ceca8eb..0df0da6 100644 --- a/uritemplate/template.py +++ b/uritemplate/template.py @@ -16,6 +16,7 @@ What do you do? """ import re +from uritemplate.orderedset import OrderedSet from uritemplate.variable import URIVariable template_re = re.compile('{([^}]+)}') @@ -71,9 +72,10 @@ class URITemplate(object): URIVariable(m.groups()[0]) for m in template_re.finditer(self.uri) ] #: A set of variable names in the URI. - self.variable_names = set() + self.variable_names = OrderedSet() for variable in self.variables: - self.variable_names.update(variable.variable_names) + for name in variable.variable_names: + self.variable_names.add(name) def __repr__(self): return 'URITemplate("%s")' % self -- cgit v1.2.3 From 0823f1131022d1bdf89a083dbe060fe110ea6cd6 Mon Sep 17 00:00:00 2001 From: Lee Skillen Date: Wed, 31 Jan 2018 16:36:16 +0000 Subject: Fix pep8 complaints --- uritemplate/orderedset.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/uritemplate/orderedset.py b/uritemplate/orderedset.py index 94f4733..7a9d33e 100644 --- a/uritemplate/orderedset.py +++ b/uritemplate/orderedset.py @@ -1,25 +1,28 @@ -# From: https://github.com/ActiveState/code/blob/master/recipes/Python/576696_OrderedSet_with_Weakrefs/ +# From: https://github.com/ActiveState/code/blob/master/recipes/Python/576696_OrderedSet_with_Weakrefs/ # noqa import collections from weakref import proxy + class Link(object): __slots__ = 'prev', 'next', 'key', '__weakref__' + class OrderedSet(collections.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 list. - # The circular doubly linked list starts and ends with a sentinel element. - # The sentinel element never gets deleted (this simplifies the algorithm). - # The prev/next links are weakref proxies (to prevent circular references). - # Individual links are kept alive by the hard reference in self.__map. - # Those hard references disappear when a key is deleted from an OrderedSet. + # The internal self.__map dictionary maps keys to links in a doubly linked + # list. The circular doubly linked list starts and ends with a sentinel + # element. The sentinel element never gets deleted (this simplifies the + # algorithm). The prev/next links are weakref proxies (to prevent circular + # references). Individual links are kept alive by the hard reference in + # self.__map. Those hard references disappear when a key is deleted from + # an OrderedSet. def __init__(self, iterable=None): - self.__root = root = Link() # sentinel node for doubly linked list + self.__root = root = Link() # sentinel node for doubly linked list root.prev = root.next = root - self.__map = {} # key --> link + self.__map = {} # key --> link if iterable is not None: self |= iterable -- cgit v1.2.3 From 255c70115059c0d3347f6fbe3776031d4a52d009 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Mon, 29 Oct 2018 19:50:49 +0000 Subject: Import ABCs from collections.abc if possible Quoting Python 3.7's DeprecationWarning: "Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working" --- uritemplate/orderedset.py | 8 ++++++-- uritemplate/variable.py | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/uritemplate/orderedset.py b/uritemplate/orderedset.py index 7a9d33e..f21c9cb 100644 --- a/uritemplate/orderedset.py +++ b/uritemplate/orderedset.py @@ -1,14 +1,18 @@ # From: https://github.com/ActiveState/code/blob/master/recipes/Python/576696_OrderedSet_with_Weakrefs/ # noqa -import collections from weakref import proxy +try: + import collections.abc as collections_abc +except ImportError: + import collections as collections_abc + class Link(object): __slots__ = 'prev', 'next', 'key', '__weakref__' -class OrderedSet(collections.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 diff --git a/uritemplate/variable.py b/uritemplate/variable.py index 0d2e695..a3bd4ce 100644 --- a/uritemplate/variable.py +++ b/uritemplate/variable.py @@ -15,9 +15,13 @@ What do you do? """ -import collections import sys +try: + import collections.abc as collections_abc +except ImportError: + import collections as collections_abc + if sys.version_info.major == 2: import urllib elif sys.version_info.major == 3: @@ -360,7 +364,7 @@ def list_test(value): def dict_test(value): - return isinstance(value, (dict, collections.MutableMapping)) + return isinstance(value, (dict, collections_abc.MutableMapping)) try: -- cgit v1.2.3 From 21afcf2c35f21034124a230abebd1157cbee8265 Mon Sep 17 00:00:00 2001 From: Tommy Yu Date: Thu, 11 Jul 2019 22:21:14 +1200 Subject: Tests covering current correct behaviors. --- tests/test_uritemplate.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/test_uritemplate.py b/tests/test_uritemplate.py index 7448be0..9977ef7 100644 --- a/tests/test_uritemplate.py +++ b/tests/test_uritemplate.py @@ -464,6 +464,40 @@ class TestURITemplate(RFCTemplateExamples('RFCMeta', (TestCase,), {})): None ) + def test_label_path_expansion_explode_slash(self): + t = URITemplate('{/foo*}') + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', [], True, '/'), None + ) + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', ['one'], True, '/'), 'one' + ) + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', ['one', 'two'], True, '/'), 'one/two' + ) + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', ['', ''], True, '/'), '/' + ) + + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', {}, True, '/'), None + ) + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', {'one': ''}, True, '/'), 'one=' + ) + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', {'one': '', 'two': ''}, True, '/'), 'one=/two=' + ) + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', {'one': None}, True, '/'), None + ) + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', {'one': None, 'two': 'two'}, True, '/'), 'two=two' + ) + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', {'one': None, 'two': None}, True, '/'), None + ) + def test_semi_path_expansion(self): t = URITemplate('{foo}') v = t.variables[0] -- cgit v1.2.3 From abb1308fa8b7c50eb79e9f07ee448a76c7449847 Mon Sep 17 00:00:00 2001 From: Tommy Yu Date: Thu, 11 Jul 2019 22:27:22 +1200 Subject: Correct handling of empty/undef in list values - Expansion of a list including `None` values, violating 3.2.1 as the undefined value is not ignored, e.g. >>> expand('/test{/x*}', x=['one', None, 'three']) '/test/one/None/three' - A list with empty string was ignored, violating 2.3 as this should not be tread as undefined, example: >>> expand('/test{/x}', x=[]) '/test' >>> expand('/test{/x}', x='') '/test/' >>> expand('/test{/x}', x=['']) '/test' # should be /test/ >>> expand('/test{/x}', x=['', '']) '/test/,' >>> expand('/test{/x*}', x=['', '']) '/test//' >>> expand('/test{/x*}', x=['']) '/test' --- tests/test_uritemplate.py | 12 ++++++++++++ uritemplate/variable.py | 6 ++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/test_uritemplate.py b/tests/test_uritemplate.py index 9977ef7..f67ad26 100644 --- a/tests/test_uritemplate.py +++ b/tests/test_uritemplate.py @@ -469,12 +469,24 @@ class TestURITemplate(RFCTemplateExamples('RFCMeta', (TestCase,), {})): self.assertEqual(t.variables[0]._label_path_expansion( 'foo', [], True, '/'), None ) + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', [None], True, '/'), None + ) + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', [None, None], True, '/'), None + ) self.assertEqual(t.variables[0]._label_path_expansion( 'foo', ['one'], True, '/'), 'one' ) self.assertEqual(t.variables[0]._label_path_expansion( 'foo', ['one', 'two'], True, '/'), 'one/two' ) + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', ['one', None, 'two'], True, '/'), 'one/two' + ) + self.assertEqual(t.variables[0]._label_path_expansion( + 'foo', [''], True, '/'), '' + ) self.assertEqual(t.variables[0]._label_path_expansion( 'foo', ['', ''], True, '/'), '/' ) diff --git a/uritemplate/variable.py b/uritemplate/variable.py index a3bd4ce..ce3f652 100644 --- a/uritemplate/variable.py +++ b/uritemplate/variable.py @@ -200,10 +200,8 @@ class URIVariable(object): if not explode: join_str = ',' - expanded = join_str.join( - quote(v, safe) for v in value if value is not None - ) - return expanded if expanded else None + fragments = [quote(v, safe) for v in value if v is not None] + return join_str.join(fragments) if fragments else None if dict_test(value) or tuples: items = items or sorted(value.items()) -- cgit v1.2.3 From 0191df77d98befaa723549ce55528225693676fe Mon Sep 17 00:00:00 2001 From: Brett Cannon <54418+brettcannon@users.noreply.github.com> Date: Mon, 2 Dec 2019 10:35:31 -0800 Subject: Update the project name in the LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 26e92ad..41c87e7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,3 @@ This software is made available under the terms of *either* of the licenses -found in LICENSE.APACHE or LICENSE.BSD. Contributions to uritemplate.py are +found in LICENSE.APACHE or LICENSE.BSD. Contributions to uritemplate are made under the terms of *both* these licenses. -- cgit v1.2.3 From ab215b3eb7b16801d5a13267570caaa944cab3d6 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Mon, 2 Dec 2019 11:18:45 -0800 Subject: Update support for Python 3.7 & 3.8 Starting in Python 3.7 the quoting support changed from RFC 2396 to RFC 3986. --- .travis.yml | 4 ++++ setup.py | 11 +++++++++-- tests/fixtures/extended-tests.json | 22 ++++++++++++++-------- tox.ini | 4 +++- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index ea6648d..ec4291e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,10 @@ matrix: env: TOXENV=py35 - python: 3.6 env: TOXENV=py36 + - python: 3.7 + env: TOXENV=py37 + - python: 3.8 + env: TOXENV=py38 - env: TOXENV=pep8 install: diff --git a/setup.py b/setup.py index cae605c..170e003 100644 --- a/setup.py +++ b/setup.py @@ -6,12 +6,17 @@ packages = [ 'uritemplate' ] +with open("README.rst") as file: + readme = file.read() + +with open("HISTORY.rst") as file: + history = file.read() + setup( name="uritemplate", version=__version__, description='URI templates', - long_description="\n\n".join([open("README.rst").read(), - open("HISTORY.rst").read()]), + long_description="\n\n".join([readme, history]), license="BSD 3-Clause License or Apache License, Version 2.0", author="Ian Stapleton Cordasco", author_email="graffatcolmingov@gmail.com", @@ -34,6 +39,8 @@ setup( 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: CPython', ], ) diff --git a/tests/fixtures/extended-tests.json b/tests/fixtures/extended-tests.json index fd69744..3fd88f9 100644 --- a/tests/fixtures/extended-tests.json +++ b/tests/fixtures/extended-tests.json @@ -11,7 +11,7 @@ "lang" : "en", "geocode" : ["37.76","-122.427"], "first_name" : "John", - "last.name" : "Doe", + "last.name" : "Doe", "Some%20Thing" : "foo", "number" : 6, "long" : 37.76, @@ -28,7 +28,7 @@ "testcases":[ [ "{/id*}" , "/person" ], - [ "{/id*}{?fields,first_name,last.name,token}" , [ + [ "{/id*}{?fields,first_name,last.name,token}" , [ "/person?fields=id,name,picture&first_name=John&last.name=Doe&token=12345", "/person?fields=id,picture,name&first_name=John&last.name=Doe&token=12345", "/person?fields=picture,name,id&first_name=John&last.name=Doe&token=12345", @@ -46,10 +46,16 @@ ["/base{/group_id,first_name}/pages{/page,lang}{?format,q}","/base/12345/John/pages/5/en?format=json&q=URI%20Templates"], ["/sparql{?query}", "/sparql?query=PREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%20SELECT%20%3Fbook%20%3Fwho%20WHERE%20%7B%20%3Fbook%20dc%3Acreator%20%3Fwho%20%7D"], ["/go{?uri}", "/go?uri=http%3A%2F%2Fexample.org%2F%3Furi%3Dhttp%253A%252F%252Fexample.org%252F"], - ["/service{?word}", "/service?word=dr%C3%BCcken"], - ["/lookup{?Stra%C3%9Fe}", "/lookup?Stra%C3%9Fe=Gr%C3%BCner%20Weg"], - ["{random}" , "%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF"], - ["{?assoc_special_chars*}", "?%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95=%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF"] + ["/service{?word}", [ "/service?word=dr%C3%BCcken", "/service?word=dr%C3%83%C2%BCcken"]], + ["/lookup{?Stra%C3%9Fe}", ["/lookup?Stra%C3%9Fe=Gr%C3%BCner%20Weg", "/lookup?Stra%C3%9Fe=Gr%C3%83%C2%BCner%20Weg"]], + ["{random}", + [ "%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF", + "%C3%85%C2%A1%C3%83%C2%B6%C3%83%C2%A4%C3%85%C2%B8%C3%85%E2%80%9C%C3%83%C2%B1%C3%83%C2%AA%C3%A2%E2%80%9A%C2%AC%C3%82%C2%A3%C3%82%C2%A5%C3%A2%E2%82%AC%C2%A1%C3%83%E2%80%98%C3%83%E2%80%99%C3%83%E2%80%9C%C3%83%E2%80%9D%C3%83%E2%80%A2%C3%83%E2%80%93%C3%83%E2%80%94%C3%83%CB%9C%C3%83%E2%84%A2%C3%83%C5%A1%C3%83%C2%A0%C3%83%C2%A1%C3%83%C2%A2%C3%83%C2%A3%C3%83%C2%A4%C3%83%C2%A5%C3%83%C2%A6%C3%83%C2%A7%C3%83%C2%BF"] + ], + ["{?assoc_special_chars*}", + [ "?%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95=%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF", + "?%C3%85%C2%A1%C3%83%C2%B6%C3%83%C2%A4%C3%85%C2%B8%C3%85%E2%80%9C%C3%83%C2%B1%C3%83%C2%AA%C3%A2%E2%80%9A%C2%AC%C3%82%C2%A3%C3%82%C2%A5%C3%A2%E2%82%AC%C2%A1%C3%83%E2%80%98%C3%83%E2%80%99%C3%83%E2%80%9C%C3%83%E2%80%9D%C3%83%E2%80%A2=%C3%83%E2%80%93%C3%83%E2%80%94%C3%83%CB%9C%C3%83%E2%84%A2%C3%83%C5%A1%C3%83%C2%A0%C3%83%C2%A1%C3%83%C2%A2%C3%83%C2%A3%C3%83%C2%A4%C3%83%C2%A5%C3%83%C2%A6%C3%83%C2%A7%C3%83%C2%BF"] + ] ] }, "Additional Examples 2":{ @@ -68,7 +74,7 @@ "testcases":[ [ "{/id*}" , ["/person/albums","/albums/person"] ], - [ "{/id*}{?fields,token}" , [ + [ "{/id*}{?fields,token}" , [ "/person/albums?fields=id,name,picture&token=12345", "/person/albums?fields=id,picture,name&token=12345", "/person/albums?fields=picture,name,id&token=12345", @@ -112,7 +118,7 @@ [ "{?42}", "?42=The%20Answer%20to%20the%20Ultimate%20Question%20of%20Life%2C%20the%20Universe%2C%20and%20Everything"], [ "{1337}", "leet,as,it,can,be"], [ "{?1337*}", "?1337=leet&1337=as&1337=it&1337=can&1337=be"], - [ "{?german*}", [ "?11=elf&12=zw%C3%B6lf", "?12=zw%C3%B6lf&11=elf"] ] + [ "{?german*}", [ "?11=elf&12=zw%C3%B6lf", "?12=zw%C3%B6lf&11=elf", "?11=elf&12=zw%C3%83%C2%B6lf"] ] ] } } diff --git a/tox.ini b/tox.ini index 7bd6405..ed27494 100644 --- a/tox.ini +++ b/tox.ini @@ -4,12 +4,14 @@ envlist = py34, py35, py36, + py37, + py38, pep8, [testenv] deps = pytest -commands = py.test {posargs} +commands = pytest {posargs} [testenv:pep8] deps = -- cgit v1.2.3 From 0a1cd6f8adf44f7cbe1717e4db44fec364f4e272 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 6 Dec 2019 11:11:57 -0800 Subject: Revert test input file changes --- tests/fixtures/extended-tests.json | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/fixtures/extended-tests.json b/tests/fixtures/extended-tests.json index 3fd88f9..ad43ad6 100644 --- a/tests/fixtures/extended-tests.json +++ b/tests/fixtures/extended-tests.json @@ -46,16 +46,10 @@ ["/base{/group_id,first_name}/pages{/page,lang}{?format,q}","/base/12345/John/pages/5/en?format=json&q=URI%20Templates"], ["/sparql{?query}", "/sparql?query=PREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%20SELECT%20%3Fbook%20%3Fwho%20WHERE%20%7B%20%3Fbook%20dc%3Acreator%20%3Fwho%20%7D"], ["/go{?uri}", "/go?uri=http%3A%2F%2Fexample.org%2F%3Furi%3Dhttp%253A%252F%252Fexample.org%252F"], - ["/service{?word}", [ "/service?word=dr%C3%BCcken", "/service?word=dr%C3%83%C2%BCcken"]], - ["/lookup{?Stra%C3%9Fe}", ["/lookup?Stra%C3%9Fe=Gr%C3%BCner%20Weg", "/lookup?Stra%C3%9Fe=Gr%C3%83%C2%BCner%20Weg"]], - ["{random}", - [ "%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF", - "%C3%85%C2%A1%C3%83%C2%B6%C3%83%C2%A4%C3%85%C2%B8%C3%85%E2%80%9C%C3%83%C2%B1%C3%83%C2%AA%C3%A2%E2%80%9A%C2%AC%C3%82%C2%A3%C3%82%C2%A5%C3%A2%E2%82%AC%C2%A1%C3%83%E2%80%98%C3%83%E2%80%99%C3%83%E2%80%9C%C3%83%E2%80%9D%C3%83%E2%80%A2%C3%83%E2%80%93%C3%83%E2%80%94%C3%83%CB%9C%C3%83%E2%84%A2%C3%83%C5%A1%C3%83%C2%A0%C3%83%C2%A1%C3%83%C2%A2%C3%83%C2%A3%C3%83%C2%A4%C3%83%C2%A5%C3%83%C2%A6%C3%83%C2%A7%C3%83%C2%BF"] - ], - ["{?assoc_special_chars*}", - [ "?%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95=%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF", - "?%C3%85%C2%A1%C3%83%C2%B6%C3%83%C2%A4%C3%85%C2%B8%C3%85%E2%80%9C%C3%83%C2%B1%C3%83%C2%AA%C3%A2%E2%80%9A%C2%AC%C3%82%C2%A3%C3%82%C2%A5%C3%A2%E2%82%AC%C2%A1%C3%83%E2%80%98%C3%83%E2%80%99%C3%83%E2%80%9C%C3%83%E2%80%9D%C3%83%E2%80%A2=%C3%83%E2%80%93%C3%83%E2%80%94%C3%83%CB%9C%C3%83%E2%84%A2%C3%83%C5%A1%C3%83%C2%A0%C3%83%C2%A1%C3%83%C2%A2%C3%83%C2%A3%C3%83%C2%A4%C3%83%C2%A5%C3%83%C2%A6%C3%83%C2%A7%C3%83%C2%BF"] - ] + ["/service{?word}", "/service?word=dr%C3%BCcken"], + ["/lookup{?Stra%C3%9Fe}", "/lookup?Stra%C3%9Fe=Gr%C3%BCner%20Weg"], + ["{random}" , "%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF"], + ["{?assoc_special_chars*}", "?%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95=%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF"] ] }, "Additional Examples 2":{ @@ -118,7 +112,7 @@ [ "{?42}", "?42=The%20Answer%20to%20the%20Ultimate%20Question%20of%20Life%2C%20the%20Universe%2C%20and%20Everything"], [ "{1337}", "leet,as,it,can,be"], [ "{?1337*}", "?1337=leet&1337=as&1337=it&1337=can&1337=be"], - [ "{?german*}", [ "?11=elf&12=zw%C3%B6lf", "?12=zw%C3%B6lf&11=elf", "?11=elf&12=zw%C3%83%C2%B6lf"] ] + [ "{?german*}", [ "?11=elf&12=zw%C3%B6lf", "?12=zw%C3%B6lf&11=elf"] ] ] } } -- cgit v1.2.3 From 6ef7577baf8a99539d4c2e3965c4797c6ea5d318 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 6 Dec 2019 11:12:20 -0800 Subject: Specify file encodings --- setup.py | 4 ++-- tests/test_from_fixtures.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 170e003..d51c902 100644 --- a/setup.py +++ b/setup.py @@ -6,10 +6,10 @@ packages = [ 'uritemplate' ] -with open("README.rst") as file: +with open("README.rst", encoding="utf-8") as file: readme = file.read() -with open("HISTORY.rst") as file: +with open("HISTORY.rst", encoding="utf-8") as file: history = file.read() setup( diff --git a/tests/test_from_fixtures.py b/tests/test_from_fixtures.py index c21d395..4b92081 100644 --- a/tests/test_from_fixtures.py +++ b/tests/test_from_fixtures.py @@ -12,7 +12,7 @@ def fixture_file_path(filename): def load_examples(filename): path = fixture_file_path(filename) - with open(path, 'r') as examples_file: + with open(path, 'r', encoding="utf-8") as examples_file: examples = json.load(examples_file) return examples -- cgit v1.2.3 From b98d77c546835aeded413cd7048e503f0158f387 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 6 Dec 2019 11:15:03 -0800 Subject: Appease Python 2.7 --- setup.py | 2 ++ tests/test_from_fixtures.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d51c902..dd0a391 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +from io import open + from setuptools import setup from uritemplate import __version__ diff --git a/tests/test_from_fixtures.py b/tests/test_from_fixtures.py index 4b92081..d6c9810 100644 --- a/tests/test_from_fixtures.py +++ b/tests/test_from_fixtures.py @@ -1,3 +1,4 @@ +import io import json import os.path @@ -12,7 +13,7 @@ def fixture_file_path(filename): def load_examples(filename): path = fixture_file_path(filename) - with open(path, 'r', encoding="utf-8") as examples_file: + with io.open(path, 'r', encoding="utf-8") as examples_file: examples = json.load(examples_file) return examples -- cgit v1.2.3 From e2c103d1fc42e270ea3cef443bc9d8700548ecc4 Mon Sep 17 00:00:00 2001 From: Brett Cannon <54418+brettcannon@users.noreply.github.com> Date: Fri, 13 Dec 2019 11:43:50 -0800 Subject: Update history Part of #42 --- HISTORY.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index f04a309..cf44a5b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,20 @@ Changelog - uritemplate ======================= +3.0.1 - 2019-12-DD +------------------ + +.. note:: This version is under active development + +- Update to Python 3.6, 3.7, and 3.8 +- Ignore ``None`` in list argument expansion +- Handle a list with an empty string appropriately + +3.0.0 - 2016-08-29 +------------------ + +- Match major version number of uritemplate.py + 2.0.0 - 2016-08-29 ------------------ -- cgit v1.2.3 From e03d83089ce64516d374832ced03352991b17bff Mon Sep 17 00:00:00 2001 From: Brett Cannon <54418+brettcannon@users.noreply.github.com> Date: Fri, 13 Dec 2019 11:46:44 -0800 Subject: Bump version number to 3.0.1 Part of #42 --- uritemplate/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uritemplate/__init__.py b/uritemplate/__init__.py index 40c0320..5352520 100644 --- a/uritemplate/__init__.py +++ b/uritemplate/__init__.py @@ -16,7 +16,7 @@ __title__ = 'uritemplate' __author__ = 'Ian Cordasco' __license__ = 'Modified BSD or Apache License, Version 2.0' __copyright__ = 'Copyright 2013 Ian Cordasco' -__version__ = '3.0.0' +__version__ = '3.0.1' __version_info__ = tuple(int(i) for i in __version__.split('.') if i.isdigit()) from uritemplate.api import ( -- cgit v1.2.3 From 4edb2813d6653a9a272d3c32559c2b526ed3007a Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 16 Dec 2019 22:21:54 -0500 Subject: DOC: add note about dropping support for old Pythons --- HISTORY.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.rst b/HISTORY.rst index cf44a5b..8dee616 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,7 @@ Changelog - uritemplate .. note:: This version is under active development - Update to Python 3.6, 3.7, and 3.8 +- Drop support for Python 2.6, 3.2, and 3.3 - Ignore ``None`` in list argument expansion - Handle a list with an empty string appropriately -- cgit v1.2.3 From 927adb45e0408261847c9df2d2f8d8ae2c8dddbc Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 18 Dec 2019 16:24:36 -0800 Subject: Update HISTORY.rst for planned 3.0.1 release --- HISTORY.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 8dee616..3a84017 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,11 +1,9 @@ Changelog - uritemplate ======================= -3.0.1 - 2019-12-DD +3.0.1 - 2019-12-19 ------------------ -.. note:: This version is under active development - - Update to Python 3.6, 3.7, and 3.8 - Drop support for Python 2.6, 3.2, and 3.3 - Ignore ``None`` in list argument expansion @@ -57,7 +55,7 @@ Changelog - uritemplate.py 0.3.0 - 2013-10-22 ------------------ -- Add ``#partial`` to partially expand templates and return new instances of +- Add ``#partial`` to partially expand templates and return new instances of ``URITemplate``. 0.2.0 - 2013-07-26 -- cgit v1.2.3 From 09721e887bb8635f9db6efd99c65d660d3ab4112 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Thu, 19 Dec 2019 14:11:28 -0800 Subject: Specify the long description encoding --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index dd0a391..7a09f5e 100644 --- a/setup.py +++ b/setup.py @@ -19,6 +19,7 @@ setup( version=__version__, description='URI templates', long_description="\n\n".join([readme, history]), + long_description_content_type="text/x-rst", license="BSD 3-Clause License or Apache License, Version 2.0", author="Ian Stapleton Cordasco", author_email="graffatcolmingov@gmail.com", -- cgit v1.2.3