Skip to content

Commit f5e2acc

Browse files
committed
feat: add django 5.2 support
1 parent b122334 commit f5e2acc

File tree

8 files changed

+32
-10
lines changed

8 files changed

+32
-10
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
python-version:
1717
- '3.11'
1818
- '3.12'
19-
toxenv: [django42-celery53-drflatest,
20-
quality, docs, django42]
19+
toxenv: [django42-celery53-drflatest, django52-celery54-drflatest,
20+
quality, docs]
2121

2222
steps:
2323
- uses: actions/checkout@v4
@@ -37,7 +37,7 @@ jobs:
3737
run: tox
3838

3939
- name: Run coverage
40-
if: matrix.python-version == '3.11' && matrix.toxenv == 'django42-celery53-drflatest'
40+
if: matrix.python-version == '3.11' && matrix.toxenv == 'django52-celery54-drflatest'
4141
uses: codecov/codecov-action@v5
4242
with:
4343
token: ${{ secrets.CODECOV_TOKEN }}

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ Change Log
1414
Unreleased
1515
~~~~~~~~~~
1616

17+
[3.4.0] - 2025-04-05
18+
~~~~~~~~~~~~~~~~~~~~
19+
20+
Added
21+
+++++++
22+
* Added `Django 5.2` support
23+
1724
[3.3.0] - 2025-02-13
1825
~~~~~~~~~~~~~~~~~~~~
1926

schema/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from drf_yasg.views import get_schema_view
77

88
from django.contrib import admin
9-
from django.urls import include, re_path
9+
from django.urls import include, path, re_path
1010

1111
from rest_framework import permissions
1212

@@ -24,7 +24,7 @@
2424

2525
# The Swagger/Open API JSON file can be found at http://localhost:8000/?format=openapi
2626
urlpatterns = [
27-
re_path(r'^admin/', include(admin.site.urls)),
27+
path('admin/', include(admin.site.urls)),
2828
re_path(r'^swagger(?P<format>\.json|\.yaml)$', SCHEMA.without_ui(cache_timeout=0), name='schema-json'),
29-
re_path(r'^swagger/$', SCHEMA.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
29+
path('swagger/', SCHEMA.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
3030
] + base_patterns

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def is_requirement(line):
149149
'Development Status :: 4 - Beta',
150150
'Framework :: Django',
151151
'Framework :: Django :: 4.2',
152+
'Framework :: Django :: 5.2',
152153
'Intended Audience :: Developers',
153154
'License :: OSI Approved :: Apache Software License',
154155
'Natural Language :: English',

test_settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,9 @@ def root(*args):
7979
]
8080

8181
USE_TZ = True
82+
83+
STORAGES = {
84+
"default": {
85+
"BACKEND": "django.core.files.storage.FileSystemStorage",
86+
},
87+
}

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[tox]
22
envlist =
3-
py{311,312}-django{42}-celery{53}-drf{313,latest}
3+
py{311,312}-django{42, 52}-celery{53, 54}-drf{313,latest}
44
quality
55
docs
66
[testenv]
77
deps =
88
django42: Django>=4.2,<4.3
9+
django52: Django>=5.2,<5.3
910
drflatest: djangorestframework
1011
-r{toxinidir}/requirements/test.txt
1112
commands =

user_tasks/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from django.dispatch import Signal
66

7-
__version__ = '3.3.0'
7+
__version__ = '3.4.0'
88

99

1010
# This signal is emitted when a user task reaches any final state:

user_tasks/conf.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@
55
from datetime import timedelta
66

77
from django.conf import settings as django_settings
8-
from django.core.files.storage import get_storage_class
8+
from django.core.files.storage import storages
99

1010
from user_tasks import filters
1111

1212

13+
def get_storage(import_path=None):
14+
"""
15+
Get the storage backend for the given import path or default
16+
"""
17+
return storages["default"] if import_path is None else storages[import_path]
18+
19+
1320
class LazySettings():
1421
"""
1522
The behavior of ``django-user-tasks`` can be customized via the following Django settings.
@@ -37,7 +44,7 @@ def USER_TASKS_ARTIFACT_STORAGE(self): # pylint: disable=invalid-name
3744
backend class.
3845
"""
3946
import_path = getattr(django_settings, 'USER_TASKS_ARTIFACT_STORAGE', None)
40-
return get_storage_class(import_path)()
47+
return get_storage(import_path)
4148

4249
@property
4350
def USER_TASKS_MAX_AGE(self): # pylint: disable=invalid-name

0 commit comments

Comments
 (0)