Skip to content

Commit 6884ab8

Browse files
zerolabnickmoreton
andauthored
Support/wagtail 63 (#149)
* Adds Wagtail 6.3 to the test matrix. Also: - Removes Python 3.8 from the test matrix. - Adds Django 5.1 to the test matrix. - Updates the classifiers in `pyproject.toml` to include Django 5.1 and Wagtail 6.3. - Updates the `tox.ini` file to include Django 5.1 and Wagtail 6.3 in the test matrix. * Update the CHANGELOG * Add Python 3.13 to the mix * Bump ruff to 0.8.2 * Fix coverage upload * Harden GH checkout action * Use the Python 3.12+ sys.monitoring for coverage --------- Co-authored-by: nickmoreton <[email protected]>
1 parent 271baec commit 6884ab8

File tree

11 files changed

+57
-34
lines changed

11 files changed

+57
-34
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 2 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.12"
21+
PYTHON_LATEST: "3.13"
2222

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

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

3232
steps:
3333
- name: Harden Runner
@@ -37,10 +37,13 @@ jobs:
3737
egress-policy: block
3838
allowed-endpoints: >
3939
files.pythonhosted.org:443
40+
objects.githubusercontent.com:443
4041
github.com:443
4142
pypi.org:443
4243
api.github.com:443
4344
- uses: actions/checkout@v4
45+
with:
46+
persist-credentials: false
4447
- name: Set up Python ${{ matrix.python-version }}
4548
uses: actions/setup-python@v5
4649
with:
@@ -58,6 +61,7 @@ jobs:
5861
with:
5962
name: coverage-data-${{ matrix.python-version }}
6063
path: .coverage.*
64+
include-hidden-files: true
6165
if-no-files-found: ignore
6266
retention-days: 1
6367

@@ -73,10 +77,13 @@ jobs:
7377
egress-policy: block
7478
allowed-endpoints: >
7579
files.pythonhosted.org:443
80+
objects.githubusercontent.com:443
7681
github.com:443
7782
pypi.org:443
7883
api.github.com:443
7984
- uses: actions/checkout@v4
85+
with:
86+
persist-credentials: false
8087
- uses: actions/setup-python@v5
8188
with:
8289
# Use latest Python, so it understands all syntax.

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
steps:
2424
- name: Checkout repository
2525
uses: actions/checkout@v4
26+
with:
27+
persist-credentials: false
2628

2729
# Initializes the CodeQL tools for scanning.
2830
- name: Initialize CodeQL

.github/workflows/nightly-tests.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v4
19-
- name: Set up Python 3.12
19+
with:
20+
persist-credentials: false
21+
- name: Set up Python
2022
uses: actions/setup-python@v5
2123
with:
22-
python-version: "3.12"
24+
python-version: "3.13"
2325
- name: Install dependencies
2426
run: |
25-
python -m pip install --upgrade pip
26-
python -m pip install --upgrade tox
27+
python -m pip install --upgrade pip tox
2728
- name: Test
2829
id: test
2930
continue-on-error: true

.github/workflows/publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515
with:
16+
persist-credentials: false
1617
fetch-depth: 0
1718

1819
- uses: actions/setup-python@v5
1920
with:
20-
python-version: '3.12'
21+
python-version: '3.13'
2122
cache: "pip"
2223
cache-dependency-path: "**/pyproject.toml"
2324

.github/workflows/ruff.yml

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

1515
steps:
16-
- uses: actions/checkout@v4
17-
18-
- run: python -Im pip install --user ruff
19-
20-
- name: Run ruff
21-
working-directory: ./src
22-
run: ruff --output-format=github wagtailmarkdown
16+
- uses: actions/checkout@v4
17+
with:
18+
persist-credentials: false
19+
- name: Install Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.13"
23+
- name: Install dependencies
24+
# keep in sync with .pre-commit-config.yaml
25+
run: python -Im pip install --user ruff==0.8.2
26+
- name: Run Ruff
27+
run: ruff check --output-format=github ./src/wagtailmarkdown

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ ci:
33
autoupdate_schedule: 'quarterly'
44

55
default_language_version:
6-
python: python3.12
6+
python: python3.13
77

88
repos:
99
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v4.5.0
10+
rev: v5.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.3.0'
23+
rev: 'v0.8.2' # 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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## [Unreleased]
44

5+
- Add tox testing for wagtail 6.2 and 6.3 and include Django 5.1
6+
- Update the ruff github action which fixes the error seen in CI
7+
58
## [0.12.1] - 2024-03-09
69

710
### Fixed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ And render the content in a template:
299299

300300
## Compatibility
301301

302-
wagtail-markdown supports Wagtail 4.1 and above, python-markdown 3.3 and above.
302+
wagtail-markdown supports Wagtail 5.2 and above, python-markdown 3.3 and above.
303303

304304
## Contributing
305305

@@ -347,11 +347,11 @@ tox -p
347347
To run tests for a specific environment:
348348

349349
```shell
350-
tox -e py312-django5.0-wagtail6.0
350+
tox -e py313-django5.1-wagtail6.3
351351
```
352352

353353
or, a specific test
354354

355355
```shell
356-
tox -e py312-django5.0-wagtail6.0 -- tests.testapp.tests.test_admin.TestFieldsAdmin
356+
tox -e py313-django5.1-wagtail6.3 -- tests.testapp.tests.test_admin.TestFieldsAdmin
357357
```

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ classifiers = [
1414
"License :: OSI Approved :: zlib/libpng License",
1515
"Programming Language :: Python",
1616
"Programming Language :: Python :: 3",
17-
"Programming Language :: Python :: 3.8",
1817
"Programming Language :: Python :: 3.9",
1918
"Programming Language :: Python :: 3.10",
2019
"Programming Language :: Python :: 3.11",
2120
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
2222
"Framework :: Django",
23-
"Framework :: Django :: 3.2",
2423
"Framework :: Django :: 4.2",
2524
"Framework :: Django :: 5.0",
25+
"Framework :: Django :: 5.1",
2626
"Framework :: Wagtail",
2727
"Framework :: Wagtail :: 5",
2828
"Framework :: Wagtail :: 6",
2929
]
3030

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

src/wagtailmarkdown/mdx/linkers/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def run(self, fname, options):
3333
opts["classname"] = "full-width"
3434
elif opt == "width":
3535
with contextlib.suppress(ValueError):
36-
opts["spec"] = "width-%d" % int(value)
36+
opts["spec"] = f"width-{int(value)}"
3737

3838
try:
3939
image = get_image_model().objects.get(title=fname)

0 commit comments

Comments
 (0)