Skip to content

Commit

Permalink
Merge d5d1de7 into 089e21a
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Dec 6, 2019
2 parents 089e21a + d5d1de7 commit 685cd6c
Show file tree
Hide file tree
Showing 24 changed files with 62 additions and 95 deletions.
69 changes: 18 additions & 51 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,29 @@
sudo: false
dist: xenial
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "pypy"
- "pypy3"
env:
matrix:
- DJANGO="Django>=1.4,<1.5"
- DJANGO="Django>=1.5,<1.6"
- DJANGO="Django>=1.6,<1.7"
- DJANGO="Django>=1.7,<1.8"
- DJANGO="Django>=1.8,<1.9"
- DJANGO="Django>=1.9,<1.10"
- DJANGO="--pre django"
install:
- pip install $DJANGO
- pip install coveralls
- pip install -r dev-requirements.txt
- pip install --upgrade -r dev-requirements.txt
script:
- inv test
- py.test --cov sudo --cov-report term-missing
after_success:
- coveralls
matrix:
fast_finish: true
exclude:
- python: "2.6"
env: DJANGO="Django>=1.7,<1.8"
- python: "2.6"
env: DJANGO="Django>=1.8,<1.9"
- python: "2.6"
include:
- name: 'Linter (Python 2.7)'
script: flake8 sudo tests
- python: "3.7"
name: 'Linter (Python 3.7)'
script: flake8 sudo tests
- python: "2.7"
name: "Python 2.7, Django 1.9"
env: DJANGO="Django>=1.9,<1.10"
- python: "2.6"
env: DJANGO="--pre django"
- python: "3.3"
env: DJANGO="Django>=1.4,<1.5"
- python: "3.3"
env: DJANGO="Django>=1.9,<1.10"
- python: "3.3"
env: DJANGO="--pre django"
- python: "3.4"
env: DJANGO="Django>=1.4,<1.5"
- python: "3.5"
env: DJANGO="Django>=1.4,<1.5"
- python: "3.5"
env: DJANGO="Django>=1.5,<1.6"
- python: "2.7"
name: "Python 2.7, Django 1.10"
env: DJANGO="Django>=1.10,<1.11"
- python: "3.5"
env: DJANGO="Django>=1.6,<1.7"
- python: "3.5"
env: DJANGO="Django>=1.7,<1.8"
- python: "pypy3"
env: DJANGO="Django>=1.4,<1.5"
- python: "pypy3"
name: "Python 3.5, Django 1.9"
env: DJANGO="Django>=1.9,<1.10"
- python: "pypy3"
env: DJANGO="--pre django"
allow_failures:
- env: DJANGO="--pre django"
- python: "3.5"
name: "Python 3.5, Django 1.10"
env: DJANGO="Django>=1.10,<1.11"
9 changes: 4 additions & 5 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
-e .
flake8<3.0
invoke>=0.11.1,<0.12
pytest
pytest-cov
pytest-django
sentry-flake8>=0.2.0,<0.3.0
pytest==4.6.5
pytest-cov==2.5.1
pytest-django==3.5.1
sphinx
sphinx_rtd_theme
tox
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[pytest]
[tool:pytest]
python_files = tests/*.py

[flake8]
Expand Down
2 changes: 2 additions & 0 deletions sudo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
:copyright: (c) 2014 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import

try:
VERSION = __import__('pkg_resources') \
.get_distribution('sudo').version
Expand Down
2 changes: 2 additions & 0 deletions sudo/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
:copyright: (c) 2014 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import

from functools import wraps

from sudo.views import redirect_to_sudo
Expand Down
2 changes: 2 additions & 0 deletions sudo/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
:copyright: (c) 2014 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import

from django import forms
from django.contrib import auth
from django.utils.translation import ugettext_lazy as _
Expand Down
2 changes: 2 additions & 0 deletions sudo/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
:copyright: (c) 2014 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import

from sudo.settings import (
COOKIE_DOMAIN, COOKIE_HTTPONLY, COOKIE_NAME,
COOKIE_PATH, COOKIE_SECURE, COOKIE_SALT,
Expand Down
2 changes: 2 additions & 0 deletions sudo/mixins.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import absolute_import

from sudo.decorators import sudo_required


Expand Down
2 changes: 2 additions & 0 deletions sudo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
:copyright: (c) 2014 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import

# Register signals automatically by installing the app
from sudo.signals import * # noqa
2 changes: 2 additions & 0 deletions sudo/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
:copyright: (c) 2014 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import

from django.contrib.auth.signals import user_logged_in, user_logged_out
from django.dispatch import receiver

Expand Down
2 changes: 2 additions & 0 deletions sudo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
:copyright: (c) 2014 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import

import unicodedata

from django.core.signing import BadSignature
Expand Down
2 changes: 2 additions & 0 deletions sudo/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
:copyright: (c) 2014 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import

try:
from urllib.parse import urlparse, urlunparse
except ImportError: # pragma: no cover
Expand Down
38 changes: 0 additions & 38 deletions tasks.py

This file was deleted.

1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from __future__ import absolute_import
2 changes: 2 additions & 0 deletions tests/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import absolute_import

try:
from django.utils import unittest
except ImportError:
Expand Down
2 changes: 2 additions & 0 deletions tests/decorators.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import absolute_import

from .base import BaseTestCase

from django.http import HttpResponse
Expand Down
2 changes: 2 additions & 0 deletions tests/forms.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import absolute_import

from .base import BaseTestCase
from .models import EmailUser

Expand Down
2 changes: 2 additions & 0 deletions tests/middleware.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import absolute_import

from .base import BaseTestCase

from django.http import HttpResponse
Expand Down
2 changes: 2 additions & 0 deletions tests/mixins.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import absolute_import

from .base import BaseTestCase
from django.http import HttpResponse
from django.views import generic
Expand Down
2 changes: 2 additions & 0 deletions tests/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import absolute_import

import django
from django.db import models
try:
Expand Down
2 changes: 2 additions & 0 deletions tests/signals.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import absolute_import

from .base import BaseTestCase
from sudo.signals import grant, revoke
from sudo.utils import has_sudo_privileges, grant_sudo_privileges
Expand Down
2 changes: 2 additions & 0 deletions tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import absolute_import

try:
from django.conf.urls import url, patterns
except ImportError:
Expand Down
2 changes: 2 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import absolute_import

from sudo.settings import COOKIE_NAME, COOKIE_AGE
from sudo.utils import (
grant_sudo_privileges,
Expand Down
2 changes: 2 additions & 0 deletions tests/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import absolute_import

from .base import BaseTestCase

from django.template.response import TemplateResponse
Expand Down

0 comments on commit 685cd6c

Please sign in to comment.