Skip to content

Commit

Permalink
Merge pull request #186 from browniebroke/upgrade-drf-315
Browse files Browse the repository at this point in the history
Add support for DRF 3.15, drop Django <4.2 and DRF <3.14
  • Loading branch information
ruscoder authored Oct 29, 2024
2 parents 6b24fae + fc2a87f commit e12b356
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 44 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: 3.7
- python-version: 3.8
- python-version: 3.9
- python-version: "3.10"
- python-version: "3.11"
- python-version: "3.12"

env:
PYTHON: ${{ matrix.python-version }}
Expand All @@ -32,7 +33,7 @@ jobs:
- name: Test with tox
run: tox
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ The following relations are supported:
Requirements
============

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

Installation
============
Expand Down
11 changes: 3 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,24 @@ def get_version(package):
},
include_package_data=True,
zip_safe=False,
python_requires='>=3.7',
python_requires='>=3.8',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'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 :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'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',
'Topic :: Internet :: WWW/HTTP',
]
)
7 changes: 4 additions & 3 deletions tests/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,10 @@ class Meta:
class UFMChildSerializerForValidatorMessage(UniqueFieldsMixin,
serializers.ModelSerializer):
field = serializers.CharField(validators=[
UniqueValidator(queryset=models.UFMChild.objects.all(),
message=UNIQUE_ERROR_MESSAGE
)
UniqueValidator(
queryset=models.UFMChild.objects.all(), # type: ignore[attr-defined]
message=UNIQUE_ERROR_MESSAGE,
)
])

class Meta:
Expand Down
38 changes: 10 additions & 28 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,34 @@ DJANGO_SETTINGS_MODULE = tests.settings

[tox]
envlist =
py{37,38}-dj{22}-drf{38,39,310,311}-{pytest,mypy}
py{37,38}-dj{30}-drf{310,311}-{pytest,mypy}
py{37,38,39,310,311}-dj{31,32}-drf{311,312,313,314}-{pytest,mypy}
py{38,39,310,311}-dj{40,41}-drf{313,314}-{pytest,mypy}
py{38,39,310,311}-dj{42}-drf{314}-{pytest,mypy}
py{38,39,310,311,312}-dj42-drf{314,315}-pytest
py{310,311,312}-dj50-drf{314,315}-pytest
py312-dj50-drf315-mypy
skip_missing_interpreters = true

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
django =
2.2: dj22
3.0: dj30
3.1: dj31
3.2: dj32
4.0: dj40
4.1: dj41
4.2: dj42
5.0: dj50

[testenv]
setenv =
PYTHONDONTWRITEBYTECODE=1
PYTHONWARNINGS=once
deps =
dj22: Django>=2.2,<2.3
dj30: Django>=3.0,<3.1
dj31: Django>=3.1,<3.2
dj32: Django>=3.2a1,<4.0
dj40: Django>=4.0,<4.1
dj41: Django>=4.1,<4.2
dj42: Django>=4.2,<5.0
drf38: djangorestframework>=3.8.0,<3.9
drf39: djangorestframework>=3.9.0,<3.10
drf310: djangorestframework>=3.10.0,<3.11
drf311: djangorestframework>=3.11,<3.12
drf312: djangorestframework>=3.12,<3.13
drf313: djangorestframework>=3.13,<3.14
dj50: Django>=5.0,<5.1
drf314: djangorestframework>=3.14,<3.15
drf315: djangorestframework>=3.15,<3.16
pytest: -rrequirements.txt
mypy: git+https://github.com/typeddjango/djangorestframework-stubs.git@946c7d60aaecdc9ef307f5e1f8eb55f7083ffb16#egg=djangorestframework-stubs
mypy: djangorestframework-stubs
mypy: djangorestframework-stubs[compatible-mypy]>=3.15,<3.16
commands=
pytest: pytest --cov drf_writable_nested --cov-report=xml
mypy: mypy example
mypy: mypy .
mypy: mypy --show-traceback example
mypy: mypy --show-traceback .

0 comments on commit e12b356

Please sign in to comment.