Skip to content

Commit e12b356

Browse files
authored
Merge pull request #186 from browniebroke/upgrade-drf-315
Add support for DRF 3.15, drop Django <4.2 and DRF <3.14
2 parents 6b24fae + fc2a87f commit e12b356

File tree

5 files changed

+23
-44
lines changed

5 files changed

+23
-44
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
strategy:
11+
fail-fast: false
1112
matrix:
1213
include:
13-
- python-version: 3.7
1414
- python-version: 3.8
1515
- python-version: 3.9
1616
- python-version: "3.10"
1717
- python-version: "3.11"
18+
- python-version: "3.12"
1819

1920
env:
2021
PYTHON: ${{ matrix.python-version }}
@@ -32,7 +33,7 @@ jobs:
3233
- name: Test with tox
3334
run: tox
3435
- name: Upload coverage to Codecov
35-
uses: codecov/codecov-action@v2
36+
uses: codecov/codecov-action@v4
3637
with:
3738
token: ${{ secrets.CODECOV_TOKEN }}
3839
env_vars: PYTHON

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ The following relations are supported:
1717
Requirements
1818
============
1919

20-
- Python (3.7, 3.8, 3.9, 3.10, 3.11)
21-
- Django (2.2, 3.0, 3.1, 3.2, 4.0, 4.1, 4.2)
22-
- djangorestframework (3.8+)
20+
- Python (3.8, 3.9, 3.10, 3.11, 3.12)
21+
- Django (4.2, 5.0)
22+
- djangorestframework (3.14+)
2323

2424
Installation
2525
============

setup.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,24 @@ def get_version(package):
3939
},
4040
include_package_data=True,
4141
zip_safe=False,
42-
python_requires='>=3.7',
42+
python_requires='>=3.8',
4343
classifiers=[
4444
'Development Status :: 4 - Beta',
4545
'Environment :: Web Environment',
4646
'Framework :: Django',
47-
'Framework :: Django :: 2.2',
48-
'Framework :: Django :: 3.0',
49-
'Framework :: Django :: 3.1',
50-
'Framework :: Django :: 3.2',
51-
'Framework :: Django :: 4.0',
52-
'Framework :: Django :: 4.1',
5347
'Framework :: Django :: 4.2',
48+
'Framework :: Django :: 5.0',
5449
'Intended Audience :: Developers',
5550
'License :: OSI Approved :: BSD License',
5651
'Operating System :: OS Independent',
5752
'Programming Language :: Python',
5853
'Programming Language :: Python :: 3',
5954
'Programming Language :: Python :: 3 :: Only',
60-
'Programming Language :: Python :: 3.7',
6155
'Programming Language :: Python :: 3.8',
6256
'Programming Language :: Python :: 3.9',
6357
'Programming Language :: Python :: 3.10',
6458
'Programming Language :: Python :: 3.11',
59+
'Programming Language :: Python :: 3.12',
6560
'Topic :: Internet :: WWW/HTTP',
6661
]
6762
)

tests/serializers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,10 @@ class Meta:
202202
class UFMChildSerializerForValidatorMessage(UniqueFieldsMixin,
203203
serializers.ModelSerializer):
204204
field = serializers.CharField(validators=[
205-
UniqueValidator(queryset=models.UFMChild.objects.all(),
206-
message=UNIQUE_ERROR_MESSAGE
207-
)
205+
UniqueValidator(
206+
queryset=models.UFMChild.objects.all(), # type: ignore[attr-defined]
207+
message=UNIQUE_ERROR_MESSAGE,
208+
)
208209
])
209210

210211
class Meta:

tox.ini

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,34 @@ DJANGO_SETTINGS_MODULE = tests.settings
44

55
[tox]
66
envlist =
7-
py{37,38}-dj{22}-drf{38,39,310,311}-{pytest,mypy}
8-
py{37,38}-dj{30}-drf{310,311}-{pytest,mypy}
9-
py{37,38,39,310,311}-dj{31,32}-drf{311,312,313,314}-{pytest,mypy}
10-
py{38,39,310,311}-dj{40,41}-drf{313,314}-{pytest,mypy}
11-
py{38,39,310,311}-dj{42}-drf{314}-{pytest,mypy}
7+
py{38,39,310,311,312}-dj42-drf{314,315}-pytest
8+
py{310,311,312}-dj50-drf{314,315}-pytest
9+
py312-dj50-drf315-mypy
1210
skip_missing_interpreters = true
1311

1412
[gh-actions]
1513
python =
16-
3.7: py37
1714
3.8: py38
1815
3.9: py39
1916
3.10: py310
2017
3.11: py311
18+
3.12: py312
2119
django =
22-
2.2: dj22
23-
3.0: dj30
24-
3.1: dj31
25-
3.2: dj32
26-
4.0: dj40
27-
4.1: dj41
2820
4.2: dj42
21+
5.0: dj50
2922

3023
[testenv]
3124
setenv =
3225
PYTHONDONTWRITEBYTECODE=1
3326
PYTHONWARNINGS=once
3427
deps =
35-
dj22: Django>=2.2,<2.3
36-
dj30: Django>=3.0,<3.1
37-
dj31: Django>=3.1,<3.2
38-
dj32: Django>=3.2a1,<4.0
39-
dj40: Django>=4.0,<4.1
40-
dj41: Django>=4.1,<4.2
4128
dj42: Django>=4.2,<5.0
42-
drf38: djangorestframework>=3.8.0,<3.9
43-
drf39: djangorestframework>=3.9.0,<3.10
44-
drf310: djangorestframework>=3.10.0,<3.11
45-
drf311: djangorestframework>=3.11,<3.12
46-
drf312: djangorestframework>=3.12,<3.13
47-
drf313: djangorestframework>=3.13,<3.14
29+
dj50: Django>=5.0,<5.1
4830
drf314: djangorestframework>=3.14,<3.15
31+
drf315: djangorestframework>=3.15,<3.16
4932
pytest: -rrequirements.txt
50-
mypy: git+https://github.com/typeddjango/djangorestframework-stubs.git@946c7d60aaecdc9ef307f5e1f8eb55f7083ffb16#egg=djangorestframework-stubs
51-
mypy: djangorestframework-stubs
33+
mypy: djangorestframework-stubs[compatible-mypy]>=3.15,<3.16
5234
commands=
5335
pytest: pytest --cov drf_writable_nested --cov-report=xml
54-
mypy: mypy example
55-
mypy: mypy .
36+
mypy: mypy --show-traceback example
37+
mypy: mypy --show-traceback .

0 commit comments

Comments
 (0)