Skip to content

Commit

Permalink
Merge pull request #47 from wagtail-packages/release
Browse files Browse the repository at this point in the history
Fixes docs/makefile error
  • Loading branch information
nickmoreton authored Jul 14, 2024
2 parents 36f4bd4 + e4314cf commit 6734169
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 67 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
python: ["3.9", "3.10", "3.11", "3.12"]
database: ["sqlite"]
steps:
- uses: actions/checkout@v3
Expand All @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
python: ["3.9", "3.10", "3.11", "3.12"]
database: ["postgres"]
services:
postgres:
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
python: ["3.9", "3.10", "3.11", "3.12"]
database: ["mysql"]
services:
mariadb:
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.1.0
hooks:
- id: flake8
- repo: https://github.com/jackdewinter/pymarkdown
Expand All @@ -23,4 +23,4 @@ repos:
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.7.0]
additional_dependencies: [black==24.4.2]
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

## [2.1.0] - 2024-07-14

- Add testing for Wagtail 5.2 & 6.0
- Add testing for Django 5.0
- Add testing for Python 3.12

## [2.0.0] - 2023-08-01

- [General tidy up around tests and docs](https://github.com/nickmoreton/wagtail-qrcode/pull/28)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test:

mail:
@echo "Starting mail server"
@cp wagtail_qrcode/test/local.py.example wagtail_qrcode/test/local.py
@cp tests/local.py.example tests/local.py
@docker run -d -p 8025:8025 -p 1025:1025 --name mailhog mailhog/mailhog
@make run

Expand Down
5 changes: 3 additions & 2 deletions docs/contrubute.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ git clone https://github.com/nickmoreton/wagtail-qrcode
## Setup a virtual environment

```bash
pyenv virtualenv wagtail-qrcode && pyenv activate wagtail-qrcode
python3 -m venv venv
source venv/bin/activate
```

## Install the package into your virtual environment

```bash
pip install -e ".[testing]"
pip install -e ".[development,testing]"
```

## Setup the testing app
Expand Down
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
[project]
name = "wagtail-qrcode"
version = "2.1.0"
description = "Create a QR code that can be used to link to a wagtail page"
readme = "README.md"
keywords = ["wagtail", "qrcode"]
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.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.2",
"Framework :: Django :: 5.0",
"Framework :: Wagtail",
"Framework :: Wagtail :: 4",
"Framework :: Wagtail :: 5",
"Framework :: Wagtail :: 6",
]
requires-python = ">=3.9"
dependencies =[
"Wagtail>=4.1",
"PyQRCode>=1,<2"
]

[project.optional-dependencies]
development = [
"black==24.4.2",
"flake8==7.1.0",
"isort==5.13.0",
]
testing = [
"coverage"
]

[project.urls]
Repository = "https://github.com/wagtail-packages/wagtail-qrcode"
Issues = "https://github.com/wagtail-packages/wagtail-qrcode/issues"
Changelog = "https://github.com/wagtail-packages/wagtail-qrcode/blob/release/CHANGELOG.md"


[tool.black]
line-length = 88
target-version = ['py39']
Expand Down
49 changes: 0 additions & 49 deletions setup.py

This file was deleted.

1 change: 0 additions & 1 deletion tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"wagtail.search",
"wagtail.admin",
"wagtail.api.v2",
"wagtail.contrib.modeladmin",
"wagtail.contrib.routable_page",
"wagtail.contrib.styleguide",
"wagtail.sites",
Expand Down
10 changes: 6 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ usedevelop = True
skip_missing_interpreters = True

envlist =
py{38,39,310}-dj{32,41}-wt{41,42,50,51,52}-{sqlite,postgres,mysql}
py{311}-dj{42}-wt{50,51,52}-{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.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[gh-actions:env]
DATABASE =
Expand All @@ -32,14 +32,16 @@ deps =
coverage

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

wt41: Wagtail>=4.1,<4.2
wt42: Wagtail>=4.2,<5.0
wt50: Wagtail>=5.0,<5.1
wt51: Wagtail>=5.1,<5.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
2 changes: 0 additions & 2 deletions wagtail_qrcode/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
VERSION = (2, 0, 0)
__version__ = ".".join(map(str, VERSION))
2 changes: 1 addition & 1 deletion wagtail_qrcode/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def send_qr_code_email(page, email=None, subject=None, body=None):

@hooks.register("after_delete_page")
def delete_document(request, page):
if is_qrcode_instance(page):
if is_qrcode_instance(page) and page.qr_code_eps:
doc = get_document_model().objects.filter(id=page.qr_code_eps.id)
if doc:
doc.delete()
Expand Down

0 comments on commit 6734169

Please sign in to comment.