From 3e5069463e52e0daf67aaac4fbd41e664587c3b6 Mon Sep 17 00:00:00 2001 From: Mike Manger Date: Tue, 17 Dec 2024 10:01:15 +0000 Subject: [PATCH 1/5] Add Django 5.1 and tidy up test matrix --- .github/workflows/main.yml | 2 +- tox.ini | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dc6f798d..a4813622 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ jobs: strategy: max-parallel: 6 matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v3 diff --git a/tox.ini b/tox.ini index 33aa0f02..e6d1fe17 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,9 @@ [tox] +# see https://docs.djangoproject.com/en/5.1/faq/install/#what-python-version-can-i-use-with-django envlist = - py{38,39,310,311,312,313}-django4.2-drf{3.14,3.15} - py{310,311,312,313}-django5.0-drf{3.14,3.15} + py{38,39,310,311,312}-django4.2-drf{3.14,3.15} + py{310,311,312}-django5.0-drf{3.14,3.15} + py{310,311,312,313}-django5.1-drf{3.14,3.15} py312-mypy [gh-actions] @@ -21,6 +23,7 @@ setenv = deps = django4.2: Django>=4.2,<4.3 django5.0: Django>=5.0,<5.1 + django5.1: Django>=5.1,<5.2 drf3.14: djangorestframework>=3.14,<3.15 drf3.15: djangorestframework>=3.15,<3.16 -rrequirements-tox.txt From 85cf02783b0f3b6641200b39625b18807cf529b9 Mon Sep 17 00:00:00 2001 From: Mike Manger Date: Tue, 17 Dec 2024 10:02:06 +0000 Subject: [PATCH 2/5] Bump workflow actions --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a4813622..5ffa94e3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,9 +14,9 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: "${{ matrix.python-version }}" - name: Install dependencies @@ -37,9 +37,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.12 - name: Install dependencies From 41908e057ef52b2c601b1b53752ca6fe478fbc28 Mon Sep 17 00:00:00 2001 From: Mike Manger Date: Tue, 17 Dec 2024 10:09:20 +0000 Subject: [PATCH 3/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 022fc9f6..adbb865d 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ exist without a domain, so you need it "nested" inside the domain. ## Requirements & Compatibility -- Python (3.8, 3.9, 3.10, 3.11, 3.12) -- Django (4.2, 5.0) +- Python (3.8, 3.9, 3.10, 3.11, 3.12, 3.13) +- Django (4.2, 5.0, 5.1) - Django REST Framework (3.14, 3.15) It may work with lower versions, but since the release **0.93.5** is no more tested on CI for Python 3.6 or lower.
From 3191a3da3816d7efec65f120d8c6d9a055e6c680 Mon Sep 17 00:00:00 2001 From: Mike Manger Date: Tue, 17 Dec 2024 10:13:45 +0000 Subject: [PATCH 4/5] Update include of reverse in tests. This drops support for django 1.10 --- tests/helpers/__init__.py | 1 - tests/serializers/test_serializers.py | 6 +----- tests/test_viewsets.py | 7 +------ 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/helpers/__init__.py b/tests/helpers/__init__.py index c14a3729..ad2a22be 100644 --- a/tests/helpers/__init__.py +++ b/tests/helpers/__init__.py @@ -1,4 +1,3 @@ - def get_regex_pattern(urlpattern): if hasattr(urlpattern, 'pattern'): # Django 2.0 diff --git a/tests/serializers/test_serializers.py b/tests/serializers/test_serializers.py index 9ed7b449..ce2bfc88 100644 --- a/tests/serializers/test_serializers.py +++ b/tests/serializers/test_serializers.py @@ -1,14 +1,10 @@ import json import pytest from django.test import TestCase +from django.urls import reverse from tests.serializers.models import Parent, Child1, Child2, GrandChild1 -try: - from django.core.urlresolvers import reverse -except ImportError: - from django.urls import reverse - class TestSerializers(TestCase): diff --git a/tests/test_viewsets.py b/tests/test_viewsets.py index 075ef6d8..5d294b83 100644 --- a/tests/test_viewsets.py +++ b/tests/test_viewsets.py @@ -1,6 +1,6 @@ import json -from django.urls import path, include +from django.urls import include, path, reverse from django.db import models from django.test import TestCase, override_settings, RequestFactory from django.core.exceptions import ImproperlyConfigured @@ -15,11 +15,6 @@ from rest_framework_nested.serializers import NestedHyperlinkedModelSerializer from rest_framework_nested.viewsets import NestedViewSetMixin -try: - from django.core.urlresolvers import reverse -except ImportError: - from django.urls import reverse - factory = RequestFactory() From 79c7a905f86f646cb3178e1fa7657561259bd969 Mon Sep 17 00:00:00 2001 From: Mike Manger Date: Tue, 17 Dec 2024 10:22:14 +0000 Subject: [PATCH 5/5] Add python 3.13 to classifiers [skip ci] --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 9c0acbec..46be47f2 100644 --- a/setup.py +++ b/setup.py @@ -96,6 +96,7 @@ def get_package_data(package): 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'Topic :: Internet :: WWW/HTTP', ] )