Skip to content

Only support for Python 3.5 to Python 3.7 and Django 2.x #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
.DS_Store
.eggs
.tox
/build
/dist
/wheelhouse
48 changes: 25 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
language: python

python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"

env:
matrix:
- TOX_ENV=py27-dj14
- TOX_ENV=py27-dj15
- TOX_ENV=py27-dj16
- TOX_ENV=py27-dj17
- TOX_ENV=py27-dj18
- TOX_ENV=py33-dj15
- TOX_ENV=py33-dj16
- TOX_ENV=py33-dj17
- TOX_ENV=py33-dj18
- TOX_ENV=py34-dj15
- TOX_ENV=py34-dj16
- TOX_ENV=py34-dj17
- TOX_ENV=py34-dj18
- TOX_ENV=pypy-dj14
- TOX_ENV=pypy-dj15
- TOX_ENV=pypy-dj16
- TOX_ENV=pypy-dj17
- TOX_ENV=pypy-dj18
- TOX_ENV=py27-cov
matrix:
include:
- python: "3.5"
env: TOXENV="py35-dj20"
- python: "3.5"
env: TOXENV="py35-dj21"
- python: "3.5"
env: TOXENV="py35-dj22"
- python: "3.6"
env: TOXENV="py36-dj20"
- python: "3.6"
env: TOXENV="py36-dj21"
- python: "3.6"
env: TOXENV="py36-dj22"
- python: "3.7"
env: TOXENV="py37-dj20"
- python: "3.7"
env: TOXENV="py37-dj21"
- python: "3.7"
env: TOXENV="py37-dj22"

install:
- pip install tox

script:
- tox -e $TOX_ENV
- tox -e $TOXENV

after_success:
- coveralls
3 changes: 2 additions & 1 deletion dj_elastictranscoder/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import unicode_literals

from django.db import models, migrations
import django.db.models.deletion


class Migration(migrations.Migration):
Expand All @@ -20,7 +21,7 @@ class Migration(migrations.Migration):
('message', models.TextField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('last_modified', models.DateTimeField(auto_now=True)),
('content_type', models.ForeignKey(to='contenttypes.ContentType')),
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
],
),
]
9 changes: 2 additions & 7 deletions dj_elastictranscoder/models.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
from django.db import models
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType

import django
if django.VERSION >= (1, 8):
from django.contrib.contenttypes.fields import GenericForeignKey
else:
from django.contrib.contenttypes.generic import GenericForeignKey


class EncodeJob(models.Model):
STATE_CHOICES = (
Expand All @@ -17,7 +12,7 @@ class EncodeJob(models.Model):
(4, 'Complete'),
)
id = models.CharField(max_length=100, primary_key=True)
content_type = models.ForeignKey(ContentType)
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
object_id = models.PositiveIntegerField()
state = models.PositiveIntegerField(choices=STATE_CHOICES, default=0, db_index=True)
content_object = GenericForeignKey()
Expand Down
49 changes: 0 additions & 49 deletions dj_elastictranscoder/south_migrations/0001_initial.py

This file was deleted.

Empty file.
36 changes: 9 additions & 27 deletions dj_elastictranscoder/urls.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
import django


if django.VERSION >= (1, 9):
from django.conf.urls import url
from dj_elastictranscoder import views

urlpatterns = [
url(r'^endpoint/$', views.aws_endpoint),
url(r'^aws_endpoint/$', views.aws_endpoint, name='aws_endpoint'),
url(r'^qiniu_endpoint/$', views.qiniu_endpoint, name='qiniu_endpoint'),
url(r'^aliyun_endpoint', views.aliyun_endpoint, name='aliyun_endpoint'),
]

else:
try:
from django.conf.urls import url, patterns
except ImportError:
from django.conf.urls.defaults import url, patterns # Support for Django < 1.4

urlpatterns = patterns(
'dj_elastictranscoder.views',
url(r'^endpoint/$', 'aws_endpoint'),
url(r'^aws_endpoint/$', 'aws_endpoint', name='aws_endpoint'),
url(r'^qiniu_endpoint/$', 'qiniu_endpoint', name='qiniu_endpoint'),
url(r'^aliyun_endpoint', 'aliyun_endpoint', name='aliyun_endpoint'),
)
from django.conf.urls import url
from dj_elastictranscoder import views

urlpatterns = [
url(r'^endpoint/$', views.aws_endpoint),
url(r'^aws_endpoint/$', views.aws_endpoint, name='aws_endpoint'),
url(r'^qiniu_endpoint/$', views.qiniu_endpoint, name='qiniu_endpoint'),
url(r'^aliyun_endpoint', views.aliyun_endpoint, name='aliyun_endpoint'),
]
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ def get_version():
zip_safe=False,
install_requires=[
"boto3 >= 1.1",
"django >= 1.3, < 2.0",
"django >= 1.11, < 3.0",
"qiniu >= 7.0.8",
],
classifiers=[
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
"Programming Language :: Python :: 3",
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
"Topic :: Software Development :: Libraries :: Python Modules",
"Environment :: Web Environment",
"Framework :: Django",
Expand Down
1 change: 0 additions & 1 deletion testsapp/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ pytest
pytest-django
pytest-cov
boto
south
4 changes: 2 additions & 2 deletions testsapp/tests_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
]
SITE_ID = 1
DEBUG = False
ROOT_URLCONF = ''
SECRET_KEY='test'
ROOT_URLCONF = 'dj_elastictranscoder.urls'
SECRET_KEY='test'
28 changes: 7 additions & 21 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,33 +1,19 @@
[tox]
# for py 3.x we are using only django 1.6.x as 1.5.x had only "experimental py3 support"
envlist =
py{27,py}-dj{14,15,16,17,18},
py{33,34}-dj{15,16,17,18},
py27-cov
envlist = py{35,36,37}-dj{20,21,22}
skipsdist = True
usedevelop = True

[testenv]
commands = {posargs:py.test --create-db -vv}
basepython =
py27: python2.7
py33: python3.3
py34: python3.4
pypy: pypy
py35: python3.5
py36: python3.6
py37: python3.7
deps =
-rtestsapp/requirements.txt
dj14: django>=1.4,<1.4.999
dj15: django>=1.5,<1.5.999
dj16: django>=1.6,<1.6.999
dj17: django>=1.7,<1.7.999
dj18: django>=1.8,<1.8.999
dj19: https://github.com/django/django/archive/master.tar.gz#egg=django
dj20: Django>=2.0,<2.1
dj21: Django>=2.1,<2.2
dj22: Django>=2.2,<3.0
setenv =
DJANGO_SETTINGS_MODULE = testsapp.tests_settings
PYTHONPATH = {toxinidir}/testsapp:{toxinidir}

[testenv:py27-cov]
commands = py.test --cov=dj_elastictranscoder
deps =
-rtestsapp/requirements.txt
django>=1.8,<1.8.999