Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit bcc10d4

Browse files
committed
Upgraded the app to be compatible with Django 1.10+, removed compatibility for Django < 1.8
1 parent 98450c2 commit bcc10d4

16 files changed

+39
-101
lines changed

Diff for: .travis.yml

+7-18
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,17 @@ language: python
22

33
python:
44
- "2.7"
5+
- "3.6"
56

67
env:
78
matrix:
8-
- TOX_ENV=py27-dj14
9-
- TOX_ENV=py27-dj15
10-
- TOX_ENV=py27-dj16
11-
- TOX_ENV=py27-dj17
129
- TOX_ENV=py27-dj18
13-
- TOX_ENV=py33-dj15
14-
- TOX_ENV=py33-dj16
15-
- TOX_ENV=py33-dj17
16-
- TOX_ENV=py33-dj18
17-
- TOX_ENV=py34-dj15
18-
- TOX_ENV=py34-dj16
19-
- TOX_ENV=py34-dj17
20-
- TOX_ENV=py34-dj18
21-
- TOX_ENV=pypy-dj14
22-
- TOX_ENV=pypy-dj15
23-
- TOX_ENV=pypy-dj16
24-
- TOX_ENV=pypy-dj17
25-
- TOX_ENV=pypy-dj18
26-
- TOX_ENV=py27-cov
10+
- TOX_ENV=py27-dj19
11+
- TOX_ENV=py27-dj100
12+
- TOX_ENV=py36-dj18
13+
- TOX_ENV=py36-dj19
14+
- TOX_ENV=py36-dj100
15+
- TOX_ENV=py36-cov
2716

2817
install:
2918
- pip install tox

Diff for: README.rst

+7
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,10 @@ This package provide various signals for you to get notification, and do more th
136136
:target: https://travis-ci.org/StreetVoice/django-elastic-transcoder
137137
.. |Coverage Status| image:: https://coveralls.io/repos/StreetVoice/django-elastic-transcoder/badge.png?branch=master
138138
:target: https://coveralls.io/r/StreetVoice/django-elastic-transcoder?branch=master
139+
140+
Run Tests
141+
-----------
142+
143+
.. code:: sh
144+
$ pip install -r test_requirements.txt
145+
$ tox

Diff for: dj_elastictranscoder/admin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from django.contrib import admin
2-
from .models import EncodeJob
2+
from dj_elastictranscoder.models import EncodeJob
33

44
class EncodeJobAdmin(admin.ModelAdmin):
55
list_display = ('id', 'state', 'message')

