diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b998cb2..9153108c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,8 @@ jobs: python-version: - '3.11' - '3.12' - toxenv: [django42-celery53-drflatest, - quality, docs, django42] + toxenv: [django42-celery53-drflatest, django52-celery54-drflatest, + quality, docs] steps: - uses: actions/checkout@v4 @@ -37,7 +37,7 @@ jobs: run: tox - name: Run coverage - if: matrix.python-version == '3.11' && matrix.toxenv == 'django42-celery53-drflatest' + if: matrix.python-version == '3.11' && matrix.toxenv == 'django52-celery54-drflatest' uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e5a6205a..d0c9c8ff 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,13 @@ Change Log Unreleased ~~~~~~~~~~ +[3.4.0] - 2025-04-05 +~~~~~~~~~~~~~~~~~~~~ + +Added ++++++++ +* Added `Django 5.2` support + [3.3.0] - 2025-02-13 ~~~~~~~~~~~~~~~~~~~~ diff --git a/schema/urls.py b/schema/urls.py index b25b62bc..e81938e1 100644 --- a/schema/urls.py +++ b/schema/urls.py @@ -6,7 +6,7 @@ from drf_yasg.views import get_schema_view from django.contrib import admin -from django.urls import include, re_path +from django.urls import include, path, re_path from rest_framework import permissions @@ -24,7 +24,7 @@ # The Swagger/Open API JSON file can be found at http://localhost:8000/?format=openapi urlpatterns = [ - re_path(r'^admin/', include(admin.site.urls)), + path('admin/', include(admin.site.urls)), re_path(r'^swagger(?P\.json|\.yaml)$', SCHEMA.without_ui(cache_timeout=0), name='schema-json'), - re_path(r'^swagger/$', SCHEMA.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), + path('swagger/', SCHEMA.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), ] + base_patterns diff --git a/setup.py b/setup.py index 593bbb97..96c432f2 100644 --- a/setup.py +++ b/setup.py @@ -149,6 +149,7 @@ def is_requirement(line): 'Development Status :: 4 - Beta', 'Framework :: Django', 'Framework :: Django :: 4.2', + 'Framework :: Django :: 5.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Natural Language :: English', diff --git a/test_settings.py b/test_settings.py index fddfdce0..8ec72147 100644 --- a/test_settings.py +++ b/test_settings.py @@ -79,3 +79,9 @@ def root(*args): ] USE_TZ = True + +STORAGES = { + "default": { + "BACKEND": "django.core.files.storage.FileSystemStorage", + }, +} diff --git a/tox.ini b/tox.ini index a2d9fd28..eaa11d6d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,12 @@ [tox] envlist = - py{311,312}-django{42}-celery{53}-drf{313,latest} + py{311,312}-django{42, 52}-celery{53, 54}-drf{313,latest} quality docs [testenv] deps = django42: Django>=4.2,<4.3 + django52: Django>=5.2,<5.3 drflatest: djangorestframework -r{toxinidir}/requirements/test.txt commands = diff --git a/user_tasks/__init__.py b/user_tasks/__init__.py index f1720b87..ebb41f85 100644 --- a/user_tasks/__init__.py +++ b/user_tasks/__init__.py @@ -4,7 +4,7 @@ from django.dispatch import Signal -__version__ = '3.3.0' +__version__ = '3.4.0' # This signal is emitted when a user task reaches any final state: diff --git a/user_tasks/conf.py b/user_tasks/conf.py index a9007a41..60d169fc 100644 --- a/user_tasks/conf.py +++ b/user_tasks/conf.py @@ -5,11 +5,18 @@ from datetime import timedelta from django.conf import settings as django_settings -from django.core.files.storage import get_storage_class +from django.core.files.storage import storages from user_tasks import filters +def get_storage(import_path=None): + """ + Get the default storage backend or for the given import path. + """ + return storages["default"] if import_path is None else storages[import_path] + + class LazySettings(): """ 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 backend class. """ import_path = getattr(django_settings, 'USER_TASKS_ARTIFACT_STORAGE', None) - return get_storage_class(import_path)() + return get_storage(import_path) @property def USER_TASKS_MAX_AGE(self): # pylint: disable=invalid-name