Skip to content

Commit ab215b3

Browse files
committed
Update support for Python 3.7 & 3.8
Starting in Python 3.7 the quoting support changed from RFC 2396 to RFC 3986.
1 parent 3df0ed1 commit ab215b3

File tree

4 files changed

+30
-11
lines changed

4 files changed

+30
-11
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ matrix:
1111
env: TOXENV=py35
1212
- python: 3.6
1313
env: TOXENV=py36
14+
- python: 3.7
15+
env: TOXENV=py37
16+
- python: 3.8
17+
env: TOXENV=py38
1418
- env: TOXENV=pep8
1519

1620
install:

setup.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66
'uritemplate'
77
]
88

9+
with open("README.rst") as file:
10+
readme = file.read()
11+
12+
with open("HISTORY.rst") as file:
13+
history = file.read()
14+
915
setup(
1016
name="uritemplate",
1117
version=__version__,
1218
description='URI templates',
13-
long_description="\n\n".join([open("README.rst").read(),
14-
open("HISTORY.rst").read()]),
19+
long_description="\n\n".join([readme, history]),
1520
license="BSD 3-Clause License or Apache License, Version 2.0",
1621
author="Ian Stapleton Cordasco",
1722
author_email="graffatcolmingov@gmail.com",
@@ -34,6 +39,8 @@
3439
'Programming Language :: Python :: 3.4',
3540
'Programming Language :: Python :: 3.5',
3641
'Programming Language :: Python :: 3.6',
42+
'Programming Language :: Python :: 3.7',
43+
'Programming Language :: Python :: 3.8',
3744
'Programming Language :: Python :: Implementation :: CPython',
3845
],
3946
)

tests/fixtures/extended-tests.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"lang" : "en",
1212
"geocode" : ["37.76","-122.427"],
1313
"first_name" : "John",
14-
"last.name" : "Doe",
14+
"last.name" : "Doe",
1515
"Some%20Thing" : "foo",
1616
"number" : 6,
1717
"long" : 37.76,
@@ -28,7 +28,7 @@
2828
"testcases":[
2929

3030
[ "{/id*}" , "/person" ],
31-
[ "{/id*}{?fields,first_name,last.name,token}" , [
31+
[ "{/id*}{?fields,first_name,last.name,token}" , [
3232
"/person?fields=id,name,picture&first_name=John&last.name=Doe&token=12345",
3333
"/person?fields=id,picture,name&first_name=John&last.name=Doe&token=12345",
3434
"/person?fields=picture,name,id&first_name=John&last.name=Doe&token=12345",
@@ -46,10 +46,16 @@
4646
["/base{/group_id,first_name}/pages{/page,lang}{?format,q}","/base/12345/John/pages/5/en?format=json&q=URI%20Templates"],
4747
["/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"],
4848
["/go{?uri}", "/go?uri=http%3A%2F%2Fexample.org%2F%3Furi%3Dhttp%253A%252F%252Fexample.org%252F"],
49-
["/service{?word}", "/service?word=dr%C3%BCcken"],
50-
["/lookup{?Stra%C3%9Fe}", "/lookup?Stra%C3%9Fe=Gr%C3%BCner%20Weg"],
51-
["{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"],
52-
["{?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"]
49+
["/service{?word}", [ "/service?word=dr%C3%BCcken", "/service?word=dr%C3%83%C2%BCcken"]],
50+
["/lookup{?Stra%C3%9Fe}", ["/lookup?Stra%C3%9Fe=Gr%C3%BCner%20Weg", "/lookup?Stra%C3%9Fe=Gr%C3%83%C2%BCner%20Weg"]],
51+
["{random}",
52+
[ "%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",
53+
"%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"]
54+
],
55+
["{?assoc_special_chars*}",
56+
[ "?%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",
57+
"?%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"]
58+
]
5359
]
5460
},
5561
"Additional Examples 2":{
@@ -68,7 +74,7 @@
6874
"testcases":[
6975

7076
[ "{/id*}" , ["/person/albums","/albums/person"] ],
71-
[ "{/id*}{?fields,token}" , [
77+
[ "{/id*}{?fields,token}" , [
7278
"/person/albums?fields=id,name,picture&token=12345",
7379
"/person/albums?fields=id,picture,name&token=12345",
7480
"/person/albums?fields=picture,name,id&token=12345",
@@ -112,7 +118,7 @@
112118
[ "{?42}", "?42=The%20Answer%20to%20the%20Ultimate%20Question%20of%20Life%2C%20the%20Universe%2C%20and%20Everything"],
113119
[ "{1337}", "leet,as,it,can,be"],
114120
[ "{?1337*}", "?1337=leet&1337=as&1337=it&1337=can&1337=be"],
115-
[ "{?german*}", [ "?11=elf&12=zw%C3%B6lf", "?12=zw%C3%B6lf&11=elf"] ]
121+
[ "{?german*}", [ "?11=elf&12=zw%C3%B6lf", "?12=zw%C3%B6lf&11=elf", "?11=elf&12=zw%C3%83%C2%B6lf"] ]
116122
]
117123
}
118124
}

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ envlist =
44
py34,
55
py35,
66
py36,
7+
py37,
8+
py38,
79
pep8,
810

911
[testenv]
1012
deps =
1113
pytest
12-
commands = py.test {posargs}
14+
commands = pytest {posargs}
1315

1416
[testenv:pep8]
1517
deps =

0 commit comments

Comments
 (0)