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
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Linting updates and fixes
292f58e2d60c1721349b1a0bb1bbbebf4809481e

# Import reformatting
cff1e87a0d742be463d820382f467115fb18c8a2
4 changes: 4 additions & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
paths:
.github/workflows/check_migrations_sqlite.yml:
ignore:
- 'SC2086:info:10:54'
7 changes: 2 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
# Keeps dependencies up to date

version: 2
updates:
# Maintain dependencies for Python
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
day: "friday"
interval: "monthly"
time: "00:00"
cooldown:
default-days: 7
# Maintain dependencies for Github Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "friday"
interval: "monthly"
time: "00:00"
groups:
github:
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Docs

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
pre_job:
name: Path match check
Expand All @@ -13,26 +19,27 @@ jobs:
with:
github_token: ${{ github.token }}
paths: '["docs/**", "pyproject.toml", "uv.lock"]'

docs:
name: Checking docs build
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Install system dependencies
run: |
sudo apt-get -y -qq update
sudo apt-get install -y swig openssl libssl-dev
- name: Install uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@v8.2.0
with:
python-version: "3.10"
activate-environment: "true"
enable-cache: "true"
- name: Install dependencies
run: uv sync --extra docs
run: uv sync --frozen --group docs
- name: Check Docs build
run: make docs
39 changes: 24 additions & 15 deletions .github/workflows/check_migrations_sqlite.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Migrations for SQLite versions

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
pre_job:
name: Path match check
Expand All @@ -13,33 +19,34 @@ jobs:
with:
github_token: ${{ github.token }}
paths: '["morango/migrations/*.py", ".github/workflows/check_migrations_sqlite.yml", "pyproject.toml", "uv.lock"]'

build:
name: Build wheel
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Install uv
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@v8.2.0
with:
python-version: 3.9
enable-cache: "true"
- name: Build wheel
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: uv build --wheel
- name: Upload wheel artifact
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v7.0.1
with:
name: wheel
path: dist/*.whl
retention-days: 1

migration_test:
name: SQLite migration tests
needs: [pre_job, build]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
container:
image: python:3.7-buster
Expand All @@ -52,19 +59,16 @@ jobs:
echo "Acquire::Check-Valid-Until \"false\";" > /etc/apt/apt.conf.d/99archive
apt-get -y -qq update
apt-get install -y build-essential tcl git-lfs
- uses: actions/checkout@v6
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
- uses: actions/checkout@v6.0.2
with:
lfs: true
fetch-depth: 0
- name: Download wheel artifact
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/download-artifact@v8
uses: actions/download-artifact@v8.0.1
with:
name: wheel
path: dist/
- name: Build SQLite 3.25.3
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: |
# Following the instructions from https://til.simonwillison.net/sqlite/ld-preload
# to build SQLite from source, using version 3.25.3
Expand All @@ -76,16 +80,21 @@ jobs:
'import sqlite3; assert sqlite3.connect(":memory").execute("select sqlite_version()").fetchone()[0] == "3.25.3"'
# Once we have confirmed that this works, set it for subsequent steps
echo "LD_PRELOAD=$(realpath .libs/libsqlite3.so)" >> $GITHUB_ENV
- uses: actions/cache@v5
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
- uses: actions/cache@v5.0.5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install uv
uses: astral-sh/setup-uv@v8.2.0
with:
enable-cache: "true"
- name: Manually install test dependencies
run: |
uv pip install --system --group test
- name: Install dependencies
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: pip install $(ls dist/*.whl | head -n 1)[test]
run: pip install "$(find dist -name '*.whl' | head -n 1)"
- name: Run migrations
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: python tests/testapp/manage.py migrate
43 changes: 43 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Linting

on:
push:
branches:
- 'release-v**'
pull_request:
branches:
- 'release-v**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
pre_job:
name: Path match check
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
Comment thread
bjester marked this conversation as resolved.
paths_ignore: '["**.po", "**.json"]'

linting:
name: All file linting
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
Comment thread
bjester marked this conversation as resolved.
- uses: astral-sh/setup-uv@v8.2.0
with:
enable-cache: true
cache-python: true
- name: Install and verify lock
run: uv sync --group dev --locked
- name: Run prek hooks
run: uv run prek run --all-files --show-diff-on-failure
9 changes: 4 additions & 5 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# This workflow will upload a Python Package using uv when a release is created
# uv provides fast, modern Python package building and publishing

name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@v8.2.0
with:
python-version: 3.9
activate-environment: "true"
Expand Down
Loading
Loading