Skip to content

Commit 7f77340

Browse files
authored
Add Python 3.7 support (#6141)
1 parent 612a7b9 commit 7f77340

File tree

5 files changed

+23
-14
lines changed

5 files changed

+23
-14
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ matrix:
2121
- { python: "3.6", env: DJANGO=1.11 }
2222
- { python: "3.6", env: DJANGO=2.0 }
2323
- { python: "3.6", env: DJANGO=2.1 }
24+
25+
- { python: "3.7", env: DJANGO=2.0, dist: xenial, sudo: true }
26+
- { python: "3.7", env: DJANGO=2.1, dist: xenial, sudo: true }
27+
- { python: "3.7", env: DJANGO=master, dist: xenial, sudo: true }
28+
2429
- { python: "3.6", env: TOXENV=base }
2530
- { python: "2.7", env: TOXENV=lint }
2631
- { python: "2.7", env: TOXENV=docs }
@@ -42,7 +47,6 @@ matrix:
4247

4348
allow_failures:
4449
- env: DJANGO=master
45-
- env: DJANGO=2.1
4650

4751
install:
4852
- pip install tox tox-venv tox-travis

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ There is a live example API for testing purposes, [available here][sandbox].
5252

5353
# Requirements
5454

55-
* Python (2.7, 3.4, 3.5, 3.6)
55+
* Python (2.7, 3.4, 3.5, 3.6, 3.7)
5656
* Django (1.11, 2.0, 2.1)
5757

5858
# Installation
@@ -142,14 +142,14 @@ You can now open the API in your browser at `http://127.0.0.1:8000/`, and view y
142142
You can also interact with the API using command line tools such as [`curl`](https://curl.haxx.se/). For example, to list the users endpoint:
143143

144144
$ curl -H 'Accept: application/json; indent=4' -u admin:password http://127.0.0.1:8000/users/
145-
[
146-
{
147-
"url": "http://127.0.0.1:8000/users/1/",
148-
"username": "admin",
149-
"email": "[email protected]",
150-
"is_staff": true,
151-
}
152-
]
145+
[
146+
{
147+
"url": "http://127.0.0.1:8000/users/1/",
148+
"username": "admin",
149+
"email": "[email protected]",
150+
"is_staff": true,
151+
}
152+
]
153153

154154
Or to create a new user:
155155

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ continued development by **[signing up for a paid plan][funding]**.
8383

8484
REST framework requires the following:
8585

86-
* Python (2.7, 3.4, 3.5, 3.6)
86+
* Python (2.7, 3.4, 3.5, 3.6, 3.7)
8787
* Django (1.11, 2.0, 2.1)
8888

8989
The following packages are optional:

tests/test_model_serializer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import datetime
1111
import decimal
12+
import sys
1213
from collections import OrderedDict
1314

1415
import pytest
@@ -381,6 +382,10 @@ class Meta:
381382
TestSerializer():
382383
id = IntegerField(label='ID', read_only=True)
383384
duration_field = DurationField(max_value=datetime.timedelta(3), min_value=datetime.timedelta(1))
385+
""") if sys.version_info < (3, 7) else dedent("""
386+
TestSerializer():
387+
id = IntegerField(label='ID', read_only=True)
388+
duration_field = DurationField(max_value=datetime.timedelta(days=3), min_value=datetime.timedelta(days=1))
384389
""")
385390
self.assertEqual(unicode_repr(TestSerializer()), expected)
386391

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[tox]
22
envlist =
33
{py27,py34,py35,py36}-django111,
4-
{py34,py35,py36}-django20,
5-
{py35,py36}-django21
6-
{py35,py36}-djangomaster,
4+
{py34,py35,py36,py37}-django20,
5+
{py35,py36,py37}-django21
6+
{py35,py36,py37}-djangomaster,
77
base,dist,lint,docs,
88

99
[travis:env]

0 commit comments

Comments
 (0)