Skip to content

Commit eca2945

Browse files
zerolabnickmoretonkatdom13
authored
Wagtail 7.3 maintenance + tooling updates (#164)
* Update testing for Python 3.14 and Wagtail 7.2, drop Python 3.9 and Wagtail 7.1 * Update testing to support Wagtail 7.3 * Update CHANGELOG.md * Bump ruff version * Bump action versions, and pin to commits --------- Co-authored-by: nickmoreton <nickmoreton@me.com> Co-authored-by: Katherine Domingo <katherine.domingo@torchbox.com> Co-authored-by: Kat <katdom13@gmail.com> Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>
1 parent 6381e2b commit eca2945

File tree

10 files changed

+68
-48
lines changed

10 files changed

+68
-48
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818
TOX_TESTENV_PASSENV: FORCE_COLOR
1919
PIP_DISABLE_PIP_VERSION_CHECK: "1"
2020
PIP_NO_PYTHON_VERSION_WARNING: "1"
21-
PYTHON_LATEST: "3.13"
21+
PYTHON_LATEST: "3.14"
2222

2323
jobs:
2424
tests:
@@ -27,11 +27,11 @@ jobs:
2727

2828
strategy:
2929
matrix:
30-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
30+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
3131

3232
steps:
3333
- name: Harden Runner
34-
uses: step-security/harden-runner@v2
34+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
3535
with:
3636
disable-sudo: true
3737
egress-policy: block
@@ -41,11 +41,11 @@ jobs:
4141
github.com:443
4242
pypi.org:443
4343
api.github.com:443
44-
- uses: actions/checkout@v4
44+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4545
with:
4646
persist-credentials: false
4747
- name: Set up Python ${{ matrix.python-version }}
48-
uses: actions/setup-python@v5
48+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
4949
with:
5050
python-version: ${{ matrix.python-version }}
5151

@@ -57,7 +57,7 @@ jobs:
5757
run: tox
5858

5959
- name: ⬆️ Upload coverage data
60-
uses: actions/upload-artifact@v4
60+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
6161
with:
6262
name: coverage-data-${{ matrix.python-version }}
6363
path: .coverage.*
@@ -71,7 +71,7 @@ jobs:
7171

7272
steps:
7373
- name: Harden Runner
74-
uses: step-security/harden-runner@v2
74+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
7575
with:
7676
disable-sudo: true
7777
egress-policy: block
@@ -81,18 +81,18 @@ jobs:
8181
github.com:443
8282
pypi.org:443
8383
api.github.com:443
84-
- uses: actions/checkout@v4
84+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8585
with:
8686
persist-credentials: false
87-
- uses: actions/setup-python@v5
87+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
8888
with:
8989
# Use latest Python, so it understands all syntax.
9090
python-version: ${{env.PYTHON_LATEST}}
9191

9292
- run: python -Im pip install --upgrade coverage
9393

9494
- name: Download coverage data
95-
uses: actions/download-artifact@v4
95+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
9696
with:
9797
pattern: coverage-data-*
9898
merge-multiple: true
@@ -105,7 +105,7 @@ jobs:
105105
echo "## Coverage summary" >> $GITHUB_STEP_SUMMARY
106106
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
107107
- name: 📈 Upload HTML report if check failed.
108-
uses: actions/upload-artifact@v4
108+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
109109
with:
110110
name: html-report
111111
path: htmlcov

.github/workflows/codeql-analysis.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,28 @@ jobs:
2121
language: [ 'javascript', 'python' ]
2222

2323
steps:
24-
- name: Checkout repository
25-
uses: actions/checkout@v4
26-
with:
27-
persist-credentials: false
24+
- name: Harden Runner
25+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
26+
with:
27+
disable-sudo: true
28+
egress-policy: block
29+
allowed-endpoints: >
30+
files.pythonhosted.org:443
31+
objects.githubusercontent.com:443
32+
github.com:443
33+
pypi.org:443
34+
api.github.com:443
2835
29-
# Initializes the CodeQL tools for scanning.
30-
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@v3
32-
with:
33-
languages: ${{ matrix.language }}
36+
- name: Checkout repository
37+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38+
with:
39+
persist-credentials: false
3440

35-
- name: Perform CodeQL Analysis
36-
uses: github/codeql-action/analyze@v3
41+
# Initializes the CodeQL tools for scanning.
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@v4
44+
with:
45+
languages: ${{ matrix.language }}
46+
47+
- name: Perform CodeQL Analysis
48+
uses: github/codeql-action/analyze@v4

.github/workflows/nightly-tests.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919
with:
2020
persist-credentials: false
2121
- name: Set up Python
22-
uses: actions/setup-python@v5
22+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2323
with:
24-
python-version: "3.13"
24+
python-version: "3.14"
2525
- name: Install dependencies
2626
run: |
2727
python -m pip install --upgrade pip tox

.github/workflows/publish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1515
with:
1616
persist-credentials: false
1717
fetch-depth: 0
1818

19-
- uses: actions/setup-python@v5
19+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2020
with:
21-
python-version: '3.13'
21+
python-version: '3.14'
2222
cache: "pip"
2323
cache-dependency-path: "**/pyproject.toml"
2424

@@ -30,7 +30,7 @@ jobs:
3030
- name: 🏗️ Build
3131
run: python -Im flit build
3232

33-
- uses: actions/upload-artifact@v4
33+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
3434
with:
3535
path: ./dist
3636

@@ -45,10 +45,10 @@ jobs:
4545
# Mandatory for trusted publishing
4646
id-token: write
4747
steps:
48-
- uses: actions/download-artifact@v4
48+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
4949

5050
- name: 🚀 Publish package distributions to PyPI
51-
uses: pypa/gh-action-pypi-publish@release/v1
51+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
5252
with:
5353
packages-dir: artifact/
5454
print-hash: true

.github/workflows/ruff.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1717
with:
1818
persist-credentials: false
1919
- name: Install Python
20-
uses: actions/setup-python@v5
20+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2121
with:
22-
python-version: "3.13"
22+
python-version: "3.14"
2323
- name: Install dependencies
2424
# keep in sync with .pre-commit-config.yaml
25-
run: python -Im pip install --user ruff==0.13.3
25+
run: python -Im pip install ruff==0.15.8
2626
- name: Run Ruff
2727
run: ruff check --output-format=github ./src/wagtailmarkdown

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ default_language_version:
77

88
repos:
99
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v5.0.0
10+
rev: v6.0.0
1111
hooks:
1212
- id: check-added-large-files
1313
- id: check-case-conflict
@@ -20,7 +20,7 @@ repos:
2020
- id: end-of-file-fixer
2121
- id: trailing-whitespace
2222
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
rev: 'v0.13.3' # keep in sync with .github/workflows/ruff.yml
23+
rev: 'v0.15.8' # keep in sync with .github/workflows/ruff.yml
2424
hooks:
2525
- id: ruff
2626
args: [ --fix, --exit-non-zero-on-fix ]

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [Unreleased]
4+
5+
## Changed
6+
7+
- Updated minimum Python requirement to 3.10
8+
- Added Wagtail 7.3 and Python 3.14 to test matrix
9+
- Dropped Python 3.9 and Wagtail 7.1 from test matrix
10+
311
## [0.13.0] - 2025-10-06
412

513
- Added support Wagtail 7.1, Django 5.2 (@damwaingames)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ classifiers = [
1414
"License :: OSI Approved :: zlib/libpng License",
1515
"Programming Language :: Python",
1616
"Programming Language :: Python :: 3",
17-
"Programming Language :: Python :: 3.9",
1817
"Programming Language :: Python :: 3.10",
1918
"Programming Language :: Python :: 3.11",
2019
"Programming Language :: Python :: 3.12",
2120
"Programming Language :: Python :: 3.13",
21+
"Programming Language :: Python :: 3.14",
2222
"Framework :: Django",
2323
"Framework :: Django :: 4.2",
2424
"Framework :: Django :: 5.1",
@@ -29,7 +29,7 @@ classifiers = [
2929
]
3030

3131
dynamic = ["version"]
32-
requires-python = ">=3.9"
32+
requires-python = ">=3.10"
3333
dependencies = [
3434
"Wagtail>=6.3",
3535
"Markdown>=3.3,<4",

src/wagtailmarkdown/mdx/inlinepatterns.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TYPE_CHECKING, Optional
1+
from typing import TYPE_CHECKING
22

33
from django.apps import apps
44
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
@@ -46,7 +46,7 @@ class ObjectLookupNegotiator:
4646
MEDIA_PREFIX = "media:"
4747

4848
@staticmethod
49-
def retrieve_page(lookup_field_value) -> Optional[Page]:
49+
def retrieve_page(lookup_field_value) -> Page | None:
5050
try:
5151
return Page.objects.get(pk=lookup_field_value)
5252
except (Page.DoesNotExist, Page.MultipleObjectsReturned):
@@ -140,7 +140,7 @@ def getLink(self, data, index):
140140
class ImageExtension(Extension):
141141
def __init__(
142142
self,
143-
object_lookup_negotiator: Optional[ObjectLookupNegotiator] = None,
143+
object_lookup_negotiator: ObjectLookupNegotiator | None = None,
144144
**kwargs,
145145
):
146146
self.object_lookup_negotiator = (
@@ -163,7 +163,7 @@ def extendMarkdown(self, md: "Markdown") -> None:
163163
class LinkExtension(Extension):
164164
def __init__(
165165
self,
166-
object_lookup_negotiator: Optional[ObjectLookupNegotiator] = None,
166+
object_lookup_negotiator: ObjectLookupNegotiator | None = None,
167167
**kwargs,
168168
):
169169
self.object_lookup_negotiator = (

tox.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
min_version = 4.22
33

44
envlist =
5-
py{39}-django42-wagtail{63}
5+
py{310}-django42-wagtail{63}
66
py{310,311}-django{51}-wagtail{70}
7-
py{312,313}-django{52}-wagtail{71}
7+
py{312,313,314}-django{52}-wagtail{73}
88

99
[gh-actions]
1010
python =
11-
3.9: py39
1211
3.10: py310
1312
3.11: py311
1413
3.12: py312
1514
3.13: py313
15+
3.14: py314
1616

1717
[testenv]
1818
package = editable
@@ -26,7 +26,7 @@ setenv =
2626
PYTHONDEVMODE = 1
2727
# use the Python 3.12+ sys.monitoring
2828
py3.12: COVERAGE_CORE=sysmon
29-
py3.13: COVERAGE_CORE=sysmon
29+
py3.14: COVERAGE_CORE=sysmon
3030

3131
extras = testing
3232

@@ -37,7 +37,7 @@ deps =
3737

3838
wagtail63: wagtail>=6.3,<6.4
3939
wagtail70: wagtail>=7.0,<7.1
40-
wagtail71: wagtail>=7.1,<7.2
40+
wagtail73: wagtail>=7.3,<7.4
4141

4242
install_command = python -m pip install -U {opts} {packages}
4343
commands =

0 commit comments

Comments
 (0)