Skip to content

Commit

Permalink
Merge pull request #134 from uploadcare/update-tests
Browse files Browse the repository at this point in the history
Drop obsolete python and django versions from test suites
  • Loading branch information
dmitry-mukhin committed Mar 15, 2018
2 parents 87dae69 + 1cf39e3 commit 2e4b96d
Show file tree
Hide file tree
Showing 15 changed files with 92 additions and 76 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ docs/_build
*.pyc
.idea
.tox/
.cache/
.pytest_cache/
81 changes: 51 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,80 @@
# https://devguide.python.org/#branchstatus
# https://www.djangoproject.com/download/#supported-versions
# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django

sudo: false
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
env:
global:
- SUITE="tests/functional"
matrix:
- DJANGO=1.8
- DJANGO=1.9
- DJANGO=1.10
- DJANGO=1.11
- DJANGO=2.0
matrix:
include:
- python: 2.6
env: DJANGO=1.6

- python: 2.7
env: DJANGO=1.4
- python: 2.7
env: DJANGO=1.5
- python: 2.7
env: DJANGO=1.6
- python: 2.7
env: DJANGO=1.7
- python: 2.7
env: DJANGO=1.8
- python: 2.7
env: DJANGO=1.9
- python: 2.7
env: DJANGO=1.10
# django tests
- stage: django tests
python: 2.7
env:
- DJANGO=1.8
- SUITE="tests/dj"
- python: 2.7
env: DJANGO=1.11
env:
- DJANGO=1.11
- SUITE="tests/dj"

- python: 3.3
env: DJANGO=1.8
- python: 3.4
env:
- DJANGO=1.8
- SUITE="tests/dj"
- python: 3.4
env:
- DJANGO=1.11
- SUITE="tests/dj"
- python: 3.4
env:
- DJANGO=2.0
- SUITE="tests/dj"
- python: 3.5
env:
- DJANGO=1.8
- SUITE="tests/dj"
- python: 3.5
env:
- DJANGO=1.11
- SUITE="tests/dj"
- python: 3.5
env:
- DJANGO=2.0
- SUITE="tests/dj"
- python: 3.6
env:
- DJANGO=1.8
- SUITE="tests/dj"
- python: 3.6
env:
- DJANGO=1.11
- SUITE="tests/dj"
- python: 3.6
env:
- DJANGO=2.0
- SUITE="tests/dj"

# integration tests
- stage: integration tests
python: 2.7
env: DJANGO=1.10 SUITE="tests/integration"
env: SUITE="tests/integration"
- stage: integration tests
python: 3.5
env: DJANGO=1.10 SUITE="tests/integration"
env: SUITE="tests/integration"

cache:
directories:
- $HOME/.cache/pip
install:
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2; fi
- pip install django~=$DJANGO.0
- if [[ $DJANGO != '' ]]; then pip install django~=$DJANGO.0; fi
- pip install 'requests>=1.0' 'python-dateutil>=2.1' 'six>=1.2.0'
- pip install pytest-cov python-coveralls
- pip install -e .
Expand Down
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ History

- Add support for django versions 1.11 and ~2.0
- Miscellaneous updates(version, year in a license file, tox configuration and etc.)
- Drop official support for obsolete Python and Django versions.
Chances are that everything still works. If you have to use those, modify `tox.ini`,
run tests and use at your own risk ;) Or, you may use older versions of the library.

2.2.1
~~~~~
Expand Down
5 changes: 4 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,14 @@ Features
Requirements
------------

``pyuploadcare`` requires Python 2.6, 2.7, 3.3, 3.4, 3.5 or 3.6
``pyuploadcare`` requires Python 2.7, 3.4, 3.5 or 3.6.

If you're using ``pyuploadcare`` with Django, check ``.travis.yml`` for supported
Python-Django combinations.

Obsolete versions of Python and Django are officially not supported, but chances
are everything still works. If you have to use those, modify tox.ini, test and
run at your own risk ;) Or, you may use older versions of the library.

Installation
------------
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-e .

Django~=1.8
Django~=1.11

tox~=2.0
Sphinx==1.3.1
Expand Down
16 changes: 5 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
'six>=1.2.0',
]

if PY_VERSION == (2, 6):
requirements.append('argparse')

if PY_VERSION < (3, 0):
long_description = open('README.rst').read() + '\n\n' + open('HISTORY.rst').read()
long_description = (open('README.rst').read() + '\n\n' +
open('HISTORY.rst').read())
else:
long_description = open('README.rst', encoding='utf-8').read() + '\n\n' + open('HISTORY.rst', encoding='utf-8').read()
long_description = (open('README.rst', encoding='utf-8').read() + '\n\n' +
open('HISTORY.rst', encoding='utf-8').read())

setup(
name='pyuploadcare',
Expand All @@ -45,16 +44,11 @@
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Framework :: Django',
'Framework :: Django :: 1.4',
'Framework :: Django :: 1.5',
'Framework :: Django :: 1.6',
'Framework :: Django :: 1.7',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
Expand Down
Empty file added tests/dj/__init__.py
Empty file.
5 changes: 1 addition & 4 deletions tests/functional/test_forms.py → tests/dj/test_forms.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_project.settings'

Expand Down
5 changes: 1 addition & 4 deletions tests/functional/test_models.py → tests/dj/test_models.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
import os
import sys

Expand Down
5 changes: 1 addition & 4 deletions tests/functional/test_api.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_project.settings'
Expand Down
5 changes: 1 addition & 4 deletions tests/functional/test_api_resources.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
import datetime
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_project.settings'
Expand Down
5 changes: 1 addition & 4 deletions tests/functional/test_ucare_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
from __future__ import unicode_literals
import os
import json
try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
from tempfile import NamedTemporaryFile

from mock import patch, MagicMock, Mock
Expand Down
5 changes: 1 addition & 4 deletions tests/integration/test_api_resources.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
from tempfile import NamedTemporaryFile
from datetime import datetime
import time
Expand Down
5 changes: 1 addition & 4 deletions tests/integration/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# coding: utf-8
from __future__ import unicode_literals
import os
try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
from tempfile import NamedTemporaryFile

from pyuploadcare import conf
Expand Down
24 changes: 19 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
# https://devguide.python.org/#branchstatus
# https://www.djangoproject.com/download/#supported-versions
# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django

[tox]
envlist=py26-dj1.6,py27-dj1.{4,5,6,7,8,9,10,11},py{33}-dj1.8,py3{4,5,6}-dj{1.8,1.9,1.10,1.11,2.0}
envlist=
# core lib tests
py{27,34,35,36}-api,
# old django versions
py27-dj1.{4,5,6,7,9,10}-django
py34-dj1.7-django
py35-dj1.{9,10}-django
# current django versions
py{27,34,35.36}-dj1.{8,11}-django
py{34,35,36}-dj2.0-django
# integration tests
py27-integration

[testenv]
basepython =
py26: python2.6
py27: python2.7
py33: python3.3
py34: python3.4
py35: python3.5
py36: python3.6
deps =
pytest
mock
py26: unittest2
dj1.4: Django~=1.4.0
dj1.5: Django~=1.5.0
dj1.6: Django~=1.6.0
Expand All @@ -23,4 +35,6 @@ deps =
dj1.11: Django~=1.11.0
dj2.0: Django~=2.0.0
commands =
py.test tests
api: py.test tests/functional
django: py.test tests/dj
integration: py.test tests/integration

0 comments on commit 2e4b96d

Please sign in to comment.