Skip to content

Commit

Permalink
Django 4.2 support added for python 3.9 to 3.12 & for drf 3.13 (#349)
Browse files Browse the repository at this point in the history
* unit test fixed

* testserialisers file txt added in the gitignore

* testserialisers file txt added in the gitignore

* test txt files deleted

* Update tests_app/tests/functional/routers/nested_router_mixin/views.py

* support for python 3.9 added

* test files deleted

* python 3.9 and 3.10 support added

* support added for python 3.11

* support for  python 3.12 added

* python 3.10-3.12 added in github/workflows

* python 3.10-3.12 added in github/workflows

* remove python versions from travis.yml

* django 4.2 support added for python 3.9 to 3.12 and for drf 3.14

* readme updated

---------

Co-authored-by: Mehraz Hossian Rumman <rumman@adfinix.com>
Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
  • Loading branch information
3 people authored Dec 15, 2024
1 parent 09512be commit c40977e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
max-parallel: 4
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
django-version: ["2.2","3.2", "4.2"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Full documentation for project is available at [http://chibisov.github.io/drf-ex

* Tested for Python 3.6, 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12
* Tested for Django Rest Framework 3.12, 3.13, and 3.14
* Tested for Django 2.2 to 3.2
* Tested for Django 2.2 to 3.2 & for Django 4.2
* Tested for django-filter 2.1.0

## Installation:
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_package_data(package):
url='http://github.com/chibisov/drf-extensions',
download_url='https://pypi.python.org/pypi/drf-extensions/',
license='BSD',
install_requires=['djangorestframework>=3.10.3', 'packaging>=24.1'],
install_requires=['djangorestframework>=3.10.3', 'packaging>=24.1','Django>=2.2,<5.0'],
description='Extensions for Django REST Framework',
long_description='DRF-extensions is a collection of custom extensions for Django REST Framework',
author='Asif Saif Uddin, Gennady Chibisov',
Expand All @@ -71,6 +71,9 @@ def get_package_data(package):
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.2',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
Expand Down
1 change: 1 addition & 0 deletions tests_app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.conf.urls import url, include
from django.urls import re_path, include
from rest_framework import routers
from .views import (BookViewSet, BookListCreateView, BookChangeView, BookCustomDestroyView,
BookUnconditionalDestroyView, BookUnconditionalUpdateView)
Expand All @@ -8,14 +8,14 @@

urlpatterns = [
# manually add endpoints for APIView instances
url(r'books_view/(?P<pk>[0-9]+)/custom/delete/', BookCustomDestroyView.as_view(), name='book_view-custom_delete'),
url(r'books_view/(?P<pk>[0-9]+)/unconditional/delete/', BookUnconditionalDestroyView.as_view(),
re_path(r'books_view/(?P<pk>[0-9]+)/custom/delete/', BookCustomDestroyView.as_view(), name='book_view-custom_delete'),
re_path(r'books_view/(?P<pk>[0-9]+)/unconditional/delete/', BookUnconditionalDestroyView.as_view(),
name='book_view-unconditional_delete'),
url(r'books_view/(?P<pk>[0-9]+)/unconditional/update/', BookUnconditionalUpdateView.as_view(),
re_path(r'books_view/(?P<pk>[0-9]+)/unconditional/update/', BookUnconditionalUpdateView.as_view(),
name='book_view-unconditional_update'),
url(r'books_view/', BookListCreateView.as_view(), name='book_view-list'),
url(r'books_view/(?P<pk>[0-9]+)/', BookChangeView.as_view(), name='book_view-detail'),
re_path(r'books_view/', BookListCreateView.as_view(), name='book_view-list'),
re_path(r'books_view/(?P<pk>[0-9]+)/', BookChangeView.as_view(), name='book_view-detail'),

# include the URLs from the default viewset
url(r'^', include(router.urls)),
re_path(r'^', include(router.urls)),
]
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.conf.urls import url
from django.urls import re_path

from .views import MyView


urlpatterns = [
url(r'^remove-etag-gzip-postfix/$', MyView.as_view()),
re_path(r'^remove-etag-gzip-postfix/$', MyView.as_view()),
]
4 changes: 2 additions & 2 deletions tests_app/tests/functional/cache/decorators/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.conf.urls import url
from django.urls import re_path

from .views import HelloView


urlpatterns = [
url(r'^hello/$', HelloView.as_view(), name='hello'),
re_path(r'^hello/$', HelloView.as_view(), name='hello'),
]
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tox]
envlist = py{38,39}-django{22}-drf{311,312}
py{38,39,310,311,312}-django{32}-drf{312,313,314}
py{38,39,310,311,312}-django{42}-drf{314}


[testenv]
Expand All @@ -17,11 +18,12 @@ deps=
djangorestframework-guardian
django22: Django>=2.2,<3.0
django32: Django>=3.2,<4.0
django42: Django>=4.2,<5.0


setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/tests_app
commands =
python --version
pip freeze
python -Wd {envbindir}/django-admin.py test --settings=settings {posargs}
python -Wd {envbindir}/django-admin test --settings=settings {posargs}

0 comments on commit c40977e

Please sign in to comment.