From 35284b88da4d400985b5c65aa1b66588c75dfee3 Mon Sep 17 00:00:00 2001 From: user Date: Mon, 27 Nov 2023 22:24:02 +0000 Subject: [PATCH 01/15] Fixes docs/makefile error --- CHANGELOG.md | 2 ++ Makefile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d457164..24f4a2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Add testing for Wagtail 5.2 + ## [2.0.0] - 2023-08-01 - [General tidy up around tests and docs](https://github.com/nickmoreton/wagtail-qrcode/pull/28) diff --git a/Makefile b/Makefile index 4473f1c..0b7729b 100644 --- a/Makefile +++ b/Makefile @@ -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 From bee1e2cb4c3b3990dab45fd741ddae12c908a581 Mon Sep 17 00:00:00 2001 From: Cahit Atilgan Date: Fri, 22 Dec 2023 11:17:39 +0100 Subject: [PATCH 02/15] fix(hooks): only delete document with existing qr code --- wagtail_qrcode/wagtail_hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wagtail_qrcode/wagtail_hooks.py b/wagtail_qrcode/wagtail_hooks.py index 62cc567..992b629 100644 --- a/wagtail_qrcode/wagtail_hooks.py +++ b/wagtail_qrcode/wagtail_hooks.py @@ -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() From 72a033bee96152b59d18e45c39321cbd4bd8f070 Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 13:48:54 +0100 Subject: [PATCH 03/15] Pin wagtail temporarily to 4.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5892dc2..9ce7ace 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ "Framework :: Wagtail :: 4", "Framework :: Wagtail :: 5", ], - install_requires=["Wagtail>=4.1", "PyQRCode>=1,<2"], + install_requires=["Wagtail>=4.1,<4.2", "PyQRCode>=1,<2"], extras_require={ "testing": ["coverage"], }, From 783b44ebddbf0357932474bb541f2e611c879858 Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 13:49:41 +0100 Subject: [PATCH 04/15] Update the contribute.md file to use python3 venv instead of pyenv + Some maintenance tasks --- docs/contrubute.md | 5 +++-- pyproject.toml | 51 ++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 49 -------------------------------------------- 3 files changed, 54 insertions(+), 51 deletions(-) delete mode 100644 setup.py diff --git a/docs/contrubute.md b/docs/contrubute.md index 94beb33..eb10dcc 100644 --- a/docs/contrubute.md +++ b/docs/contrubute.md @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 3a33da2..4724792 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,54 @@ +[project] +name = "wagtail-qrcode" +version = "2.0.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 = "nickmoreton@me.com"} +] +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.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Framework :: Django", + "Framework :: Django :: 3.2", + "Framework :: Django :: 4.1", + "Framework :: Django :: 4.2", + "Framework :: Wagtail", + "Framework :: Wagtail :: 4", + "Framework :: Wagtail :: 5", +] +requires-python = ">=3.9" +dependencies =[ + "Wagtail>=4.1,<5.3", + "PyQRCode>=1,<2" +] + +[project.optional-dependencies] +development = [ + "black==23.7.0", + "flake8==6.1.0", + "isort==5.12.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'] diff --git a/setup.py b/setup.py deleted file mode 100644 index 9ce7ace..0000000 --- a/setup.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python - -from os import path - -from setuptools import find_packages, setup - -from wagtail_qrcode import __version__ - -this_directory = path.abspath(path.dirname(__file__)) -with open(path.join(this_directory, "README.md"), encoding="utf-8") as f: - long_description = f.read() - -setup( - name="wagtail-qrcode", - version=__version__, - description="Create a QR code that can be used to link to a wagtail page", - long_description=long_description, - long_description_content_type="text/markdown", - author="Nick Moreton", - author_email="nickmoreton@me.com", - url="https://github.com/nickmoreton/wagtail-qrcode", - packages=find_packages(), - include_package_data=True, - license="MIT", - 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.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Framework :: Django", - "Framework :: Django :: 3.2", - "Framework :: Django :: 4.1", - "Framework :: Django :: 4.2", - "Framework :: Wagtail", - "Framework :: Wagtail :: 4", - "Framework :: Wagtail :: 5", - ], - install_requires=["Wagtail>=4.1,<4.2", "PyQRCode>=1,<2"], - extras_require={ - "testing": ["coverage"], - }, - zip_safe=False, -) From 12a474ddac631a51bb50406d1248395599746731 Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 14:39:01 +0100 Subject: [PATCH 05/15] Only test older version with sqlite3 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 66efea7..bde5890 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ usedevelop = True skip_missing_interpreters = True envlist = - py{38,39,310}-dj{32,41}-wt{41,42,50,51,52}-{sqlite,postgres,mysql} + py{38,39,310}-dj{32,41}-wt{41,42,50,51,52}-sqlite py{311}-dj{42}-wt{50,51,52}-{sqlite,postgres,mysql} [gh-actions] From 2ddfd4923b1e8b357554790344069393acccfe40 Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 14:41:46 +0100 Subject: [PATCH 06/15] Dont test sqlite3 on newest versions --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index bde5890..981fa6a 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ skip_missing_interpreters = True envlist = py{38,39,310}-dj{32,41}-wt{41,42,50,51,52}-sqlite - py{311}-dj{42}-wt{50,51,52}-{sqlite,postgres,mysql} + py{311}-dj{42}-wt{50,51,52}-{postgres,mysql} [gh-actions] python = From dadedd9a0a655a123871b33c2a951a484d0f4d8e Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 14:46:25 +0100 Subject: [PATCH 07/15] Drop support for Python 3.8 --- .github/workflows/test.yml | 6 +++--- tox.ini | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 505a6d0..0fd2086 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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"] database: ["sqlite"] steps: - uses: actions/checkout@v3 @@ -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"] database: ["postgres"] services: postgres: @@ -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"] database: ["mysql"] services: mariadb: diff --git a/tox.ini b/tox.ini index 981fa6a..9090590 100644 --- a/tox.ini +++ b/tox.ini @@ -4,12 +4,11 @@ usedevelop = True skip_missing_interpreters = True envlist = - py{38,39,310}-dj{32,41}-wt{41,42,50,51,52}-sqlite + py{39,310}-dj{32,41}-wt{41,42,50,51,52}-sqlite py{311}-dj{42}-wt{50,51,52}-{postgres,mysql} [gh-actions] python = - 3.8: py38 3.9: py39 3.10: py310 3.11: py311 From 408f490b8e4dab422313dfa9bde0eddce5635f06 Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 14:53:36 +0100 Subject: [PATCH 08/15] Test against python3.12 --- .github/workflows/test.yml | 6 +++--- tox.ini | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0fd2086..6c2ddbc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ["3.9", "3.10", "3.11"] + python: ["3.9", "3.10", "3.11", "3.12"] database: ["sqlite"] steps: - uses: actions/checkout@v3 @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ["3.9", "3.10", "3.11"] + python: ["3.9", "3.10", "3.11", "3.12"] database: ["postgres"] services: postgres: @@ -85,7 +85,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ["3.9", "3.10", "3.11"] + python: ["3.9", "3.10", "3.11", "3.12"] database: ["mysql"] services: mariadb: diff --git a/tox.ini b/tox.ini index 9090590..b273969 100644 --- a/tox.ini +++ b/tox.ini @@ -5,13 +5,14 @@ skip_missing_interpreters = True envlist = py{39,310}-dj{32,41}-wt{41,42,50,51,52}-sqlite - py{311}-dj{42}-wt{50,51,52}-{postgres,mysql} + py{311,312}-dj{42}-wt{50,51,52}-{postgres,mysql} [gh-actions] python = 3.9: py39 3.10: py310 3.11: py311 + 3.12: py312 [gh-actions:env] DATABASE = From 87dd6976ca57e8b15236d7e47b3aa7bb17ca557b Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 14:59:37 +0100 Subject: [PATCH 09/15] Don't test against Django 4.1 now, prefer Django 4.2 --- pyproject.toml | 3 +-- tox.ini | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4724792..6f14045 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,13 +15,12 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "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.1", "Framework :: Django :: 4.2", "Framework :: Wagtail", "Framework :: Wagtail :: 4", diff --git a/tox.ini b/tox.ini index b273969..57e185c 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ usedevelop = True skip_missing_interpreters = True envlist = - py{39,310}-dj{32,41}-wt{41,42,50,51,52}-sqlite + py{39,310}-dj{32}-wt{41,42,50,51,52}-sqlite py{311,312}-dj{42}-wt{50,51,52}-{postgres,mysql} [gh-actions] @@ -32,7 +32,6 @@ deps = coverage dj32: Django>=3.2,<4.0 - dj41: Django>=4.1,<4.2 dj42: Django>=4.2,<4.3 wt41: Wagtail>=4.1,<4.2 From fb213d5e4f872f45fb0d5f716029c667346af120 Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 15:05:29 +0100 Subject: [PATCH 10/15] Version is now specified in pyproject.toml --- wagtail_qrcode/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/wagtail_qrcode/__init__.py b/wagtail_qrcode/__init__.py index 7dd08b2..e69de29 100644 --- a/wagtail_qrcode/__init__.py +++ b/wagtail_qrcode/__init__.py @@ -1,2 +0,0 @@ -VERSION = (2, 0, 0) -__version__ = ".".join(map(str, VERSION)) From c193b19fd99752808d32fd9380fec7cecac739c0 Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 15:10:46 +0100 Subject: [PATCH 11/15] Update black, flake8, isort and pre-commit hooks --- .pre-commit-config.yaml | 8 ++++---- pyproject.toml | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3a186ff..e386267 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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] diff --git a/pyproject.toml b/pyproject.toml index 6f14045..fa94aac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,9 +34,9 @@ dependencies =[ [project.optional-dependencies] development = [ - "black==23.7.0", - "flake8==6.1.0", - "isort==5.12.0", + "black==24.4.2", + "flake8==7.1.0", + "isort==5.13.0", ] testing = [ "coverage" From 73aa8bad993a3fbf1db231cb0572abec6d50c872 Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 15:15:53 +0100 Subject: [PATCH 12/15] Test against Django 5.0 and Wagtail 5.2 --- pyproject.toml | 1 + tox.ini | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index fa94aac..8060c8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Framework :: Django", "Framework :: Django :: 3.2", "Framework :: Django :: 4.2", + "Framework :: Django :: 5.0", "Framework :: Wagtail", "Framework :: Wagtail :: 4", "Framework :: Wagtail :: 5", diff --git a/tox.ini b/tox.ini index 57e185c..c94693b 100644 --- a/tox.ini +++ b/tox.ini @@ -6,6 +6,7 @@ skip_missing_interpreters = True envlist = py{39,310}-dj{32}-wt{41,42,50,51,52}-sqlite py{311,312}-dj{42}-wt{50,51,52}-{postgres,mysql} + py312-dj50-wt52-sqlite [gh-actions] python = @@ -33,6 +34,7 @@ deps = dj32: Django>=3.2,<4.0 dj42: Django>=4.2,<4.3 + dj50: Django>=5.0,<5.1 wt41: Wagtail>=4.1,<4.2 wt42: Wagtail>=4.2,<5.0 From dc3301d92647e2776894d5f699984b725856f7a4 Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 16:12:37 +0100 Subject: [PATCH 13/15] Allow testing upto Wagtail 6.1, Django 5.0 --- CHANGELOG.md | 4 +++- pyproject.toml | 3 ++- tests/settings.py | 1 - tox.ini | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24f4a2e..d3cac0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ ## Unreleased -- Add testing for Wagtail 5.2 +- 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 diff --git a/pyproject.toml b/pyproject.toml index 8060c8f..bd6f6c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,10 +26,11 @@ classifiers = [ "Framework :: Wagtail", "Framework :: Wagtail :: 4", "Framework :: Wagtail :: 5", + "Framework :: Wagtail :: 6", ] requires-python = ">=3.9" dependencies =[ - "Wagtail>=4.1,<5.3", + "Wagtail>=4.1", "PyQRCode>=1,<2" ] diff --git a/tests/settings.py b/tests/settings.py index 07c1b8b..13a01a1 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -45,7 +45,6 @@ "wagtail.search", "wagtail.admin", "wagtail.api.v2", - "wagtail.contrib.modeladmin", "wagtail.contrib.routable_page", "wagtail.contrib.styleguide", "wagtail.sites", diff --git a/tox.ini b/tox.ini index c94693b..13dea1c 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ skip_missing_interpreters = True envlist = py{39,310}-dj{32}-wt{41,42,50,51,52}-sqlite py{311,312}-dj{42}-wt{50,51,52}-{postgres,mysql} - py312-dj50-wt52-sqlite + py312-dj50-wt{52,60,61}-sqlite [gh-actions] python = @@ -41,6 +41,8 @@ deps = 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 From 8a8fd61cdb887b166acc64a1726590bc24635901 Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 16:19:58 +0100 Subject: [PATCH 14/15] Adjust test matrix --- tox.ini | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 13dea1c..c9d5070 100644 --- a/tox.ini +++ b/tox.ini @@ -4,9 +4,8 @@ usedevelop = True skip_missing_interpreters = True envlist = - py{39,310}-dj{32}-wt{41,42,50,51,52}-sqlite - py{311,312}-dj{42}-wt{50,51,52}-{postgres,mysql} - py312-dj50-wt{52,60,61}-sqlite + py39-dj32-wt41-{sqlite,postgres,mysql} + py{310,311,312}-dj{42,50}-wt{52,60,61}-{sqlite,postgres,mysql} [gh-actions] python = From e4314cf39dea2c3320d50e87b48e978a03de478c Mon Sep 17 00:00:00 2001 From: nickmoreton Date: Sun, 14 Jul 2024 16:38:23 +0100 Subject: [PATCH 15/15] Release preparation for 2.1.0 --- CHANGELOG.md | 2 ++ pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3cac0b..7bf6fd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 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 diff --git a/pyproject.toml b/pyproject.toml index bd6f6c0..4b2d040 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "wagtail-qrcode" -version = "2.0.0" +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"]