Skip to content

Commit 8f32a28

Browse files
authored
Support Django 4.1, 4.2 and Python 3.11 (#485)
* Support Django 4.1 and 4.2 and Python 3.11 * Upgrade to tox 4 * Update precommit isort * Suppress linting on Python 3.7
1 parent 790ec8b commit 8f32a28

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: ["3.7", "3.8", "3.9", "3.10"]
15+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
1616
steps:
1717
- uses: actions/checkout@v2
1818
- name: Set up Python ${{ matrix.python-version }}
@@ -24,7 +24,10 @@ jobs:
2424
python -m pip install --upgrade pip
2525
python -m pip install -r requirements/tests.txt
2626
python -m pip install -r requirements.txt
27-
- name: Linting
27+
# TODO: Remove this conditional when Python 3.7 is dropped and Flake8 executes on
28+
# all Python versions in matrix.
29+
- if: matrix.python-version == '3.8'
30+
name: Linting
2831
run: flake8
2932
# Environments are selected using tox-gh-actions configuration in tox.ini.
3033
- name: Test with tox

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ repos:
3333
hooks:
3434
- id: yesqa
3535
- repo: https://github.com/pycqa/isort
36-
rev: "5.10.1"
36+
rev: "5.12.0"
3737
hooks:
3838
- id: isort
3939
args: ["--profile", "black"]

dbbackup/tests/test_storage.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ def test_set_path(self):
2323
@patch("dbbackup.settings.STORAGE", DEFAULT_STORAGE_PATH)
2424
def test_set_options(self, *args):
2525
storage = get_storage(options=STORAGE_OPTIONS)
26-
self.assertEqual(storage.storage.__module__, "django.core.files.storage")
26+
self.assertIn(
27+
storage.storage.__module__,
28+
# TODO: Remove "django.core.files.storage" case when dropping support for Django < 4.2.
29+
("django.core.files.storage", "django.core.files.storage.filesystem"),
30+
)
2731

2832

2933
class StorageTest(TestCase):

requirements/build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
build
22
setuptools
3-
tox
3+
tox>=4.0.0
44
twine
55
wheel

requirements/tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ python-dotenv
99
python-gnupg>=0.5.0
1010
pytz
1111
testfixtures
12-
tox
12+
tox>=4.0.0
1313
tox-gh-actions

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def get_test_requirements():
5151
"Framework :: Django :: 2.2",
5252
"Framework :: Django :: 3.2",
5353
"Framework :: Django :: 4.0",
54+
"Framework :: Django :: 4.1",
55+
"Framework :: Django :: 4.2",
5456
"Intended Audience :: Developers",
5557
"Intended Audience :: System Administrators",
5658
"License :: OSI Approved :: BSD License",
@@ -61,6 +63,7 @@ def get_test_requirements():
6163
"Programming Language :: Python :: 3.8",
6264
"Programming Language :: Python :: 3.9",
6365
"Programming Language :: Python :: 3.10",
66+
"Programming Language :: Python :: 3.11",
6467
"Topic :: Database",
6568
"Topic :: System :: Archiving",
6669
"Topic :: System :: Archiving :: Backup",

tox.ini

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{37,38,39}-django22,py{37,38,39,310}-django{32,40,master},lint,docs,functional
2+
envlist = py{37,38,39}-django22,py{37,38,39,310,311}-django{32,40,41,42,master},lint,docs,functional
33

44
[testenv]
55
passenv = *
@@ -10,16 +10,19 @@ deps =
1010
django22: django>=2.2,<2.3
1111
django32: django>=3.2,<3.3
1212
django40: django>=4.0,<4.1
13+
django41: django>=4.1,<4.2
14+
django42: django>=4.2,<4.3
1315
djangomaster: https://github.com/django/django/archive/master.zip
1416
commands = {posargs:coverage run runtests.py}
1517

1618
# Configure which test environments are run for each Github Actions Python version.
1719
[gh-actions]
1820
python =
1921
3.7: py37-django{22,32},functional
20-
3.8: py38-django{22,32,40},functional
21-
3.9: py39-django{22,32,40},functional
22-
3.10: py310-django{22,32,40},functional
22+
3.8: py38-django{22,32,40,41,42},functional
23+
3.9: py39-django{22,32,40,41,42},functional
24+
3.10: py310-django{22,32,40,41,42},functional
25+
3.11: py311-django{40,41,42},functional
2326

2427
[testenv:lint]
2528
basepython = python
@@ -29,14 +32,14 @@ commands = prospector dbbackup -0
2932

3033
[testenv:docs]
3134
basepython = python
32-
whitelist_externals=make
35+
allowlist_externals=make
3336
deps = -rrequirements/docs.txt
3437
commands = make docs
3538

3639
[testenv:functional]
3740
basepython = python
3841
passenv = *
39-
whitelist_externals = bash
42+
allowlist_externals = bash
4043
deps =
4144
-rrequirements/tests.txt
4245
django
@@ -48,7 +51,7 @@ commands = {posargs:bash -x functional.sh}
4851
[testenv:functional-mongodb]
4952
basepython = python
5053
passenv = *
51-
whitelist_externals = bash
54+
allowlist_externals = bash
5255
deps =
5356
-rrequirements/tests.txt
5457
djongo

0 commit comments

Comments
 (0)