Skip to content
Merged
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
36 changes: 36 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests

on:
pull_request:
push:
branches: [main]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
python: "3.9"
wagtail: ">=4.1,<4.2"
- os: ubuntu-latest
python: "3.13"
wagtail: ">=4.1"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- run: python -m pip install --upgrade pip
- run: python -m pip install "wagtail${{ matrix.wagtail }}" -e ".[dev]" build twine
- run: python -m django check --settings=wagtail_developer_reference.tests.settings
- run: python -m django makemigrations --check --dry-run --settings=wagtail_developer_reference.tests.settings
- run: ruff check .
- run: >-
ruff format --check setup.py wagtail_developer_reference/__init__.py
wagtail_developer_reference/tests/settings.py wagtail_developer_reference/tests/urls.py
- run: pytest
- run: python -m build
- run: python -m twine check dist/*
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ In large Wagtail projects, it’s easy to lose track of where specific blocks ar

## Installation

Compatibility: Python 3.9+ and Wagtail 4.1 through 7.4.2 LTS. Wagtail 7.4
itself requires Python 3.10+.
Compatibility: Python 3.9+ and Wagtail 4.1 or later, without an upper Wagtail
version limit. Newer Wagtail releases may require a newer Python version.
CI tests the minimum Wagtail series and the latest compatible release.

1. Add \`wagtail_developer_reference\` to your \`INSTALLED_APPS\`:
\`\`\`python
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "wagtail-developer-reference"
version = "0.1.5"
version = "0.1.6"
description = "A visual auditing tool for Wagtail developers to track Page models and StreamField blocks."
readme = "README.md"
authors = [{name = "Four Digits", email = "info@fourdigits.nl" }]
Expand All @@ -20,7 +20,7 @@ classifiers = [
]
keywords = ["django", "wagtail", "audit", "streamfield"]
dependencies = [
"wagtail>=4.1,<7.5",
"wagtail>=4.1",
]
requires-python = ">=3.9"

Expand All @@ -44,6 +44,10 @@ include-package-data = true
[tool.setuptools.packages.find]
include = ["wagtail_developer_reference*"]

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "wagtail_developer_reference.tests.settings"
testpaths = ["wagtail_developer_reference/tests"]

[tool.ruff]
line-length = 88
target-version = "py39"
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

setup(
name="wagtail-developer-reference",
version="0.1.5",
version="0.1.6",
packages=find_packages(),
include_package_data=True,
install_requires=[
"wagtail>=4.1,<7.5",
"wagtail>=4.1",
],
)
2 changes: 1 addition & 1 deletion wagtail_developer_reference/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__: str = "0.1.2"
__version__: str = "0.1.6"
75 changes: 75 additions & 0 deletions wagtail_developer_reference/tests/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
"""Minimal Django settings for running the wagtail_developer_reference test suite."""

SECRET_KEY = "not-a-secret"
DEBUG = False
ALLOWED_HOSTS = ["*"]

ROOT_URLCONF = "wagtail_developer_reference.tests.urls"

INSTALLED_APPS = [
"wagtail_developer_reference",
"wagtail.contrib.forms",
"wagtail.contrib.redirects",
"wagtail.embeds",
"wagtail.sites",
"wagtail.users",
"wagtail.snippets",
"wagtail.documents",
"wagtail.images",
"wagtail.search",
"wagtail.admin",
"wagtail",
"modelcluster",
"taggit",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
]

MIDDLEWARE = [
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"wagtail.contrib.redirects.middleware.RedirectMiddleware",
]

TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
},
},
]

DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
}
}

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

STATIC_URL = "/static/"
STATIC_ROOT = None
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"

PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]

USE_TZ = True
TIME_ZONE = "UTC"
LANGUAGE_CODE = "en"

WAGTAIL_SITE_NAME = "Test site"
WAGTAILADMIN_BASE_URL = "http://testserver"
8 changes: 8 additions & 0 deletions wagtail_developer_reference/tests/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.urls import include, path
from wagtail import urls as wagtail_urls
from wagtail.admin import urls as wagtailadmin_urls

urlpatterns = [
path("admin/", include(wagtailadmin_urls)),
path("", include(wagtail_urls)),
]
Loading