Skip to content

Commit

Permalink
fix usage of wagtail fields overrides registry
Browse files Browse the repository at this point in the history
also rm/add support for some wagtail versions
  • Loading branch information
DylannCordel committed Sep 4, 2024
1 parent b62e5ad commit 44c8437
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 132 deletions.
72 changes: 41 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,52 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# Current configuration:
# - python 3.7, django 3.2, wagtail 4.1
# - python 3.7, django 3.2, wagtail 4.2
# - python 3.7, django 3.2, wagtail 5.0
# - python 3.9, django 4.2, wagtail 5.0
# - python 3.9, django 4.2, wagtail 5.1
# - python 3.11, django 4.2, wagtail 5.1
# - python 3.11, django main, wagtail main

jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
include:
- python: '3.7'
django: 'Django>=3.2,<3.3'
wagtail: 'wagtail>=4.1,<4.2'
- python: '3.9'
django: '"Django>=4.2,<4.3"'
wagtail: '"wagtail>=5.0,<5.1" "wagtail-modeladmin>=1.0,<2.0"'
coverage: 'py3.9_django-4.2_wagtail-5.0'
experimental: false
- python: '3.7'
django: 'Django>=3.2,<3.3'
wagtail: 'wagtail>=4.2,<4.3'
- python: '3.9'
django: '"Django>=4.2,<4.3"'
wagtail: '"wagtail>=5.1,<5.2" "wagtail-modeladmin>=1.0,<2.0"'
coverage: 'py3.9_django-4.2_wagtail-5.1'
experimental: false
- python: '3.7'
django: 'Django>=3.2,<3.3'
wagtail: 'wagtail>=5.0,<5.1'
- python: '3.11'
django: '"Django>=4.2,<4.3"'
wagtail: '"wagtail>=5.1,<5.2" "wagtail-modeladmin>=1.0,<2.0"'
coverage: 'py3.11_django-4.2_wagtail-5.1'
experimental: false
- python: '3.9'
django: 'Django>=4.2,<4.3'
wagtail: 'wagtail>=5.0,<5.1'
- python: '3.11'
django: '"Django>=4.2,<4.3"'
wagtail: '"wagtail>=5.2,<5.3" "wagtail-modeladmin>=1.0,<2.0"'
coverage: 'py3.11_django-4.2_wagtail-5.2'
experimental: false
- python: '3.9'
django: 'Django>=4.2,<4.3'
wagtail: 'wagtail>=5.1,<5.2'
- python: '3.11'
django: '"Django>=4.2,<4.3"'
wagtail: '"wagtail>=6.0,<6.1" "wagtail-modeladmin>=2.0,<3.0"'
coverage: 'py3.11_django-4.2_wagtail-6.0'
experimental: false
- python: '3.11'
django: 'Django>=4.2,<4.3'
wagtail: 'wagtail>=5.1,<5.2'
django: '"Django>=4.2,<4.3"'
wagtail: '"wagtail>=6.1,<6.2" "wagtail-modeladmin>=2.0,<3.0"'
coverage: 'py3.11_django-4.2_wagtail-6.1'
experimental: false
- python: '3.11'
django: 'git+https://github.com/django/django.git@main#egg=Django'
wagtail: 'git+https://github.com/wagtail/wagtail.git@main#egg=wagtail'
django: '"Django>=4.2,<4.3"'
wagtail: '"wagtail>=6.2,<6.3" "wagtail-modeladmin>=2.0,<3.0"'
coverage: 'py3.11_django-4.2_wagtail-6.2'
experimental: false
- python: '3.11'
django: '"git+https://github.com/django/django.git@main#egg=Django"'
wagtail: '"git+https://github.com/wagtail/wagtail.git@main#egg=wagtail" "wagtail-modeladmin>=1.0,<2.0"'
coverage: 'py3.11_django-main_wagtail-main'
experimental: true
steps:
- uses: actions/checkout@v3
Expand All @@ -64,16 +67,19 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -e .[testing]
pip install "${{ matrix.django }}"
pip install "${{ matrix.wagtail }}"
pip install ${{ matrix.django }}
pip install ${{ matrix.wagtail }}
- name: Test
run: |
coverage run --parallel-mode ./runtests.py
mv .coverage.* .coverage.${{ matrix.coverage }}
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage-data
path: .coverage.*
path: .coverage.${{ matrix.coverage }}
include-hidden-files: true
if-no-files-found: error

qa:
needs:
Expand Down Expand Up @@ -110,6 +116,10 @@ jobs:
with:
name: coverage-data

# - name: Check files
# run: |
# ls -la

- name: Save PR number and combine coverage data
run: |
mkdir -p ./pr
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 0.2.0 - 2024-09-04

* remove support of wagtail < 5.0
* remove support of django < 4.2
* add support of wagtail 6.0, 6.1, 6.2
* fix usage of wagtail fields overrides registry
* add this CHANGELOG 😸

# 0.1.x - 2023-09-18

First version 🧀 🐦
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Wagtail Parler 🧀 🐦

