Skip to content

Commit

Permalink
Test on Django 2.2
Browse files Browse the repository at this point in the history
- Added Django 2.2 to test matrix
- Remove Django 2.0 from test matrix, end of support was April 2019
- Add migrations to test models to placate Django 2.2
- Update trove classifiers

No code changes required to two_factor itself
  • Loading branch information
moggers87 committed Jun 7, 2019
1 parent 5732543 commit 1813199
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 36 deletions.
65 changes: 37 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,82 @@ language: python
dist: xenial

python:
- 2.7
- 3.4
- 3.5
- 3.6
- 3.7

env:
- DJANGO=1.11 VARIANT=normal
- DJANGO=2.0 VARIANT=normal
- DJANGO=2.1 VARIANT=normal
- DJANGO=2.2 VARIANT=normal
- DJANGO=master VARIANT=normal

matrix:
include:
- python: 3.6
- python: 2.7
env: DJANGO=1.11 VARIANT=normal
- python: 2.7
env: DJANGO=1.11 VARIANT=yubikey
- python: 3.6
- python: 2.7
env: DJANGO=1.11 VARIANT=custom_user
- python: 3.7
- python: 3.4
env: DJANGO=1.11 VARIANT=normal
- python: 3.4
env: DJANGO=1.11 VARIANT=yubikey
- python: 3.7
- python: 3.4
env: DJANGO=1.11 VARIANT=custom_user
- python: 3.4
env: DJANGO=1.11 VARIANT=normal
- python: 3.5
env: DJANGO=1.11 VARIANT=yubikey
- python: 3.5
env: DJANGO=1.11 VARIANT=custom_user

- python: 3.6
env: DJANGO=2.0 VARIANT=yubikey
env: DJANGO=1.11 VARIANT=normal
- python: 3.6
env: DJANGO=2.0 VARIANT=custom_user
env: DJANGO=1.11 VARIANT=yubikey
- python: 3.6
env: DJANGO=1.11 VARIANT=custom_user
- python: 3.7
env: DJANGO=2.0 VARIANT=yubikey
env: DJANGO=1.11 VARIANT=normal
- python: 3.7
env: DJANGO=2.0 VARIANT=custom_user
env: DJANGO=1.11 VARIANT=yubikey
- python: 3.7
env: DJANGO=1.11 VARIANT=custom_user

- python: 3.5
env: DJANGO=2.1 VARIANT=normal
- python: 3.5
env: DJANGO=2.1 VARIANT=yubikey
- python: 3.5
env: DJANGO=2.1 VARIANT=custom_user
- python: 3.6
env: DJANGO=2.1 VARIANT=normal
- python: 3.6
env: DJANGO=2.1 VARIANT=yubikey
- python: 3.6
env: DJANGO=2.1 VARIANT=custom_user
- python: 3.7
env: DJANGO=2.1 VARIANT=normal
- python: 3.7
env: DJANGO=2.1 VARIANT=yubikey
- python: 3.7
env: DJANGO=2.1 VARIANT=custom_user

- python: 3.5
env: DJANGO=master VARIANT=normal
env: DJANGO=2.2 VARIANT=yubikey
- python: 3.5
env: DJANGO=2.2 VARIANT=custom_user
- python: 3.6
env: DJANGO=2.2 VARIANT=yubikey
- python: 3.6
env: DJANGO=2.2 VARIANT=custom_user
- python: 3.7
env: DJANGO=2.2 VARIANT=yubikey
- python: 3.7
env: DJANGO=2.2 VARIANT=custom_user

- python: 3.5
env: DJANGO=master VARIANT=yubikey
- python: 3.5
env: DJANGO=master VARIANT=custom_user
- python: 3.6
env: DJANGO=master VARIANT=normal
- python: 3.6
env: DJANGO=master VARIANT=yubikey
- python: 3.6
env: DJANGO=master VARIANT=custom_user
- python: 3.7
env: DJANGO=master VARIANT=normal
- python: 3.7
env: DJANGO=master VARIANT=yubikey
- python: 3.7
Expand All @@ -75,10 +88,6 @@ matrix:
- python: 3.5
env: TOXENV=flake8

exclude:
- python: 2.7
env: DJANGO=2.0 VARIANT=normal

allow_failures:
- env: DJANGO=master VARIANT=normal
- env: DJANGO=master VARIANT=yubikey
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ user. Although the package is optional, it improves account security control
over ``django.contrib.sessions``.

Compatible with modern Django versions. At the moment of writing that's
including 1.11 and 2.0 on Python 2.7, 3.4, 3.5, 3.6 and 3.7. Documentation is
including 1.11, 2.1, and 2.2 on Python 2.7, 3.4, 3.5, 3.6 and 3.7. Documentation is
available at `readthedocs.org`_.


Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Requirements

Django
------
Modern Django versions are supported. Currently this list includes Django 1.11
and 2.0.
Modern Django versions are supported. Currently this list includes Django 1.11,
2.1, and 2.2.

Python
------
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
exclude = build,dist,docs,.git,.tox,./two_factor/migrations/*.py,./two_factor/views/__init__.py
exclude = build,dist,docs,.git,.tox,./two_factor/migrations/*.py,./two_factor/views/__init__.py,./tests/migrations/*
ignore = E123,E128,E265,E266,E402,E501,E731,W503,W504,W601
max-line-length = 119

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
Expand All @@ -41,6 +41,7 @@
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Security',
'Topic :: System :: Systems Administration :: Authentication/Directory',
],
Expand Down
39 changes: 39 additions & 0 deletions tests/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 2.2.2 on 2019-06-07 16:07

import tests.models
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
('auth', '0001_initial'),
]

if settings.AUTH_USER_MODEL == "tests.User":
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('email', models.EmailField(blank=True, max_length=254, unique=True)),
('is_staff', models.BooleanField(default=False)),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
],
options={
'abstract': False,
},
managers=[
('objects', tests.models.UserManager()),
],
),
]
else:
operations = []
Empty file added tests/migrations/__init__.py
Empty file.
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
minversion = 1.8
envlist =
py{27,34,35,36,37}-dj111-{normal,yubikey,custom_user},
py{34,35,36,37}-dj20-{normal,yubikey,custom_user},
py{35,36,37}-dj21-{normal,yubikey,custom_user},
py{35,36,37}-dj22-{normal,yubikey,custom_user},
py{35,36,37}-djmaster-{normal,yubikey,custom_user},
flake8
skipsdist = True
Expand All @@ -15,8 +15,8 @@ unignore_outcomes = True
[travis:env]
DJANGO =
1.11: dj111
2.0: dj20
2.1: dj21
2.2: dj22
master: djmaster
VARIANT =
normal: normal
Expand All @@ -36,8 +36,8 @@ basepython =
deps =
py27: mock
dj111: Django<1.12
dj20: Django<2.1
dj21: Django>=2.1b1,<2.2
dj22: Django<2.3
djmaster: https://github.com/django/django/archive/master.tar.gz
yubikey: django-otp-yubikey
coverage
Expand Down

0 comments on commit 1813199

Please sign in to comment.