Skip to content
Merged
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
12 changes: 0 additions & 12 deletions .bumpversion.cfg

This file was deleted.

5 changes: 5 additions & 0 deletions .changes/0.1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 0.1.0 - 2016-12-14

### Added

* Initial release.
5 changes: 5 additions & 0 deletions .changes/0.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 0.2.0 - 2016-12-14

### Changed

* Publish a POST request instead of a GET request. This is also protected by a CSRF check.
5 changes: 5 additions & 0 deletions .changes/0.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 0.3.0 - 2017-02-22

### Fixed

* Fix the apiwise backend.
5 changes: 5 additions & 0 deletions .changes/0.4.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 0.4.0 - 2017-02-23

### Fixed

* Handle PostcodeLookupExceptions in the view.
9 changes: 9 additions & 0 deletions .changes/1.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## 1.0.0 - 2022-01-26

### Added

* Add Postcode API NU backend.

### Changed

* Major update of package.
5 changes: 5 additions & 0 deletions .changes/1.0.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 1.0.1 - 2022-01-28

### Changed

* Set the current package version to 1.0.1.
3 changes: 3 additions & 0 deletions .changes/header.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog

All notable changes to this project are documented in this file.
Empty file added .changes/unreleased/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions .changes/unreleased/added-20260601-113113.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: added
body: Added support for Django >= 5.2
time: 2026-06-01T11:31:13.079205+02:00
3 changes: 3 additions & 0 deletions .changes/unreleased/changed-20260601-113238.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: changed
body: Implemented changelog management via changie
time: 2026-06-01T11:32:38.368295+02:00
3 changes: 3 additions & 0 deletions .changes/unreleased/changed-20260601-141018.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: changed
body: Replace setuptools for UV
time: 2026-06-01T14:10:18.684072+02:00
3 changes: 3 additions & 0 deletions .changes/unreleased/changed-20260601-141028.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: changed
body: Replace flake8 for ruff
time: 2026-06-01T14:10:28.372381+02:00
3 changes: 3 additions & 0 deletions .changes/unreleased/removed-20260601-113044.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: removed
body: Removed support for Django < 5.2
time: 2026-06-01T11:30:44.046835+02:00
40 changes: 40 additions & 0 deletions .changie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
changesDir: .changes
unreleasedDir: unreleased
headerPath: header.tpl.md
changelogPath: CHANGELOG.md
versionExt: md
versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}'
kindFormat: '### {{.Kind}}'
changeFormat: '* {{.Body}}'
kinds:
- label: Added
key: added
auto: minor
- label: Changed
key: changed
auto: minor
- label: Deprecated
key: deprecated
auto: minor
- label: Removed
key: removed
auto: major
- label: Fixed
key: fixed
auto: patch
- label: Security
key: security
auto: patch
newlines:
afterChangelogHeader: 1
afterChangelogVersion: 1
beforeKind: 1
afterKind: 1
endOfVersion: 1
replacements:
- path: pyproject.toml
find: '^version = ".*"$'
replace: 'version = "{{.VersionNoPrefix}}"'
- path: src/django_postcode_lookup/__init__.py
find: '^VERSION = \(.*\)$'
replace: 'VERSION = ({{.Major}}, {{.Minor}}, {{.Patch}}, "final", 1)'
31 changes: 31 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Changelog

on:
push:
branches: ["main", "master"]
paths:
- ".changie.yaml"
- ".changes/**"
pull_request:
branches: ["**"]
paths:
- ".changie.yaml"
- ".changes/**"

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Validate changie fragments
uses: miniscruff/changie-action@11bcad388e7973948cbcecb10863baf024d5f607 # v3.0.0
with:
version: latest
args: batch patch --dry-run
2 changes: 1 addition & 1 deletion .github/workflows/pinact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
persist-credentials: false

- name: Pin actions
uses: suzuki-shunsuke/pinact-action@cf51507d80d4d6522a07348e3d58790290eaf0b6 # v2.0.0
uses: suzuki-shunsuke/pinact-action@896d595f299e71d65b9d28349d6956abe144390a # v3.0.0
with:
skip_push: true
verify: true
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Prepare release PR

