Skip to content

Commit

Permalink
Merge pull request #25 from wagtail-packages/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
nickmoreton authored Jul 14, 2024
2 parents be62ae3 + 9a22212 commit f363a57
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 1,380 deletions.
5 changes: 0 additions & 5 deletions .flake8

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["3.9", "3.10", "3.11", "3.12"]
database: ["sqlite"]

steps:
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["3.9", "3.10", "3.11", "3.12"]
database: ["postgres"]

services:
Expand Down Expand Up @@ -92,12 +92,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["3.9", "3.10", "3.11", "3.12"]
database: ["mysql"]

services:
mariadb:
image: mariadb
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: mysql
options: >-
Expand Down
17 changes: 0 additions & 17 deletions .gitpod.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.1.0
hooks:
- id: flake8
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.8
rev: v0.9.21
hooks:
- id: pymarkdown
args:
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [1.1.0] 2024-07-14

- removes poetry
- Add loading the richtext filter in a template
- Fix typo in README.md
- update for wagtail 6.0, 6.1 & django 4.2 & 50
- update for python 3.9, 3.10, 3.11 & 3.12
- drop python 3.8 testing
- fix actions using mysql image

## [1.0.0] 2023-02-12

- Refactor everything
Expand Down
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Once the package is added to your Wagtail site, add one or two pieces of configu
Install the package into your python environment.

```bash
pip install wagtail-f-richext
pip install wagtail-f-richtext
```

Add the package to your INSTALLED_APS
Expand All @@ -34,6 +34,16 @@ Any css framework styles will need to be installed before you will see any style

## Using the f_richtext filter

The `f_richtext` filter can be used in your templates in the same way as the Wagtail core provided `richtext` filter.

First add the filter to your template.

```html
{% load wagtail_f_richtext %}
```

Then use it in your template.

### with a RichText field

- `{{ page.body|f_richtext:"framework" }}` will add classes to the HTML tags
Expand Down Expand Up @@ -195,11 +205,13 @@ The test app can be run to develop your contribution.
1. Fork the repo and clone it to your computer.
2. Change to the folder where you cloned it to.

