Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatible Wagtail 6.3, Django 5.1 #227

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.12
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.12
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.12
- name: Install build requirements
run: python -m pip install wheel
- name: Build package
Expand Down
63 changes: 12 additions & 51 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: Python Tests

on: [push]
Expand All @@ -7,13 +6,15 @@ jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.12"
- name: Install dependencies
run: pip install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Validate formatting
run: tox -e format

Expand All @@ -22,58 +23,18 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.12"]
tox_env:
- py311-dj41-wt41
- py311-dj41-wt50
- py311-dj41-wt51
- py311-dj41-wt52
include:
- python-version: "3.11"
tox_env: py311-dj41-wt41
- python-version: "3.11"
tox_env: py311-dj41-wt50
- python-version: "3.11"
tox_env: py311-dj41-wt51
- python-version: "3.11"
tox_env: py311-dj41-wt52

- py312-dj51-wt63
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
- name: Run tests with tox
run: tox -e ${{ matrix.tox_env }} -- index-url=https://pypi.python.org/simple/
- name: Prepare artifacts
run: mkdir -p .coverage-data && mv .coverage.* .coverage-data/
- uses: actions/upload-artifact@master
with:
name: coverage-data
path: .coverage-data/

coverage:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@master
with:
name: coverage-data
path: .
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Prepare Coverage report
run: tox -e coverage-report
- name: Upload to codecov
uses: codecov/[email protected]
6 changes: 3 additions & 3 deletions example/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from django.db import migrations, models
import django.db.models.deletion
import wagtail.core.blocks
import wagtail.core.fields
import wagtail

import wagtailstreamforms.blocks


Expand All @@ -20,7 +20,7 @@ class Migration(migrations.Migration):
name='BasicPage',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
('body', wagtail.core.fields.StreamField((('rich_text', wagtail.core.blocks.RichTextBlock()), ('form', wagtail.core.blocks.StructBlock((('form', wagtailstreamforms.blocks.FormChooserBlock()), ('form_action', wagtail.core.blocks.CharBlock(help_text='The form post action. "" or "." for the current page or a url', required=False)), ('form_reference', wagtailstreamforms.blocks.InfoBlock(help_text='This form will be given a unique reference once saved', required=False)))))))),
('body', wagtail.fields.StreamField((('rich_text', wagtail.blocks.RichTextBlock()), ('form', wagtail.blocks.StructBlock((('form', wagtailstreamforms.blocks.FormChooserBlock()), ('form_action', wagtail.blocks.CharBlock(help_text='The form post action. "" or "." for the current page or a url', required=False)), ('form_reference', wagtailstreamforms.blocks.InfoBlock(help_text='This form will be given a unique reference once saved', required=False)))))))),
],
options={
'abstract': False,
Expand Down
4 changes: 2 additions & 2 deletions example/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.db import models

from wagtail.admin.panels import StreamFieldPanel
from wagtail import blocks
from wagtail.admin.panels import FieldPanel
from wagtail.fields import StreamField
from wagtail.models import Page
from wagtailstreamforms.blocks import WagtailFormBlock
Expand All @@ -23,5 +23,5 @@ class BasicPage(Page):
show_in_menus_default = True

content_panels = Page.content_panels + [
StreamFieldPanel('body'),
FieldPanel('body'),
]
24 changes: 12 additions & 12 deletions example/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Security

SECRET_KEY = environ.get('SECRET_KEY', '')
SECRET_KEY = environ.get('SECRET_KEY', 's3cr3t')

DEBUG = True

Expand Down Expand Up @@ -37,12 +37,11 @@
'wagtail.search',
'wagtail.contrib.redirects',
'wagtail.sites',
'wagtail.contrib.modeladmin',
'wagtail.contrib.postgres_search',
'wagtail_modeladmin',
'wagtail.contrib.settings',
'wagtail.contrib.search_promotions',

'captcha',
'django_recaptcha',
'taggit',

# app specific
Expand Down Expand Up @@ -90,14 +89,14 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': environ.get('RDS_HOSTNAME'),
'PORT': environ.get('RDS_PORT'),
'NAME': environ.get('RDS_DB_NAME'),
'USER': environ.get('RDS_USERNAME'),
'PASSWORD': environ.get('RDS_PASSWORD'),
'HOST': environ.get('DB_HOSTNAME'),
'PORT': environ.get('DB_PORT'),
'NAME': environ.get('DB_NAME'),
'USER': environ.get('DB_USERNAME'),
'PASSWORD': environ.get('DB_PASSWORD'),
}
}

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

# Email

Expand Down Expand Up @@ -143,7 +142,7 @@
# Wagtail

WAGTAIL_SITE_NAME = 'example.com'

WAGTAILADMIN_BASE_URL = "/"

# Forms

Expand All @@ -156,4 +155,5 @@
RECAPTCHA_PUBLIC_KEY = '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI'
RECAPTCHA_PRIVATE_KEY = '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe'
NOCAPTCHA = True
SILENCED_SYSTEM_CHECKS = ['captcha.recaptcha_test_key_error']
SILENCED_SYSTEM_CHECKS = ['django_recaptcha.recaptcha_test_key_error']

2 changes: 1 addition & 1 deletion example/wagtailstreamforms_fields.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django import forms
from django.contrib.auth.models import User
from django_recaptcha.fields import ReCaptchaField

from captcha.fields import ReCaptchaField
from wagtail import blocks
from wagtailstreamforms.fields import BaseField, register

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length=99
target-version=["py39"]
target-version=["py312"]
exclude = '''
/(
\.git
Expand Down
2 changes: 1 addition & 1 deletion readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
python:
version: 3.5
version: 3.12
pip_install: true
requirements_file: docs/requirements.txt
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# The app itself
-e .

Django>=3.2
Django>=5
mock
psycopg2-binary

# example site
django-recaptcha
wagtail-modeladmin
16 changes: 5 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@


install_requires = [
"wagtail>=4.1,<5.3",
"wagtail>6.0,<=6.3",
"Unidecode>=0.04.14,<2.0",
"wagtail-generic-chooser>=0.5.0,<0.7",
"wagtail-modeladmin",
]

documentation_extras = [
Expand Down Expand Up @@ -61,17 +61,11 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.12",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5",
"Framework :: Wagtail",
"Framework :: Wagtail :: 4",
"Framework :: Wagtail :: 6",
"Topic :: Internet :: WWW/HTTP :: Site Management",
],
)
Loading