diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 857ac26..96488f0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -42,6 +42,9 @@ stages: py3.11_wag5: PYTHON_VERSION: '3.11' WAGTAIL: '5.*' + py3.12_wag6: + PYTHON_VERSION: "3.12" + WAGTAIL: '6.*' steps: - task: UsePythonVersion@0 diff --git a/ci/compare-codecov.ps1 b/ci/compare-codecov.ps1 index 68063e5..690ad6a 100644 --- a/ci/compare-codecov.ps1 +++ b/ci/compare-codecov.ps1 @@ -55,7 +55,7 @@ foreach ($build in $mainBuildJson.value) { # Retrieve code coverage for this build ID. $mainCoverageJson = ( - Invoke-WebRequest "$ApiBase/_apis/test/codecoverage?buildId=$mainLatestId&api-version=5.1-preview.1" + Invoke-WebRequest "$ApiBase/_apis/test/codecoverage?buildId=$mainLatestId&flags=7&api-version=7.1-preview.1" ).Content | ConvertFrom-Json foreach ($cov in $mainCoverageJson.coverageData.coverageStats) { if ($cov.label -eq "Lines") { diff --git a/docs/conf.py b/docs/conf.py index bed38de..86a5792 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,6 +15,7 @@ import sys sys.path.insert(0, os.path.abspath('.')) """ + import datetime from wagtailcache import __shortversion__ diff --git a/docs/releases.rst b/docs/releases.rst index fd1dd04..ba2e66f 100644 --- a/docs/releases.rst +++ b/docs/releases.rst @@ -2,6 +2,10 @@ Release Notes ============= +2.4.0 +===== + +* Support Wagtail 6 and Django 5.1 2.3.0 ===== diff --git a/setup.py b/setup.py index 8e1b2ce..7b2ff01 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ license="BSD license", include_package_data=True, packages=find_packages(), - install_requires=["wagtail>=3.0,<6"], + install_requires=["wagtail>=3.0,<7"], classifiers=[ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", diff --git a/testproject/testproject/settings.py b/testproject/testproject/settings.py index 53f3cce..fd1bc65 100644 --- a/testproject/testproject/settings.py +++ b/testproject/testproject/settings.py @@ -9,6 +9,7 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ + # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os @@ -99,7 +100,14 @@ "django.contrib.staticfiles.finders.AppDirectoriesFinder", ] -STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage" +STORAGES = { + "default": { + "BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage" + }, + "staticfiles": { + "BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage" + }, +} STATIC_ROOT = os.path.join(BASE_DIR, "static") STATIC_URL = "/static/" diff --git a/testproject/testproject/wsgi.py b/testproject/testproject/wsgi.py index 6a80e1a..61a9209 100644 --- a/testproject/testproject/wsgi.py +++ b/testproject/testproject/wsgi.py @@ -6,6 +6,7 @@ For more information on this file, see https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ """ + import os from django.core.wsgi import get_wsgi_application diff --git a/wagtailcache/__init__.py b/wagtailcache/__init__.py index a97e3c7..d76bad5 100644 --- a/wagtailcache/__init__.py +++ b/wagtailcache/__init__.py @@ -1,3 +1,3 @@ -release = ["2", "3", "0"] +release = ["2", "4", "0"] __version__ = "{0}.{1}.{2}".format(release[0], release[1], release[2]) __shortversion__ = "{0}.{1}".format(release[0], release[1]) diff --git a/wagtailcache/cache.py b/wagtailcache/cache.py index 73f2e2c..3f4eaec 100644 --- a/wagtailcache/cache.py +++ b/wagtailcache/cache.py @@ -1,6 +1,7 @@ """ Functionality to set, serve from, and clear the cache. """ + import re from enum import Enum from functools import wraps diff --git a/wagtailcache/management/commands/clear_wagtail_cache.py b/wagtailcache/management/commands/clear_wagtail_cache.py index bec0f85..c41f5a1 100644 --- a/wagtailcache/management/commands/clear_wagtail_cache.py +++ b/wagtailcache/management/commands/clear_wagtail_cache.py @@ -1,4 +1,5 @@ """CLI tool to clear wagtailcache.""" + from django.core.management.base import BaseCommand from wagtailcache.cache import clear_cache diff --git a/wagtailcache/settings.py b/wagtailcache/settings.py index c599746..d56c9a6 100644 --- a/wagtailcache/settings.py +++ b/wagtailcache/settings.py @@ -1,6 +1,7 @@ """ Default django settings for wagtail-cache. """ + from typing import Text from django.conf import settings @@ -14,6 +15,7 @@ class _DefaultSettings: WAGTAIL_CACHE_IGNORE_QS = [ r"^_bta_.*$", # Bronto r"^_ga$", # Google Analytics + r"^_gl$", # Google Analytics r"^affiliate$", # Instagram affiliates r"^ck_subscriber_id$", # Instagram affiliates r"^dm_i$", # Dotdigital diff --git a/wagtailcache/urls.py b/wagtailcache/urls.py index 5e1fcae..b429d88 100644 --- a/wagtailcache/urls.py +++ b/wagtailcache/urls.py @@ -1,6 +1,7 @@ """ URLs for the wagtail admin dashboard. """ + from django.urls import path from wagtailcache.views import clear diff --git a/wagtailcache/views.py b/wagtailcache/views.py index 2511864..30b5a70 100644 --- a/wagtailcache/views.py +++ b/wagtailcache/views.py @@ -1,6 +1,7 @@ """ Views for the wagtail admin dashboard. """ + from typing import Dict from typing import List diff --git a/wagtailcache/wagtail_hooks.py b/wagtailcache/wagtail_hooks.py index 26b3bda..df537fc 100644 --- a/wagtailcache/wagtail_hooks.py +++ b/wagtailcache/wagtail_hooks.py @@ -1,6 +1,7 @@ """ Registers wagtail-cache in the wagtail admin dashboard. """ + from django.urls import include from django.urls import path from django.urls import reverse