Skip to content

Commit 014c8a1

Browse files
authored
Drop Wagtail 5.2 support (and 6.0, 6.1 and 6.2) (#99)
2 parents 4bc3550 + 66d2087 commit 014c8a1

File tree

9 files changed

+24
-101
lines changed

9 files changed

+24
-101
lines changed

.github/workflows/nightly-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
services:
1919
postgres:
20-
image: postgres:16
20+
image: postgres:17
2121
env:
2222
POSTGRES_USER: postgres
2323
POSTGRES_PASSWORD: postgres
@@ -34,7 +34,7 @@ jobs:
3434
fetch-depth: 0
3535
- uses: actions/setup-python@v5
3636
with:
37-
python-version: '3.12'
37+
python-version: '3.13'
3838
- name: Install dependencies
3939
run: |
4040
python -m pip install tox requests
@@ -44,7 +44,7 @@ jobs:
4444
env:
4545
DATABASE_URL: postgres://postgres:postgres@localhost/wagtail_ab_testing
4646
run: |
47-
tox -e wagtailmain-postgres,wagtailmain-sqlite
47+
tox -e future-postgres,future-sqlite
4848
4949
- name: Send Slack notification on failure
5050
if: steps.test.outcome == 'failure'

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
test_python:
4848
services:
4949
postgres:
50-
image: postgres:16
50+
image: postgres:17
5151
env:
5252
POSTGRES_USER: postgres
5353
POSTGRES_PASSWORD: postgres
@@ -67,12 +67,12 @@ jobs:
6767
experimental: [false]
6868
toxenv: ['py']
6969
include:
70-
# Future Wagtail release from main branch (allowed to fail)
70+
# Future Wagtail and Django versions from main branch (allowed to fail)
7171
- python: '3.13'
72-
toxenv: wagtailmain-sqlite
72+
toxenv: future-sqlite
7373
experimental: true
7474
- python: '3.13'
75-
toxenv: wagtailmain-postgres
75+
toxenv: future-postgres
7676
experimental: true
7777
steps:
7878
- uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [0.13] - UNRELEASED
99

10-
- Nothing new yet
10+
- [Drop (official) support for Wagtail 5.2, 6.0, 6.1, 6.2 and 6.4](https://github.com/wagtail-nest/wagtail-ab-testing/pull/99)
11+
- [Add support for Wagtail 7.1](https://github.com/wagtail-nest/wagtail-ab-testing/pull/99)
1112

1213
## [0.12] - 2025-04-25
1314

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Key features:
1919

2020
## Usage
2121

22-
Wagtail A/B Testing works with Django 4.2+, Wagtail 5.2+ on Python 3.9+ environments.
22+
Wagtail A/B Testing works with Django 4.2+, Wagtail 6.3+ on Python 3.9+ environments.
2323

2424
### Creating an A/B test
2525

tox.ini

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
[tox]
22
envlist =
3-
; Django 4.2 LTS is the only version still supported under Wagtail 5.2
4-
py{39,310,311,312}-django42-wagtail52-{sqlite,postgres}
5-
py{39,310,311,312}-django42-wagtail{63,64,70}-{sqlite,postgres}
6-
py{310,311,312,313}-django51-wagtail{63,64,70}-{sqlite,postgres}
7-
; 6.3 LTS and 7.0 are the only versions to support Django 5.2 as of now
8-
py{310,311,312,313}-django52-wagtail{63,70}-{sqlite,postgres}
3+
py{39,310,311,312}-django42-wagtail{63,70,71}-{sqlite,postgres}
4+
py{310,311,312,313}-django51-wagtail{63,70,71}-{sqlite,postgres}
5+
; 6.3 and up support Django 5.2
6+
py{310,311,312,313}-django52-wagtail{63,70,71}-{sqlite,postgres}
97

108
[testenv]
119
allowlist_externals = coverage
@@ -20,24 +18,25 @@ basepython =
2018
deps =
2119
coverage
2220
django42: django>=4.2,<5
23-
django51: django>=5.1,<5.2
21+
django51: django>=4.2,<5
22+
django52: django>=5.2,<5.3
2423

25-
wagtail52: wagtail~=5.2.0
2624
wagtail63: wagtail~=6.3.0
27-
wagtail64: wagtail~=6.4.0
28-
wagtail70: wagtail>=7.0.0,<7.1
25+
wagtail70: wagtail~=7.0.0
26+
wagtail71: wagtail~=7.1.0
2927

3028
postgres: psycopg2>=2.9
3129
extras = testing
3230

3331
setenv =
3432
postgres: DATABASE_URL={env:DATABASE_URL:postgres:///wagtail_ab_testing}
3533

36-
[testenv:wagtailmain]
34+
[testenv:future]
3735
allowlist_externals = coverage
3836
deps =
3937
coverage
4038
git+https://github.com/wagtail/wagtail.git@main#egg=Wagtail
39+
git+https://github.com/django/django.git@main#egg=Django
4140
extras = testing
4241
setenv =
4342
postgres: DATABASE_URL={env:DATABASE_URL:postgres:///wagtail_ab_testing}

wagtail_ab_testing/templates/wagtail_ab_testing/_compat/report.html

Lines changed: 0 additions & 52 deletions
This file was deleted.

wagtail_ab_testing/test/tests/test_delete_abtest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from datetime import datetime
1+
from datetime import datetime, timezone
22

33
from django.contrib.auth.models import Group, Permission
44
from django.contrib.contenttypes.models import ContentType
@@ -36,7 +36,7 @@ def setUp(self):
3636
self.ab_test = AbTest.objects.create(
3737
page=self.page,
3838
name="Test AB",
39-
first_started_at=datetime(2023, 2, 15),
39+
first_started_at=datetime(2023, 2, 15, tzinfo=timezone.utc),
4040
variant_revision=self.page.get_latest_revision(),
4141
status=AbTest.STATUS_DRAFT,
4242
sample_size=10,

wagtail_ab_testing/test/tests/test_report.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from django.contrib.contenttypes.models import ContentType
33
from django.test import TestCase
44
from django.urls import reverse
5-
from wagtail import VERSION as WAGTAIL_VERSION
65
from wagtail.models import Page
76
from wagtail.test.utils import WagtailTestUtils
87

@@ -41,9 +40,4 @@ def setUp(self):
4140

4241
def test_get_report(self):
4342
response = self.client.get(reverse("wagtail_ab_testing_admin:report"))
44-
45-
# TODO: compatibility: remove this check when dropping support for < 6.2
46-
if WAGTAIL_VERSION < (6, 2):
47-
self.assertTemplateUsed(response, "wagtail_ab_testing/_compat/report.html")
48-
else:
49-
self.assertTemplateUsed(response, "wagtail_ab_testing/report.html")
43+
self.assertTemplateUsed(response, "wagtail_ab_testing/report.html")

wagtail_ab_testing/views.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
permission_classes,
2323
)
2424
from rest_framework.response import Response
25-
from wagtail import VERSION as WAGTAIL_VERSION
2625
from wagtail.admin import messages, panels
2726
from wagtail.admin.action_menu import ActionMenuItem
2827
from wagtail.admin.filters import DateRangePickerWidget, WagtailFilterSet
@@ -621,32 +620,14 @@ class Meta:
621620

622621

623622
class AbTestingReportView(ReportView):
624-
title = gettext_lazy("A/B testing")
623+
page_title = gettext_lazy("A/B testing")
625624
index_results_url_name = "wagtail_ab_testing_admin:report_results"
626625
index_url_name = "wagtail_ab_testing_admin:report"
627626
results_template_name = "wagtail_ab_testing/report.html"
628627
header_icon = "people-arrows"
629628

630629
filterset_class = AbTestingReportFilterSet
631630

632-
@property
633-
def template_name(self):
634-
# Upgrade consideration: https://docs.wagtail.org/en/stable/releases/6.2.html#adjust-the-templates
635-
# TODO: compatibility: remove `template_name` getter once Wagtail 6.2
636-
# is the minimum supported version
637-
638-
# If we are on Wagtail 6.1 or below, we need to provide the 'old'-style report template
639-
if WAGTAIL_VERSION < (6, 2):
640-
return "wagtail_ab_testing/_compat/report.html"
641-
642-
return ReportView.template_name
643-
644-
@property
645-
# TODO: compatibility: replace `title` attribute with `page_title` and
646-
# delete this getter once Wagtail 6.2 is the minimum supported version
647-
def page_title(self):
648-
return self.title
649-
650631
def get_queryset(self):
651632
return AbTest.objects.all().order_by(
652633
F("first_started_at").desc(nulls_first=True)

0 commit comments

Comments
 (0)