Skip to content
Open

V2 #258

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
44 changes: 28 additions & 16 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
ignore:
- dependency-name: sentry-sdk[flask]
versions:
- 0.19.5
- 0.20.0
- 0.20.1
- 0.20.2
- 0.20.3
- dependency-name: pytest
versions:
- 6.2.2
# Enable version updates for Python dependencies
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 10
labels:
- "dependencies"
- "python"
commit-message:
prefix: "deps"
include: "scope"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "ci"
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Tests

on:
push:
branches: [main, develop]
pull_request:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
# For pull requests, this ensures we checkout the PR branch, not the target branch
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"

- name: Install dependencies
run: make install-dev

- name: Run linting
run: make lint

- name: Run tests with coverage
run: make test-cov

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
53 changes: 0 additions & 53 deletions .github/workflows/test_and_deploy.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/update-postcodes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Update Postcode Data

on:
schedule:
# Run every Sunday at 2 AM UTC
- cron: '0 2 * * 0'
workflow_dispatch: # Allow manual triggering

jobs:
update-postcodes:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
uv sync

- name: Download and process postcode data
run: |
uv run python scripts/update_postcodes.py

- name: Check for changes
id: check_changes
run: |
if git diff --quiet app/data/; then
echo "changes=false" >> $GITHUB_OUTPUT
else
echo "changes=true" >> $GITHUB_OUTPUT
fi

- name: Create Pull Request
if: steps.check_changes.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Update postcode data'
title: 'Update postcode data'
body: |
Automated update of UK postcode data

This PR updates the postcode msgpack files with the latest data from:
- https://www.doogal.co.uk/UKPostcodes.php

The data has been downloaded, processed, and compressed into msgpack format.

Please review the changes and merge if everything looks good.
branch: update-postcodes-${{ github.run_number }}
delete-branch: true
labels: |
automated
data-update


67 changes: 37 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,55 +1,62 @@
# Byte-compiled / optimized / DLL files
# Python
__pycache__/
*.py[cod]

# C extensions
*$py.class
*.so

# Distribution / packaging
.Python
env/
bin/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Virtual environments
venv/
ENV/
env/
.venv

# Unit test / coverage reports
htmlcov/
.tox/
# IDEs
.vscode/
.idea/
*.swp
*.swo
*~

# Testing
.pytest_cache/
.coverage
.cache
nosetests.xml
htmlcov/
coverage.xml
*.cover

# Translations
*.mo
# uv
.uv/
uv.lock

# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# Ruff
.ruff_cache/

# Rope
.ropeproject
# Environment
.env
.env.local

# Django stuff:
*.log
*.pot
# OS
.DS_Store
Thumbs.db

# Sphinx documentation
docs/_build/
.idea
*.csv
# Temporary files
*.log
*.tmp
*.dump
*.rdb
3 changes: 3 additions & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
3.12


13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

Loading