Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test against Django 5.1 and update test import #377

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ 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
- 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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br/>
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]
)
1 change: 0 additions & 1 deletion tests/helpers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

def get_regex_pattern(urlpattern):
if hasattr(urlpattern, 'pattern'):
# Django 2.0
Expand Down
6 changes: 1 addition & 5 deletions tests/serializers/test_serializers.py
Original file line number Diff line number Diff line change
@@ -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):

Expand Down
7 changes: 1 addition & 6 deletions tests/test_viewsets.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()


Expand Down
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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
Expand Down