[![Stable Version](https://img.shields.io/pypi/v/wagtail-parler?color=blue)](https://pypi.org/project/wagtail-parler/)
![](https://img.shields.io/badge/python-3.7%20to%203.11-blue)
![](https://img.shields.io/badge/django-3.2%20to%204.2-blue)
![](https://img.shields.io/badge/python-3.9%20to%203.11-blue)
![](https://img.shields.io/badge/django-4.2%20to%205.0-blue)
![](https://img.shields.io/badge/wagtail-5.0%20to%206.2-blue)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
![](https://img.shields.io/badge/coverage-100%25-green)
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
Expand All @@ -25,10 +26,10 @@ wagtail's snippets.

This app is tested to runs with:

* Django 3.2, 4.2
* Wagtail 4.1, 4.2, 5.0, 5.1
* Django 4.2, 5.0
* Wagtail 5.0, 5.1, 5.2, 6.0, 6.1, 6.2
* Parler 2.3 (probably older ones to, it's just not tested)
* Python 3.7, 3.9, 3.11
* Python 3.9, 3.11

To ensure code quality and consistency:

Expand Down Expand Up @@ -91,7 +92,7 @@ register_snippet(FoodAdmin)

# or for an usage with wagtail-modeladmin:

from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from wagtail_modeladmin.options import ModelAdmin, modeladmin_register
from wagtail_parler.handlers import ParlerModelAdminMixin
from .models import Food

Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sphinx
sphinx_rtd_theme
myst_parser
wagtail_modeladmin>=2.0,<3.0
-e ./
7 changes: 7 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,10 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]

# Tell Jinja2 templates the build is running on Read the Docs
# see https://about.readthedocs.com/blog/2024/07/addons-by-default/
if os.environ.get("READTHEDOCS", "") == "True":
if "html_context" not in globals():
html_context = {}
html_context["READTHEDOCS"] = True
8 changes: 4 additions & 4 deletions docs/source/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ register_snippet(FoodAdmin)

# Or for ModelAdmin:

from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from wagtail_modeladmin.options import ModelAdmin, modeladmin_register
from .models import Food

class FoodAdmin(ModelAdmin):
Expand Down Expand Up @@ -122,7 +122,7 @@ register_snippet(FoodAdmin)

# or for an usage with wagtail-modeladmin:

from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from wagtail_modeladmin.options import ModelAdmin, modeladmin_register
from wagtail_parler.handlers import ParlerModelAdminMixin
from .models import Food

Expand Down Expand Up @@ -199,8 +199,8 @@ It will be used as a template to generate all languages tabs.

from wagtail.admin.panels import FieldPanel
from wagtail.admin.panels import ObjectList
from wagtail.contrib.modeladmin.options import ModelAdmin
from wagtail.contrib.modeladmin.options import modeladmin_register
from wagtail_modeladmin.options import ModelAdmin
from wagtail_modeladmin.options import modeladmin_register

from wagtail_parler.handlers import ParlerModelAdminMixin
from wagtail_parler.handlers import TranslationsList
Expand Down
16 changes: 13 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,32 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Framework :: Django
Framework :: Django :: 4.2
Framework :: Django :: 5.0
Framework :: Wagtail
Framework :: Wagtail :: 5
Framework :: Wagtail :: 6
Topic :: Internet :: WWW/HTTP
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Software Development :: Libraries :: Application Frameworks
Topic :: Software Development :: Libraries :: Python Modules
project_urls =
Source = https://github.com/webu/wagtail-parler
Tracker = https://github.com/webu/wagtail-parler/issues
Documentation = https://wagtail-parler.readthedocs.io/en/latest/

[options]
python_requires = >=3.7
python_requires = >=3.9
packages = find:
include_package_data = true
zip_safe = false
install_requires =
Django>=3.2
wagtail>=4.1
Django>=4.2
wagtail>=5.0
django-parler>=2.3

[options.extras_require]
Expand Down
2 changes: 1 addition & 1 deletion tbump.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[version]
current = "0.1.1"
current = "0.2.0"

# valid versions:
# we use semver
Expand Down
15 changes: 10 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
[tox]
envlist =
py37-django32-wagtail{41,42,50},
py39-django42-wagtail{50,51},
py311-django42-wagtail51,
py39-django42-wagtail{50,51}
py311-django42-wagtail{51,52,60,61,62}
py{39,311}-django42-wagtailmain
py311-djangomain-wagtailmain
qa

[testenv]
commands =
coverage run -a ./runtests.py

basepython =
py37: python3.7
py39: python3.9
py311: python3.11
qa: python3.9

deps =
django32: Django>=3.2,<3.3
django42: Django>=4.2,<4.3
djangomain: https://github.com/django/django/archive/main.tar.gz
wagtail41: wagtail>=4.1,<4.2
wagtail42: wagtail>=4.2,<4.3
wagtail50: wagtail>=5.0,<5.1
wagtail51: wagtail>=5.1,<5.2
wagtail52: wagtail>=5.2,<5.3
wagtail60: wagtail>=6.0,<6.1
wagtail61: wagtail>=6.1,<6.2
wagtail62: wagtail>=6.2,<6.3
wagtailmain: https://github.com/wagtail/wagtail/archive/main.tar.gz
wagtail{50,51,52}: wagtail-modeladmin>=1.0,<2.0
wagtail{60,61,62,main}: wagtail-modeladmin>=2.0,<3.0
qa: black
qa: flake8
qa: mypy
Expand Down
2 changes: 1 addition & 1 deletion wagtail_parler/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.1.1"
__version__ = "0.2.0"
default_app_config = "wagtail_parler.apps.WagtailParlerConfig"
57 changes: 0 additions & 57 deletions wagtail_parler/compat.py

This file was deleted.

Loading

0 comments on commit 44c8437

Please sign in to comment.