Skip to content

Commit

Permalink
feat: add wagtail 6 support (#289)
Browse files Browse the repository at this point in the history
* feat: add wagtail 6 support

* chore: apply black and update tox
  • Loading branch information
csalom authored May 22, 2024
1 parent 9a20df4 commit 7e733ca
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 11 deletions.
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
* Yed Podtrzitko
* Francisco Fernández
* Pep Lluís Miró
* Wesley van Lee
* Marco Badan
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Changelog

Unreleased
----------
* Add Wagtail 6.1 support. Drop Wagtail <=5.2 support.


2.0.0 (2023-07-04)
------------------
Expand Down
1 change: 1 addition & 0 deletions puput/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"wagtail.sites",
"wagtail.contrib.redirects",
"wagtail.contrib.forms",
"wagtail.contrib.search_promotions",
"wagtail.contrib.sitemaps",
"wagtail.contrib.routable_page",
"wagtail",
Expand Down
8 changes: 7 additions & 1 deletion puput/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@

from wagtail.contrib.routable_page.models import RoutablePageMixin, route
from wagtail.models import Page
from wagtail.search.models import Query
import wagtail

if wagtail.VERSION[:2] < (6, 0):
from wagtail.search.models import Query
else:
# https://docs.wagtail.org/en/stable/releases/6.0.html#query-model-moved-to-wagtail-contrib-search-promotions
from wagtail.contrib.search_promotions.models import Query

from .utils import get_object_or_None

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_metadata(package, field):
description='A Django blog app implemented in Wagtail.',
long_description=codecs.open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8').read(),
install_requires=[
'wagtail>=5.2',
'wagtail>=5.2,<7.0',
'django-el-pagination==4.0.0',
'django-taggit>=3.1.0,<4.1',
'wagtail-markdown==0.11.1'
Expand Down
17 changes: 8 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
[tox]
envlist =
py{38,39,310}-dj{42}-wt52
py311-dj{42,50}-wt52
py312-dj{42,50}-wt52
py{38,39}-dj{42}-{wt52,60,61}
py{310,311,312}-dj{42,50}-wt{52,60,61}
flake8
black

[gh-actions]
python =
3.8: py38-dj42-wt52
3.9: py38-dj42-wt52
3.10: py310-dj{42,50}-wt52
3.11: py311-dj{42,50}-wt52
3.12: py312-dj{42,50}-wt52, flake8, black
3.8: py38-dj42-wt{52,60,61}
3.9: py39-dj42-wt{52,60,61}
3.10: py310-dj{42,50}-wt{52,60,61}
3.11: py311-dj{42,50}-wt{52,60,61}
3.12: py312-dj{42,50}-wt{52,60,61}, flake8, black

[flake8]
max-line-length = 120
Expand All @@ -28,7 +27,7 @@ commands =
deps =
pytest==8.0.0
pytest-django==4.8.0
requests==2.31.0
requests==2.32.0
model-bakery==1.17.0
ipdb==0.13.13
django-el-pagination==4.0
Expand Down

0 comments on commit 7e733ca

Please sign in to comment.