With [poetry](https://python-poetry.org) installed run:
Create a virtual environment and install the dependencies:

```bash
poetry install
poetry shell
python3 -m venv venv
source venv/bin/activate
pip install -e ".[development,testing]"

# run the migrations, add an admin account and start the app
python manage.py migrate
python manage.py createsuperuser
Expand All @@ -221,3 +233,9 @@ make setup
```

will run all the above initial commands and creates a superuser with login credentials Username: `admin` Password: `admin`

## Supports

- Wagtail 4.1, 4.2, 5.0, 5.1. 5.2, 6.0
- Django 3.2, 4.0, 4.1, 4.2
- Python 3.8, 3.9, 3.10, 3.11, 3.12
1,292 changes: 0 additions & 1,292 deletions poetry.lock

This file was deleted.

87 changes: 53 additions & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,53 +1,72 @@
[tool.poetry]
[project]
name = "wagtail-f-richtext"
version = "1.0.0"
version = "1.1.0"
description = "An alternative Wagtail richtext filter that applies classes or styles to rich text HTML content."
authors = ["Nick Moreton <[email protected]>"]
license = "MIT"
classifiers=[
"Development Status :: 5 - Production/Stable",
readme = "README.md"
keywords = ["wagtail", "richtext", "filter", "html", "class", "style"]
authors = [
{name = "Nick Moreton", email = "[email protected]"}
]
license = {file = "LICENSE"}
classifiers = [
"Development Status :: 5 Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Wagtail",
"Framework :: Wagtail :: 4",
"Framework :: Wagtail :: 5",
"Framework :: Wagtail :: 6",
]
requires-python = ">=3.9"
dependencies =[
"Wagtail>=4.1",
]

[tool.poetry.dependencies]
python = "^3.7"
wagtail = "^4.1"

[tool.poetry.group.dev.dependencies]
black = "^23.1.0"
tox = "^3.26.0"
coverage = "^7.1.0"

[tool.poetry.group.dev.dependencies.pymarkdownlnt]
version = ">=0.9.7"
python = "^3.8.0"
[project.optional-dependencies]
development = [
"black==24.4.2",
"flake8==7.1.0",
"isort==5.13.0",
]
testing = [
"coverage"
]

[tool.poetry.group.dev.dependencies.flake8]
version = ">=6.0.0"
python = "^3.8.1"
[project.urls]
Repository = "https://github.com/wagtail-packages/wagtail-f-richtext"
Issues = "https://github.com/wagtail-packages/wagtail-f-richtext/issues"
Changelog = "https://github.com/wagtail-packages/wagtail-f-richtext/blob/release/CHANGELOG.md"

[tool.poetry.group.dev.dependencies.isort]
version = ">=5.0.0"
python = "^3.8"

[tool.poetry.group.dev.dependencies.pre-commit]
version = ">=3.0.0"
python = "^3.8"
[tool.black]
line-length = 88
target-version = ['py39']
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.isort]
profile = "black"
2 changes: 1 addition & 1 deletion tests/testapp/templates/blocks/f_richtext_block.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="border-box">
<p class="label">Template Tag:</p>
<div class="padding">{% verbatim %}{{ value|f_richtext:"inline_styles" }}{% endverbatim %}</div>
<p class="padding">This template tag will parse the html and inline styles defined in your configuration</p>
<p class="padding">This template tag will parse the html and add inline styles defined in your configuration</p>
<p class="label">HTML:</p>
<pre><code class="language-html"></code></pre>
<div class="beautify padding">{{ value|f_richtext:"inline_styles" }}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>{{ page.title }}</h1>
<div class="border-box">
<p class="label">Template Tag:</p>
<div class="padding">{% verbatim %}{{ page.body|f_richtext:"inline_styles" }}{% endverbatim %}</div>
<p class="padding">This template tag will parse the html and inline styles defined in your configuration</p>
<p class="padding">This template tag will parse the html and add inline styles defined in your configuration</p>
<p class="label">HTML:</p>
<pre><code class="language-html"></code></pre>
<div class="beautify padding">{{ page.body|f_richtext:"inline_styles" }}</div>
Expand Down
25 changes: 13 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
[tox]
skipsdist = True
usedevelop = True
isolated_build = True
skip_missing_interpreters = True

envlist =
py{37}-django{32}-wagtail{41,42}-{sqlite,postgres,mysql}
py{38,39,310}-django{32,40,41}-wagtail{41,42}-{sqlite,postgres,mysql}
py{311}-django{41}-wagtail{41,42}-{sqlite,postgres,mysql}
py39-dj32-wt41-{sqlite,postgres,mysql}
py{310,311,312}-dj{42,50}-wt{52,60,61}-{sqlite,postgres,mysql}

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[gh-actions:env]
DATABASE =
Expand All @@ -23,20 +21,23 @@ DATABASE =
mysql: mysql

[testenv]
skip_install = True
install_command = pip install -e ".[testing]" -U {opts} {packages}

commands =
coverage run manage.py test --deprecation all
coverage report -m

deps =
coverage

django32: Django>=3.2,<4.0
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
dj32: Django>=3.2,<4.0
dj42: Django>=4.2,<4.3
dj50: Django>=5.0,<5.1

wagtail41: Wagtail>=4.1,<4.2
wagtail42: Wagtail>=4.2,<5.0
wt41: Wagtail>=4.1,<4.2
wt52: Wagtail>=5.2,<5.3
wt60: Wagtail>=6.0,<6.1
wt61: Wagtail>=6.1,<6.2

postgres: psycopg2
mysql: mysqlclient
Expand Down
5 changes: 0 additions & 5 deletions wagtail_f_richtext/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
default_app_config = "wagtail_f_richtext.apps.WagtailFRichtextAppConfig"


VERSION = (1, 0, 0)
__version__ = ".".join(map(str, VERSION))

0 comments on commit f363a57

Please sign in to comment.