[PATCH 02/11] tox: Update versions of Django to be tested

Finucane, Stephen stephen.finucane at intel.com
Wed Aug 19 23:36:30 AEST 2015


> On Tue, Jun 30, 2015 at 09:52:00AM +0100, Stephen Finucane wrote:
> > Since patchwork now supports Django 1.8 and no longer support 1.5, we
> > should update the tox targets to validate this new subset of supported
> > Django versions.
> >
> > In addition, the paths to the requirements.txt files were not updated
> > as part of a rebase. Correct this oversight.
> >
> > Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
> 
> A few comments based on the latest tree and the tries to make it work
> for me locally:
> 
> - Because patchwork is now using migrations, we should restrict django
>   to 1.7+?
>   I appreciate that people may still have django 1.6 around, but that
>   means will need to maintain both manual SQL statements and the django
>   1.7+ migrations. Sounds like a good idea to have a cut off?

I'd completely agree with this *but* it shouldn't be done as part of this series (which focuses on improving code coverage/quality). Fortunately it's very easy to generate the SQL statements and it seems Jeremy has been doing this (see tag feature). I also took this approach as part of the 'status-api' changes.

When we do deprecate stuff, 1.6 can be done immediately (it's reached EOL) and we should also look at 1.7 before long (support ends in October).

> - "By default tox will only pass the PATH environment variable"
>   https://testrun.org/tox/latest/example/basic.html#passing-down-
> environment-variables
> 
>   Given that the dev settings using env variables for the dev db
>   user/password, we want to be able to setup those variables and then
>   call tox:
> 
> +passenv =
> +    PW_TEST_DB_USER
> +    PW_TEST_DB_PASS

Good spot. IIRC this is a recent change in tox (I've seen issues pop up lately during OpenStack development). I'll add this in a v2.

> - I'd also argue "django 1.7.x" is better expressed as >=1.7,<1.8 :)

Tomato-tomaaato :)

> > ---
> >  docs/requirements-base.txt |  2 +-
> >  docs/requirements-prod.txt |  2 +-
> >  tox.ini                    | 38 ++++++++++++++++++--------------------
> >  3 files changed, 20 insertions(+), 22 deletions(-)
> >
> > diff --git a/docs/requirements-base.txt b/docs/requirements-base.txt
> > index 77dc829..58b34ec 100644
> > --- a/docs/requirements-base.txt
> > +++ b/docs/requirements-base.txt
> > @@ -1,2 +1,2 @@
> > +MySQL-python==1.2.5
> >  python-dateutil==1.5
> > -Django<1.8,>=1.7
> > diff --git a/docs/requirements-prod.txt b/docs/requirements-prod.txt
> > index 24f97ce..f2c440a 100644/
> > --- a/docs/requirements-prod.txt
> > +++ b/docs/requirements-prod.txt
> > @@ -1,2 +1,2 @@
> > -MySQL-python==1.2.5
> > +Django<1.9,>=1.8
> >  -r requirements-base.txt
> > diff --git a/tox.ini b/tox.ini
> > index 485f7c7..11d8b67 100644
> > --- a/tox.ini
> > +++ b/tox.ini
> > @@ -1,9 +1,23 @@
> >  [tox]
> > -envlist = {py27}-django{15,16,17}, pep8
> > +envlist = {py27}-django{16,17,18}
> >  skipsdist = True
> >
> > +[testenv]
> > +basepython =
> > +    py27: python2.7
> > +deps =
> > +    -r{toxinidir}/docs/requirements-dev.txt
> > +    django16: django<1.7,>=1.6
> > +    django17: django<1.8,>=1.7
> > +    django18: django<1.9,>=1.8
> > +setenv =
> > +    DJANGO_SETTINGS_MODULE = patchwork.settings.dev
> > +commands =
> > +    {toxinidir}/manage.py test '{posargs:patchwork}'
> > +
> >  [testenv:pep8]
> > -deps = flake8
> > +basepython = python2.7
> > +deps = flake
> >  commands = flake8 {posargs}
> >
> >  [flake8]
> > @@ -14,33 +28,17 @@ exclude = ./patchwork/tests
> >  basepython = python2.7
> >  deps =
> >      pylint
> > -    -r{toxinidir}/docs/requirements-django-1.7-mysql.txt
> > +    -r{toxinidir}/docs/requirements-prod.txt
> >  commands = pylint patchwork --rcfile=pylint.rc
> >
> >  [testenv:coverage]
> >  basepython = python2.7
> >  deps =
> >      coverage
> > -    -r{toxinidir}/docs/requirements-django-1.6-mysql.txt
> > +    -r{toxinidir}/docs/requirements-prod.txt
> >  setenv =
> >      DJANGO_SETTINGS_MODULE = patchwork.settings.dev
> >  commands =
> >      coverage erase
> > -    {toxinidir}/manage.py syncdb
> >      coverage run --omit=*tox* --branch {toxinidir}/manage.py test
> patchwork
> >      coverage report -m
> > -
> > -[testenv]
> > -basepython =
> > -    py27: python2.7
> > -commands =
> > -    {toxinidir}/manage.py syncdb
> > -    {toxinidir}/manage.py test patchwork
> > -deps =
> > -    python-dateutil==1.5
> > -    MySQL-python==1.2.5
> > -    django15: django<1.6,>=1.5
> > -    django16: django<1.7,>=1.6
> > -    django17: django<1.8,>=1.7
> > -setenv =
> > -    DJANGO_SETTINGS_MODULE = patchwork.settings.dev
> > --
> > 2.0.0
> >
> > _______________________________________________
> > Patchwork mailing list
> > Patchwork at lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/patchwork


More information about the Patchwork mailing list