Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 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.13.2
rev: 6.0.1
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
rev: 7.2.0
hooks:
- id: flake8
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.26
rev: v0.9.29
hooks:
- id: pymarkdown
args:
Expand All @@ -24,4 +24,4 @@ repos:
hooks:
- id: blacken-docs
additional_dependencies:
- black==24.10.0
- black==25.1.0
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Adjust for using UV for dependency management

## [2.1.1] - 2025-05-16

- Test against Wagtail 5.2 - 6.3 and Django 4.2 - 5.1
Expand Down
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@ list:
@LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/(^|\n)# Files(\n|$$)/,/(^|\n)# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'

migrate:
@python manage.py migrate
@uv run manage.py migrate

admin:
@echo "Creating superuser"
@echo "from django.contrib.auth import get_user_model; get_user_model().objects.create_superuser('admin', '', 'admin')" | python manage.py shell
@echo "from django.contrib.auth import get_user_model; get_user_model().objects.create_superuser('admin', '', 'admin')" | uv run manage.py shell

run:
@python manage.py runserver 0.0.0.0:8000
@uv run manage.py runserver 0.0.0.0:8000

test:
@echo "Running tests..."
@coverage run manage.py test --deprecation all
@coverage report -m
@uv run coverage run manage.py test --deprecation all
@uv run coverage report -m

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

mail-stop:
@echo "Stopping mail server"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ WAGTAIL_QR_CODE = {

## Contributing

If you would like to suggest an improvement to the package [contributions](docs/contrubute.md) are welcome
If you would like to suggest an improvement to the package [contributions](docs/contribute.md) are welcome

## Issues

Expand Down
64 changes: 64 additions & 0 deletions docs/contribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Contributing

## Development setup

### Clone this repo to your computer

```bash
git clone https://github.com/nickmoreton/wagtail-qrcode
```

## Setup a virtual environment

```bash
uv venv
```

Activate the virtual environment (optional):

```bash
source .venv/bin/activate
Comment thread
nickmoreton marked this conversation as resolved.
```

## Install the package into your virtual environment

```bash
uv pip install -e ".[development]"
```

## Setup the testing app

```bash
uv run python manage.py migrate
uv run python manage.py createsuperuser
uv run python manage.py runserver
```

The app can be viewed at <http://localhost:8000>

You can log into the admin at <http://localhost:8000/admin> and use `admin` for the username & `admin` for the password.

## Setup a local mail server with docker

You can use [MailHog](docs/mailhog.md) to test email sending.
Comment thread
nickmoreton marked this conversation as resolved.

```bash
cp tests/local.py.example tests/local.py
docker run -it -p 8025:8025 -p 1025:1025 mailhog/mailhog
```

The mail-hog web interface will be available at `http://localhost:8025` **Before testing this feature** you may need to stop and start the django development server

With the test app set up: create a QRCode page and on the QRcode tab complete the field to send an email you can access the QR code sample page in the admin and add an email address before saving the page.

The email will show up in mail hog.

## Testing

The app uses django tests and has `tox` setup for running them against the compatible Wagtail and Django versions.

To run the tests:

```bash
uv run python manage.py test
```
53 changes: 0 additions & 53 deletions docs/contrubute.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/mailhog.md

This file was deleted.

35 changes: 22 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ 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"}
{ name = "Nick Moreton", email = "nickmoreton@me.com" }
]
license = {file = "LICENSE"}

classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand All @@ -28,27 +29,35 @@ classifiers = [
"Framework :: Wagtail :: 5",
"Framework :: Wagtail :: 6",
]

requires-python = ">=3.9"
dependencies =[
"Wagtail>=5.2",
"PyQRCode>=1,<2"
]

[project.optional-dependencies]
development = [
"black==24.10.0",
"flake8==7.1.1",
"isort==5.13.2",
]
testing = [
"coverage"
dependencies = [
"pyqrcode>=1,<2",
"wagtail>=5.2",
]

[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"

[dependency-groups]
dev = [
"black>=25.1.0",
"flake8>=7.2.0",
"isort>=6.0.1",
"pre-commit>=4.2.0",
]

[project.optional-dependencies]
testing = [
"coverage>=7.6.9",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.black]
line-length = 88
Expand Down
Loading