Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
python: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
Expand All @@ -37,33 +37,33 @@ jobs:
env:
DB: sqlite

test-postgres:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
# test-postgres:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python: ['3.12']

services:
postgres:
image: ${{ matrix.postgres || 'postgres:12' }}
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
# services:
# postgres:
# image: ${{ matrix.postgres || 'postgres:12' }}
# env:
# POSTGRES_PASSWORD: postgres
# ports:
# - 5432:5432
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install .[ci]
- name: Test
run: tox # -- --exclude exclude-in-github-actions # temporary workaround
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/wagtail_devtools
DB: postgres
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python ${{ matrix.python }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python }}
# - name: Install
# run: |
# python -m pip install --upgrade pip setuptools wheel
# python -m pip install .[ci]
# - name: Test
# run: tox # -- --exclude exclude-in-github-actions # temporary workaround
# env:
# DATABASE_URL: postgres://postgres:postgres@localhost:5432/wagtail_devtools
# DB: postgres
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ A set of developer tools in the form of management commands.

## Supported versions

- Python 3.8+
- Django 3.2+
- Wagtail 4.1+
- Python 3.9+
- Django 4.2+
- Wagtail 5.2+

## Features

Expand Down
13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Framework :: Wagtail",
"Framework :: Wagtail :: 4",
"Framework :: Wagtail :: 5",
"Framework :: Wagtail :: 6",
]
requires-python = ">=3.8"
requires-python = ">=3.9"
dynamic = ["version"]
dependencies = [
"Django>=3.2",
"Wagtail>=4.1,<6.0",
"Django>=4.2",
"Wagtail>=4.2",
]
[project.optional-dependencies]
testing = [
Expand Down
21 changes: 10 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ skipsdist = True
usedevelop = True

envlist =
python{3.8,3.9,3.10,3.11}-django{3.2,4.1}-wagtail{4.1,4.2}-{sqlite,postgres}
python{3.8,3.9,3.10,3.11}-django{3.2,4.1,4.2}-wagtail{5.0,5.1,5.2}-{sqlite,postgres}
python3.12-django5.0-wagtail5.2-sqlite
python3.9-django4.2-wagtail{5.2,6.0,6.1,6.2,6.3}-wagtailmodeladmin-sqlite
python{3.10,3.11,3.12}-django{4.2,5.0}-wagtail{5.2,6.0,6.1,6.2,6.3}-wagtailmodeladmin-sqlite
python3.12-django5.1-wagtail6.3-wagtailmodeladmin-sqlite

[gh-actions]
python =
3.8: python3.8
3.9: python3.9
3.10: python3.10
3.11: python3.11
Expand All @@ -27,7 +26,6 @@ commands =
coverage report -m

basepython =
python3.8: python3.8
python3.9: python3.9
python3.10: python3.10
python3.11: python3.11
Expand All @@ -36,16 +34,17 @@ basepython =
deps =
coverage

django3.2: Django>=3.2,<4.0
django4.1: Django>=4.1,<4.2
django4.2: Django>=4.2,<4.3
django5.0: Django>=5.0,<5.1
django5.1: Django>=5.1,<5.2

wagtail4.1: wagtail>=4.1,<4.2
wagtail4.2: wagtail>=4.2,<4.3
wagtail5.0: wagtail>=5.0,<5.1
wagtail5.1: wagtail>=5.1,<5.2
wagtail5.2: wagtail>=5.2,<5.3
wagtail6.0: wagtail>=6.0,<6.1
wagtail6.1: wagtail>=6.1,<6.2
wagtail6.2: wagtail>=6.2,<6.3
wagtail6.3: wagtail>=6.3,<6.4

wagtailmodeladmin: wagtail-modeladmin

postgres: psycopg2>=2.6

Expand Down
2 changes: 1 addition & 1 deletion wagtail_devtools/api/serializers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.apps import apps
from wagtail.admin.admin_url_finder import AdminURLFinder
from wagtail.models.collections import Collection
from wagtail.models import Collection
from wagtail.snippets.models import get_snippet_models

from wagtail_devtools.api.dataclasses import (
Expand Down
12 changes: 9 additions & 3 deletions wagtail_devtools/management/commands/_base_admin_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from wagtail import VERSION as WAGTAIL_VERSION
from wagtail.admin.admin_url_finder import AdminURLFinder
from wagtail.admin.utils import get_admin_base_url
from wagtail.contrib.modeladmin.helpers import AdminURLHelper


if WAGTAIL_VERSION < (6, 0):
from wagtail.contrib.modeladmin.helpers import AdminURLHelper
else:
from wagtail_modeladmin.helpers import AdminURLHelper

from wagtail.contrib.settings.registry import registry as settings_registry
from wagtail.documents import get_document_model
from wagtail.images import get_image_model
from wagtail.models import get_page_models
from wagtail.models.collections import Collection
from wagtail.models import Collection, get_page_models
from wagtail.snippets.models import get_snippet_models


Expand Down
3 changes: 1 addition & 2 deletions wagtail_devtools/test/management/commands/build_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
from wagtail.contrib.search_promotions.models import Query, SearchPromotion
from wagtail.documents.models import Document as WagtailDocument
from wagtail.images.models import Image as WagtailImage
from wagtail.models import Page, Site
from wagtail.models.collections import Collection
from wagtail.models import Collection, Page, Site

from wagtail_devtools.test.models import (
FormFieldOne,
Expand Down
4 changes: 3 additions & 1 deletion wagtail_devtools/test/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

import dj_database_url

from wagtail import VERSION as WAGTAIL_VERSION


# Build paths inside the project like this: os.path.join(PROJECT_DIR, ...)
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand Down Expand Up @@ -47,7 +49,7 @@
"wagtail.search",
"wagtail.admin",
"wagtail.api.v2",
"wagtail.contrib.modeladmin",
"wagtail.contrib.modeladmin" if WAGTAIL_VERSION < (6, 0) else "wagtail_modeladmin",
"wagtail.contrib.routable_page",
"wagtail.contrib.styleguide",
"wagtail.sites",
Expand Down
3 changes: 1 addition & 2 deletions wagtail_devtools/test/tests/test_build_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
from wagtail.contrib.settings.registry import registry as settings_registry
from wagtail.documents import get_document_model
from wagtail.images import get_image_model
from wagtail.models import Page, Site
from wagtail.models.collections import Collection
from wagtail.models import Collection, Page, Site
from wagtail.snippets.models import get_snippet_models


Expand Down
8 changes: 7 additions & 1 deletion wagtail_devtools/test/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
from django.shortcuts import render
from django.template.response import TemplateResponse
from django.utils import timezone
from wagtail import VERSION as WAGTAIL_VERSION
from wagtail.models import Page
from wagtail.search.models import Query


if WAGTAIL_VERSION < (6, 0):
from wagtail.search.models import Query
else:
from wagtail.contrib.search_promotions.models import Query


def search(request):
Expand Down
8 changes: 7 additions & 1 deletion wagtail_devtools/test/wagtail_hooks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
from django.urls import path, reverse
from wagtail import VERSION as WAGTAIL_VERSION
from wagtail import hooks
from wagtail.admin.menu import Menu, MenuItem, SubmenuMenuItem
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register


if WAGTAIL_VERSION < (6, 0):
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
else:
from wagtail_modeladmin.options import ModelAdmin, modeladmin_register

from wagtail_devtools.test.views import example_calendar, example_calendar_month

Expand Down
Loading