Add support for Python 3.9

This commit is contained in:
Hasan Ramezani 2020-11-23 18:54:00 +01:00
parent cc06ab33fd
commit 9a322c4729
7 changed files with 16 additions and 4 deletions

View file

@ -5,6 +5,7 @@ python:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- pypy3
services:
- redis-server

View file

@ -108,7 +108,7 @@ Admin pages
Requirements
------------
* Python: 3.6, 3.7, 3.8, PyPy
* Python: 3.6, 3.7, 3.8, 3.9, PyPy
* Django: 2.2, 3.x
* Redis

View file

@ -3,7 +3,7 @@ from django.test.testcases import TestCase, TransactionTestCase
from .connection import get_redis_connection
class DefenderTestCaseMixin(object):
class DefenderTestCaseMixin:
"""Mixin used to provide a common tearDown method"""
def tearDown(self):

View file

@ -1,6 +1,9 @@
import os
import django
from celery import Celery
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:",}}
@ -42,6 +45,8 @@ TEMPLATES = [
},
},
]
if django.VERSION > (3, 1):
TEMPLATES[0]["OPTIONS"]["context_processors"].append("django.template.context_processors.request")
SECRET_KEY = os.environ.get("SECRET_KEY", "too-secret-for-test")

View file

@ -1,4 +1,6 @@
import os
import django
from celery import Celery
@ -47,6 +49,8 @@ TEMPLATES = [
},
},
]
if django.VERSION > (3, 1):
TEMPLATES[0]["OPTIONS"]["context_processors"].append("django.template.context_processors.request")
SECRET_KEY = os.environ.get("SECRET_KEY", "too-secret-for-test")

View file

@ -44,6 +44,7 @@ setup(
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
@ -60,7 +61,7 @@ setup(
packages=find_packages(),
package_data=get_package_data("defender"),
python_requires='~=3.5',
install_requires=["Django>=1.8,<3.2", "redis<3.6"],
install_requires=["Django>=2.2,<3.2", "redis<3.6"],
tests_require=[
"mockredispy>=2.9.0.11,<3.0",
"coverage",

View file

@ -1,7 +1,7 @@
[tox]
envlist =
# list of supported Django/Python versioons:
py{36,37,38,py3}-django{22,30,31,master}
py{36,37,38,39,py3}-django{22,30,31,master}
py38-{lint,docs}
[travis]
@ -9,6 +9,7 @@ python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
pypy3: pypy3
[testenv]