Skip to content

Commit

Permalink
Test Django 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfischer committed Jan 17, 2017
1 parent bf63084 commit c30cbde
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 21 deletions.
12 changes: 5 additions & 7 deletions .travis.yml
Expand Up @@ -8,16 +8,14 @@ python:
- "3.5"

env:
- DJANGO="Django<1.9"
- DJANGO="Django<1.10"
- DJANGO_VERSION="Django<1.9"
- DJANGO_VERSION="Django<1.10"
- DJANGO_VERSION="Django<1.11"

install:
- pip install -q $DJANGO
- pip install -q $DJANGO_VERSION
- pip install flake8

before_script:
- chmod +x runtravis.sh

script:
- flake8 --ignore=E501,W391 rpc4django
- ./runtravis.sh
- ./runtravis.py
4 changes: 2 additions & 2 deletions README.rst
Expand Up @@ -8,8 +8,8 @@ RPC4Django
Prerequisites
-------------

- Python_ 2.6, 2.7, 3.3
- Django_ 1.4+
- Python_ 2.7, 3.3+
- Django_ 1.8+
- DefusedXML_
- Docutils_ (optional)

Expand Down
4 changes: 2 additions & 2 deletions docs/setup.txt
Expand Up @@ -6,8 +6,8 @@ Prerequisites

RPC4Django has been tested on Mac OS, Linux and Windows.

- Python_ 2.6, 2.7, 3.3
- Django_ 1.4+
- Python_ 2.7, 3.3+
- Django_ 1.8+
- DefusedXML_
- Docutils_ (optional)

Expand Down
34 changes: 34 additions & 0 deletions runtravis.py
@@ -0,0 +1,34 @@
#!/usr/bin/env python

import os
import subprocess
import sys

# Handle incompatible versions of Python & Django
# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
SUPPORTED_VERSIONS = {
'2.7': ('Django<1.9', 'Django<1.10', 'Django<1.11'),
'3.3': ('Django<1.9',),
'3.4': ('Django<1.9', 'Django<1.10', 'Django<1.11'),
'3.5': ('Django<1.9', 'Django<1.10', 'Django<1.11'),
}

python_version = os.environ.get('TRAVIS_PYTHON_VERSION')
django_version = os.environ.get('DJANGO_VERSION')

if not python_version:
sys.exit(u'Unknown python version: {}'.format(python_version))
if not django_version:
sys.exit(u'Unknown django version: {}'.format(django_version))

if python_version in SUPPORTED_VERSIONS:
# If the version of Django is not supported with this version of
# Python simply exit the tests with a success
if django_version not in SUPPORTED_VERSIONS[python_version]:
print(u'Incompatible Python/Django versions - ignoring')
else:
p = subprocess.Popen(['python', 'setup.py', 'test'])
p.communicate()
sys.exit(p.returncode)
else:
sys.exit(u'Unsupported python version: {}'.format(python_version))
10 changes: 0 additions & 10 deletions runtravis.sh

This file was deleted.

0 comments on commit c30cbde

Please sign in to comment.