diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 2da695e..239946a 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -7,28 +7,27 @@ on:
jobs:
build:
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-20.04
strategy:
matrix:
python:
- - "2.7"
- - "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- - pypy-2.7
+ - "3.12"
- pypy-3.6
- pypy-3.7
- pypy-3.8
- pypy-3.9
+ - pypy-3.10
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python }}
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install tox and any other packages
diff --git a/README.rst b/README.rst
index 103729a..76dcb5c 100644
--- a/README.rst
+++ b/README.rst
@@ -42,9 +42,9 @@ Installation and usage
The following requirements are supported and tested in all reasonable
combinations:
-- Python versions: 2.7, 3.5–3.11
+- Python versions: 3.6–3.12
- Interpreters: CPython and PyPy.
-- Django versions: 1.11–4.1
+- Django versions: 1.11–5.0
.. code:: shell
@@ -130,4 +130,4 @@ License
The MPL 2.0 License
-Copyright (c) 2019-2023 `Friedel Wolff `_.
+Copyright (c) 2019-2024 `Friedel Wolff `_.
diff --git a/compression_middleware/middleware.py b/compression_middleware/middleware.py
index 9d6062f..a586288 100644
--- a/compression_middleware/middleware.py
+++ b/compression_middleware/middleware.py
@@ -18,7 +18,7 @@
from .br import brotli_compress, brotli_compress_stream
from .zstd import zstd_compress, zstd_compress_stream
-from django.middleware.gzip import (
+from django.utils.text import (
compress_string as gzip_compress,
compress_sequence as gzip_compress_stream,
)
diff --git a/setup.py b/setup.py
index 7e5643a..36f4542 100644
--- a/setup.py
+++ b/setup.py
@@ -36,20 +36,22 @@
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1',
+ 'Framework :: Django :: 4.2',
+ 'Framework :: Django :: 5.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
- 'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
+ 'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware',
+ 'Topic :: Internet :: WWW/HTTP :: ASGI :: Middleware',
]
)
diff --git a/tox.ini b/tox.ini
index 8dcf641..a70c0cc 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,14 +1,15 @@
[tox]
envlist =
- {py27}-django111-{brotlipy,Brotli}
- {pypy}-django111-{brotlipy,Brotli}
- py{34,35,36,37,py35,py36,py37}-django{111,20}-{brotlipy,Brotli}
- py{35,36,37,py35,py36,py37}-django{21,22}-{brotlipy,Brotli}
- py{38,py38}-django22-{brotlipy,Brotli}
- py{36,37,38,39,py36,py37,py38,py39}-django{30,31,32}-{brotlipy,Brotli}
- py310-django32-{brotlipy,Brotli}
- py{38,39,310,py38,py39}-django{40,41}-{brotlipy,Brotli}
- py311-django41-{brotlipy,Brotli}
+ py{36,37,py36,py37}-django111-{brotlipy,Brotli}
+ py{36,37,py36,py37}-django20-{brotlipy,Brotli}
+ py{36,37,py36,py37}-django21-{brotlipy,Brotli}
+ py{36,37,38,py36,py37,py38}-django22-{brotlipy,Brotli}
+ py{36,37,38,39,py36,py37,py38,py39}-django{30,31}-{brotlipy,Brotli}
+ py{36,37,38,39,310,py36,py37,py38,py39,py310}-django32-{brotlipy,Brotli}
+ py{38,39,310,py38,py39,py310}-django40-{brotlipy,Brotli}
+ py{38,39,310,311,py38,py39,py310}-django41-{brotlipy,Brotli}
+ py{38,39,310,311,312,py38,py39,py310}-django42-{brotlipy,Brotli}
+ py{310,311,312,py310}-django50-{brotlipy,Brotli}
skip_missing_interpreters = true
[testenv]
setenv =
@@ -24,6 +25,8 @@ deps =
django32: Django>=3.2, < 4.0
django40: Django>=4.0, < 4.1
django41: Django>=4.1, < 4.2
+ django42: Django>=4.2, < 4.3
+ django50: Django>=5.0, < 5.1
pytest>=3.1
zstandard
brotlipy: brotlipy
@@ -31,16 +34,15 @@ deps =
[gh-actions]
python =
- 2.7: py27
- 3.5: py35
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
- pypy-2.7: pypy
+ 3.12: py312
pypy-3.6: pypy36
pypy-3.7: pypy37
pypy-3.8: pypy38
pypy-3.9: pypy39
+ pypy-3.10: pypy310