Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Upgrade Django support to updated versions
* Drop support for Django < 1.8, add support for 1.10+
* Add support for running tox locally with Docker
  • Loading branch information
dmkoch committed Mar 1, 2017
1 parent db09cbe commit 1e3012e
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 63 deletions.
91 changes: 91 additions & 0 deletions .dockerignore
@@ -0,0 +1,91 @@
# Git
.git
.gitignore

# CI
.codeclimate.yml
.travis.yml

# Docker
docker-compose.yml

# Byte-compiled / optimized / DLL files
__pycache__/
*/__pycache__/
*/*/__pycache__/
*/*/*/__pycache__/
*.py[cod]
*/*.py[cod]
*/*/*.py[cod]
*/*/*/*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Virtual environment
.env/
.venv/
venv/

# PyCharm
.idea

# Python mode for VIM
.ropeproject
*/.ropeproject
*/*/.ropeproject
*/*/*/.ropeproject

# Vim swap files
*.swp
*/*.swp
*/*/*.swp
*/*/*/*.swp
42 changes: 13 additions & 29 deletions .travis.yml
Expand Up @@ -2,50 +2,33 @@ language: python
sudo: false
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
env:
- DJANGO=1.4
- DJANGO=1.5
- DJANGO=1.6
- DJANGO=1.7
- DJANGO=1.8
- DJANGO=1.9
- DJANGO=1.10
- DJANGO=master
matrix:
exclude:
- python: "3.2"
env: DJANGO=1.4
- python: "3.2"
env: DJANGO=1.8
- python: "3.2"
env: DJANGO=1.9
- python: "3.2"
- python: "2.7"
env: DJANGO=master
- python: "3.3"
env: DJANGO=1.4
- python: "3.3"
env: DJANGO=1.8
- python: "3.3"
env: DJANGO=1.9
- python: "3.3"
env: DJANGO=1.10
- python: "3.3"
env: DJANGO=master
- python: "3.4"
env: DJANGO=1.4
- python: "3.4"
env: DJANGO=1.5
- python: "3.4"
env: DJANGO=1.6
- python: "3.5"
env: DJANGO=1.4
- python: "3.5"
env: DJANGO=1.5
- python: "3.5"
env: DJANGO=1.6
- python: "3.5"
env: DJANGO=1.7
env: DJANGO=master
- python: "3.6"
env: DJANGO=1.8
- python: "3.6"
env: DJANGO=1.9
- python: "3.6"
env: DJANGO=1.10
install:
- pip install tox coveralls
script:
Expand All @@ -57,3 +40,4 @@ notifications:
recipients:
- bjasper@gmail.com
- paltman@gmail.com
- dkoch@mm.st
3 changes: 3 additions & 0 deletions Dockerfile
@@ -0,0 +1,3 @@
FROM themattrix/tox

MAINTAINER Brad Jasper <bjasper@gmail.com>
28 changes: 21 additions & 7 deletions README.rst
Expand Up @@ -13,7 +13,7 @@ Python 3 & Django 1.8 supported!

**Note:** There are a couple of JSONField's for Django. This one is django-jsonfield here on GitHub but jsonfield on PyPi.

**Note:** Semvar is followed after the 1.0 released.
**Note:** Semver is followed after the 1.0 release.


Install
Expand Down Expand Up @@ -60,17 +60,29 @@ If you need to use your JSON field in an index or other constraint, you can use
Compatibility
--------------

django-jsonfield supports Python 2.7 to Python 3.4 and Django 1.4 to 1.8
django-jsonfield aims to support the same versions of Django currently maintained by the main Django project. See `Django supported versions`_, currently:

**Why doesn't it support Python 2.6?**
* Django 1.8 (LTS) with Python 2.7, 3.3, 3.4, or 3.5
* Django 1.9 with Python 2.7, 3.4, or 3.5
* Django 1.10 with Python 2.7, 3.4, or 3.5

You actually might be OK if you don't use an OrderedDict, but there are some issues with the simplejson API that make it cumbersome to support.
.. _Django supported versions: https://www.djangoproject.com/download/#supported-versions

**Why doesn't it support Django 1.3?**

There was a bug that could only be fixed by a feature in Django 1.4. `Read More`_ if you're interested in the details.
Testing django-jsonfield Locally
--------------------------------

.. _Read More: https://github.com/bradjasper/django-jsonfield/issues/33
To test against all supported versions of Django:

.. code-block:: shell
$ docker-compose build && docker-compose up
Or just one version (for example Django 1.10 on Python 3.5):

.. code-block:: shell
$ docker-compose build && docker-compose run tox tox -e py35-1.10
Travis CI
Expand All @@ -95,6 +107,8 @@ Email: `contact@bradjasper.com`_
Changes
-------

v2.0.0, 2/28/2017 -- Remove support for Django versions older than 1.8

v1.0.3, 2/23/2015 -- Added fix to setup.py to allow PIP install

v1.0.2, 2/9/2015 -- Re-added fix for south migration bug
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,4 @@
tox:
build: .
volumes:
- ".:/src:ro"
7 changes: 4 additions & 3 deletions setup.py
Expand Up @@ -35,8 +35,8 @@ def run(self):
url='https://github.com/bradjasper/django-jsonfield/',
description='A reusable Django field that allows you to store validated JSON in your model.',
long_description=open("README.rst").read(),
install_requires=['Django >= 1.4.3'],
tests_require=['Django >= 1.4.3'],
install_requires=['Django >= 1.8.0'],
tests_require=['Django >= 1.8.0'],
cmdclass={'test': TestCommand},
classifiers=[
'Environment :: Web Environment',
Expand All @@ -45,9 +45,10 @@ def run(self):
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Framework :: Django',
],
)
46 changes: 22 additions & 24 deletions tox.ini
@@ -1,34 +1,32 @@
[flake8]
# ignore = E265,E501
max-line-length = 115
max-complexity = 10
# exclude = migrations/*,docs/*

[tox]
envlist =
py27-{1.4,1.5,1.6,1.7,1.8,1.9,master},
py32-{1.5,1.6,1.7,1.8},
py33-{1.5,1.6,1.7,1.8},
py34-{1.7,1.8,1.9,master},
py35-{1.8,1.9,master}
py27-{1.8,1.9,1.10},
py33-{1.8},
py34-{1.8,1.9,1.10},
py35-{1.8,1.9,1.10,master},
py36-{master}
skipsdist = {env:TOXBUILD:false}

[testenv]
deps =
py{27,33,34,35}: coverage == 4.0.2
py32: coverage == 3.7.1
flake8 == 2.5.0
1.4: Django>=1.4,<1.5
1.5: Django>=1.5,<1.6
1.6: Django>=1.6,<1.7
1.7: Django>=1.7,<1.8
coverage==4.3.4
flake8==3.3.0
1.8: Django>=1.8,<1.9
1.9: Django>=1.9,<1.10
1.10: Django>=1.10,<1.11
master: https://github.com/django/django/tarball/master
usedevelop = True
setenv =
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=en_US.UTF-8
whitelist_externals =
true
commands =
flake8 jsonfield
coverage run setup.py test
{env:TOXBUILD:flake8 jsonfield}
{env:TOXBUILD:coverage run setup.py test}

[flake8]
# ignore = E265,E501
max-line-length = 115
max-complexity = 10
# exclude = migrations/*,docs/*

0 comments on commit 1e3012e

Please sign in to comment.