Skip to content

Commit

Permalink
Add Wagtail 5.2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
katdom13 authored and chosak committed Nov 17, 2023
1 parent bff2c8c commit 6afbe42
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 39 deletions.
32 changes: 6 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,13 @@ jobs:
strategy:
matrix:
python: ['3.8', '3.11']
django: ['3.2', '4.1']
wagtail: ['4.1', '4.2', '5.0', '5.1']
include:
- python: '3.8'
django: '3.2'
wagtail: '3.0'
- python: '3.8'
django: '3.2'
wagtail: '5.0'
- python: '3.8'
django: '4.1'
wagtail: '5.0'
- python: '3.8'
django: '4.2'
wagtail: '5.0'
- python: '3.11'
django: '4.1'
wagtail: '5.0'
django: ['3.2', '4.2']
wagtail: ['4.1', '5.2']
exclude:
- django: '4.2'
wagtail: '4.1'
- python: '3.11'
django: '4.2'
wagtail: '5.0'
- python: '3.11'
django: '4.1'
wagtail: '5.1'
- python: '3.11'
django: '4.2'
wagtail: '5.1'
django: '3.2'

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Compatibility
This code has been tested for compatibility with:

* Python 3.8+
* Django 3.2 (LTS), 4.1, 4.2 (LTS)
* Wagtail 3.0, 4.1 (LTS), 4.2, 5.0, 5.1
* Django 3.2 (LTS), 4.2 (LTS)
* Wagtail 3.0+, including 5.2 (LTS)

It should be compatible with all intermediate versions, as well.
If you find that it is not, please `file an issue <https://github.com/cfpb/wagtail-inventory/issues/new>`_.
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dependencies = [
classifiers = [
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Wagtail",
"Framework :: Wagtail :: 3",
Expand Down
13 changes: 4 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
skipsdist=True
envlist=
lint,
python{3.8}-django{3.2}-wagtail{3.0},
python{3.8,3.11}-django{3.2,4.1}-wagtail{4.1,4.2},
python{3.8,3.11}-django{3.2,4.1,4.2}-wagtail{5.0,5.1},
python{3.8}-django{3.2}-wagtail{4.1,5.2}
python{3.8,3.11}-django{4.2}-wagtail{5.2}
coverage

[testenv]
Expand All @@ -18,13 +17,9 @@ basepython=

deps=
django3.2: Django>=3.2,<3.3
django4.1: Django>=4.1,<4.2
django4.2: Django>=4.2,<4.3
wagtail3.0: wagtail>=3.0,<4.0
wagtail4.1: wagtail>=4.1,<4.2
wagtail4.2: wagtail>=4.2,<5.0
wagtail5.0: wagtail>=5.0,<5.1
wagtail5.1: wagtail>=5.1,<5.2
wagtail4.1: wagtail>=4.1,<5.0
wagtail5.2: wagtail>=5.2,<5.3

[testenv:lint]
basepython=python3.8
Expand Down
6 changes: 5 additions & 1 deletion wagtailinventory/wagtail_hooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.contrib.auth.models import Permission
from django.urls import include, path, reverse

from wagtail import VERSION as WAGTAIL_VERSION
from wagtail import hooks
from wagtail.admin.menu import MenuItem

Expand Down Expand Up @@ -45,10 +46,13 @@ def is_shown(self, request):

@hooks.register("register_reports_menu_item")
def register_inventory_report_menu_item():
key = "classname" if WAGTAIL_VERSION >= (5, 2) else "classnames"
icon = "icon icon-" + BlockInventoryReportView.header_icon

return CanViewBlockInventoryMenuItem(
"Block inventory",
reverse("wagtailinventory:block_inventory_report"),
classnames="icon icon-" + BlockInventoryReportView.header_icon,
**{key: icon},
)


Expand Down

0 comments on commit 6afbe42

Please sign in to comment.