Skip to content

Commit 551d2bb

Browse files
authored
feat: Drop Python 2 support (#105)
BREAKING CHANGE: This release drops Python 2 support Django has [dropped Python 2 support](https://docs.djangoproject.com/en/2.2/releases/2.0/#python-compatibility) ever since Django 2.0 (December 2, 2017). With Django 3.0 coming very soon and Python 2 reaching end of life, it doesn't make sense to continue supporting Python 2.
1 parent 0cd8a24 commit 551d2bb

File tree

10 files changed

+13
-35
lines changed

10 files changed

+13
-35
lines changed

Diff for: .travis.yml

-12
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,21 @@ script: tox -e $TOX_ENV
66

77
jobs:
88
include:
9-
- stage: test
10-
python: 2.7
11-
env: TOX_ENV=django18-py27
129
- stage: test
1310
python: 3.4
1411
env: TOX_ENV=django18-py34
1512
- stage: test
1613
python: 3.5
1714
env: TOX_ENV=django18-py35
18-
- stage: test
19-
python: 2.7
20-
env: TOX_ENV=django19-py27
2115
- stage: test
2216
python: 3.4
2317
env: TOX_ENV=django19-py34
2418
- stage: test
2519
python: 3.5
2620
env: TOX_ENV=django19-py35
27-
- stage: test
28-
python: 2.7
29-
env: TOX_ENV=django110-py27
3021
- stage: test
3122
python: 3.5
3223
env: TOX_ENV=django110-py35
33-
- stage: test
34-
python: 2.7
35-
env: TOX_ENV=django111-py27
3624
- stage: test
3725
python: 3.5
3826
env: TOX_ENV=django111-py35

Diff for: Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ version:
9090
# 1. bump VERSION
9191
# 2. `make version`
9292
# 3. `make release`
93-
# 4. `git push --tags origin master`
93+
# 4. `git push --follow-tags origin master`
9494
# 5. `chandler push`
9595
# 6. `make build docker/publish`
96-
release:
97-
@-pip install wheel > /dev/null
98-
python setup.py sdist bdist_wheel upload
96+
release: clean
97+
@-pip install twine wheel > /dev/null
98+
python setup.py sdist bdist_wheel
99+
twine upload dist/*

Diff for: django_object_actions/tests/test_admin.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"""
22
Integration tests that actually try and use the tools setup in admin.py
33
"""
4-
from __future__ import unicode_literals
5-
64
from django.http import HttpResponse
75
from mock import patch
86

Diff for: django_object_actions/tests/test_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import mock
2-
from django.test import TestCase
1+
from unittest import mock
32

3+
from django.test import TestCase
44
from example_project.polls.models import Poll
55

66
from ..utils import BaseDjangoObjectActions, BaseActionView, takes_instance_or_queryset

Diff for: django_object_actions/utils.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import unicode_literals
2-
31
from functools import wraps
42
from itertools import chain
53

Diff for: example_project/polls/admin.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import unicode_literals
2-
31
from django.contrib import admin
42
from django.contrib.admin import AdminSite
53
from django.db.models import F

Diff for: example_project/polls/models.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import datetime
2-
import uuid
2+
from uuid import uuid4
33

44
from django.db import models
55
from django.utils import timezone
@@ -30,7 +30,7 @@ def __str__(self):
3030

3131

3232
class Comment(models.Model):
33-
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
33+
uuid = models.UUIDField(primary_key=True, default=uuid4, editable=False)
3434
comment = models.TextField(null=True, blank=True)
3535

3636
def __str__(self):

Diff for: requirements.in

-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@ dj-database-url
22
django-extensions
33
factory-boy
44
coverage
5-
# DELETEME after python 2.7 is dropped
6-
mock
7-
uuid

Diff for: setup.py

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
"Intended Audience :: Developers",
2020
"License :: OSI Approved :: Apache Software License",
2121
"Operating System :: OS Independent",
22-
"Programming Language :: Python :: 2",
23-
"Programming Language :: Python :: 2.7",
2422
"Programming Language :: Python :: 3",
2523
"Programming Language :: Python :: 3.4",
2624
"Programming Language :: Python :: 3.5",

Diff for: tox.ini

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
33
[tox]
44
envlist =
5-
django18-{py27,py34,py35},
6-
django19-{py27,py34,py35},
7-
django110-{py27,py35},
8-
django111-{py27,py35,py36},
5+
django18-{py34,py35},
6+
django19-{py34,py35},
7+
django110-{py35},
8+
django111-{py35,py36},
99
django20-{py34,py35,py36,py37},
1010
django21-{py35,py36,py37},
1111
django22-{py36,py37},

0 commit comments

Comments
 (0)