on:
workflow_dispatch:
inputs:
version:
description: "Release version, or major/minor/patch/auto"
required: true
default: "auto"

permissions:
contents: write
pull-requests: write

jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Batch changelog fragments
uses: miniscruff/changie-action@11bcad388e7973948cbcecb10863baf024d5f607 # v3.0.0
with:
version: latest
args: batch ${{ inputs.version }} --allow-no-changes=false

- name: Merge changelog
uses: miniscruff/changie-action@11bcad388e7973948cbcecb10863baf024d5f607 # v3.0.0
with:
version: latest
args: merge

- name: Read release version
id: latest
uses: miniscruff/changie-action@11bcad388e7973948cbcecb10863baf024d5f607 # v3.0.0
with:
version: latest
args: latest

- name: Create release pull request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
title: Release ${{ steps.latest.outputs.output }}
branch: release/${{ steps.latest.outputs.output }}
commit-message: Release ${{ steps.latest.outputs.output }}
body: |
Batches changie fragments and updates the changelog for `${{ steps.latest.outputs.output }}`.

Merge this pull request to publish the package and create the GitHub release.
95 changes: 84 additions & 11 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,98 @@
---
name: Release to PyPi
name: Release

on:
release:
types: [created]
push:
branches: ["main", "master"]
paths:
- "CHANGELOG.md"

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up Python 3.8
uses: actions/setup-python@0f07f7f756721ebd886c2462646a35f78a8bc4de # v1.2.4
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.8
- name: Install build requirements
run: python -m pip install wheel
python-version: "3.13"

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: false

- name: Read release version
id: release
run: |
version=$(python - <<'PY'
import tomllib
from pathlib import Path

pyproject = tomllib.loads(Path("pyproject.toml").read_text())
print(pyproject["project"]["version"])
PY
)
notes=".changes/${version}.md"
if [ ! -f "$notes" ]; then
echo "Missing release notes: $notes" >&2
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "notes=$notes" >> "$GITHUB_OUTPUT"

- name: Check version changed
id: version-changed
run: |
previous_version=$(git show "${{ github.event.before }}:pyproject.toml" | python -c '
import sys
import tomllib

print(tomllib.loads(sys.stdin.read())["project"]["version"])
'
)
if [ "$previous_version" = "${{ steps.release.outputs.version }}" ]; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Check for existing release
id: existing-release
if: steps.version-changed.outputs.changed == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
if gh release view "${{ steps.release.outputs.version }}" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi

- name: Build package
run: python setup.py sdist bdist_wheel
if: steps.version-changed.outputs.changed == 'true' && steps.existing-release.outputs.exists == 'false'
run: uv build

- name: Publish package
if: steps.version-changed.outputs.changed == 'true' && steps.existing-release.outputs.exists == 'false'
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
user: __token__
password: ${{ secrets.pypi_password }}

- name: Create GitHub release
if: steps.version-changed.outputs.changed == 'true' && steps.existing-release.outputs.exists == 'false'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ steps.release.outputs.version }}" \
--title "${{ steps.release.outputs.version }}" \
--notes-file "${{ steps.release.outputs.notes }}" \
dist/*
47 changes: 47 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Tests

on:
push:
branches: ["main", "master"]
pull_request:
branches: ["**"]

permissions:
contents: read

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
django-version: ["5.2.*", "6.0.*"]
exclude:
- python-version: "3.10"
django-version: "6.0.*"
- python-version: "3.11"
django-version: "6.0.*"
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0

- name: Install dependencies
run: uv sync --group test

- name: Install Django ${{ matrix.django-version }}
run: uv pip install "Django==${{ matrix.django-version }}"

- name: Run lint
run: uv run --group test ruff check

- name: Run tests
run: uv run --group test pytest
2 changes: 1 addition & 1 deletion .github/workflows/zizmor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
persist-credentials: false

- name: Run zizmor
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
with:
advanced-security: false
annotations: true
Expand Down
Loading
Loading