Diff for: dj_elastictranscoder/migrations/0001_initial.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Migration(migrations.Migration):
1616
fields=[
1717
('id', models.CharField(max_length=100, serialize=False, primary_key=True)),
1818
('object_id', models.PositiveIntegerField()),
19-
('state', models.PositiveIntegerField(default=0, db_index=True, choices=[(0, b'Submitted'), (1, b'Progressing'), (2, b'Error'), (3, b'Warning'), (4, b'Complete')])),
19+
('state', models.PositiveIntegerField(choices=[(0, 'Submitted'), (1, 'Progressing'), (2, 'Error'), (3, 'Warning'), (4, 'Complete')], db_index=True, default=0)),
2020
('message', models.TextField()),
2121
('created_at', models.DateTimeField(auto_now_add=True)),
2222
('last_modified', models.DateTimeField(auto_now=True)),

Diff for: dj_elastictranscoder/models.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
from django.db import models
22
from django.contrib.contenttypes.models import ContentType
3-
import django
4-
if django.get_version() >= '1.8':
5-
from django.contrib.contenttypes.fields import GenericForeignKey
6-
else:
7-
from django.contrib.contenttypes.generic import GenericForeignKey
3+
from django.contrib.contenttypes.fields import GenericForeignKey
4+
85

96

107
class EncodeJob(models.Model):

Diff for: dj_elastictranscoder/south_migrations/0001_initial.py

-49
This file was deleted.

Diff for: dj_elastictranscoder/south_migrations/__init__.py

Whitespace-only changes.

Diff for: dj_elastictranscoder/transcoder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from django.conf import settings
44
from django.contrib.contenttypes.models import ContentType
55

6-
from .models import EncodeJob
6+
from dj_elastictranscoder.models import EncodeJob
77

88

99
class Transcoder(object):

Diff for: dj_elastictranscoder/urls.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
try:
2-
from django.conf.urls import url, patterns
3-
except ImportError:
4-
from django.conf.urls.defaults import url, patterns # Support for Django < 1.4
1+
from django.conf.urls import url
2+
3+
from dj_elastictranscoder.views import endpoint as transcoder_endpoint
4+
5+
urlpatterns = (url(r'^endpoint/$', transcoder_endpoint, name='transcoder_endpoint'),)
56

6-
urlpatterns = patterns('dj_elastictranscoder.views',
7-
url(r'^endpoint/$', 'endpoint'),
8-
)

Diff for: dj_elastictranscoder/views.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from django.views.decorators.csrf import csrf_exempt
55
from django.core.mail import mail_admins
66

7-
from .models import EncodeJob
8-
from .signals import (
7+
from dj_elastictranscoder.models import EncodeJob
8+
from dj_elastictranscoder.signals import (
99
transcode_onprogress,
1010
transcode_onerror,
1111
transcode_oncomplete

Diff for: setup.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
include_package_data=True,
1616
zip_safe=False,
1717
install_requires=[
18-
"django >= 1.3, < 1.9",
18+
"django >= 1.8",
1919
"boto3 >= 1.1",
20-
"South >= 0.8",
2120
],
2221
classifiers=[
2322
"Intended Audience :: Developers",

Diff for: test_requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tox

Diff for: testsapp/requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ pytest
22
pytest-django
33
pytest-cov
44
boto
5-
south

Diff for: testsapp/test_job.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
transcode_oncomplete
1414
)
1515

16-
from .models import Item
16+
from testsapp.models import Item
1717

1818

1919

Diff for: testsapp/tests_settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
]
1616
SITE_ID = 1
1717
DEBUG = False
18-
ROOT_URLCONF = ''
18+
ROOT_URLCONF = 'dj_elastictranscoder.urls'
1919
SECRET_KEY='test'

Diff for: tox.ini

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[tox]
2-
# for py 3.x we are using only django 1.6.x as 1.5.x had only "experimental py3 support"
32
envlist =
4-
py{27,py}-dj{14,15,16,17,18},
5-
py{33,34}-dj{15,16,17,18},
6-
py27-cov
3+
py{27}-dj{18,19,100},
4+
py{36}-dj{18,19,100},
5+
py36-cov
76
skipsdist = True
87
usedevelop = True
98

@@ -13,21 +12,19 @@ basepython =
1312
py27: python2.7
1413
py33: python3.3
1514
py34: python3.4
16-
pypy: pypy
15+
py35: python3.5
16+
py36: python3.6
1717
deps =
1818
-rtestsapp/requirements.txt
19-
dj14: django>=1.4,<1.4.999
20-
dj15: django>=1.5,<1.5.999
21-
dj16: django>=1.6,<1.6.999
22-
dj17: django>=1.7,<1.7.999
2319
dj18: django>=1.8,<1.8.999
24-
dj19: https://github.com/django/django/archive/master.tar.gz#egg=django
20+
dj19: django>=1.9,<1.9.999
21+
dj100: django>=1.10
2522
setenv =
2623
DJANGO_SETTINGS_MODULE = testsapp.tests_settings
2724
PYTHONPATH = {toxinidir}/testsapp:{toxinidir}
2825

29-
[testenv:py27-cov]
26+
[testenv:py36-cov]
3027
commands = py.test --cov=dj_elastictranscoder
3128
deps =
3229
-rtestsapp/requirements.txt
33-
django>=1.8,<1.8.999
30+
django>=1.8

0 commit comments

Comments
 (0)