Skip to content

Commit 638435f

Browse files
authored
Merge pull request #336 from bjester/uv-wrapup
Cleanup from UV migration + standardization of workflows and package config
2 parents d3d3a28 + f978375 commit 638435f

86 files changed

Lines changed: 752 additions & 467 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33

44
# Linting updates and fixes
55
292f58e2d60c1721349b1a0bb1bbbebf4809481e
6+
7+
# Import reformatting
8+
cff1e87a0d742be463d820382f467115fb18c8a2

.github/actionlint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
paths:
2+
.github/workflows/check_migrations_sqlite.yml:
3+
ignore:
4+
- 'SC2086:info:10:54'

.github/dependabot.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
# Keeps dependencies up to date
2-
32
version: 2
43
updates:
54
# Maintain dependencies for Python
65
- package-ecosystem: "uv"
76
directory: "/"
87
schedule:
9-
interval: "weekly"
10-
day: "friday"
8+
interval: "monthly"
119
time: "00:00"
1210
cooldown:
1311
default-days: 7
1412
# Maintain dependencies for Github Actions
1513
- package-ecosystem: "github-actions"
1614
directory: "/"
1715
schedule:
18-
interval: "weekly"
19-
day: "friday"
16+
interval: "monthly"
2017
time: "00:00"
2118
groups:
2219
github:

.github/workflows/check-docs.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Docs
2+
23
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
7+
cancel-in-progress: true
8+
39
jobs:
410
pre_job:
511
name: Path match check
@@ -13,26 +19,27 @@ jobs:
1319
with:
1420
github_token: ${{ github.token }}
1521
paths: '["docs/**", "pyproject.toml", "uv.lock"]'
22+
1623
docs:
1724
name: Checking docs build
1825
needs: pre_job
1926
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
2027
runs-on: ubuntu-latest
2128
steps:
22-
- uses: actions/checkout@v6
29+
- uses: actions/checkout@v6.0.2
2330
with:
2431
fetch-depth: 0
2532
- name: Install system dependencies
2633
run: |
2734
sudo apt-get -y -qq update
2835
sudo apt-get install -y swig openssl libssl-dev
2936
- name: Install uv
30-
uses: astral-sh/setup-uv@v7
37+
uses: astral-sh/setup-uv@v8.2.0
3138
with:
3239
python-version: "3.10"
3340
activate-environment: "true"
3441
enable-cache: "true"
3542
- name: Install dependencies
36-
run: uv sync --extra docs
43+
run: uv sync --frozen --group docs
3744
- name: Check Docs build
3845
run: make docs
Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Migrations for SQLite versions
2+
23
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
7+
cancel-in-progress: true
8+
39
jobs:
410
pre_job:
511
name: Path match check
@@ -13,33 +19,34 @@ jobs:
1319
with:
1420
github_token: ${{ github.token }}
1521
paths: '["morango/migrations/*.py", ".github/workflows/check_migrations_sqlite.yml", "pyproject.toml", "uv.lock"]'
22+
1623
build:
1724
name: Build wheel
1825
needs: pre_job
26+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
1927
runs-on: ubuntu-latest
2028
steps:
21-
- uses: actions/checkout@v6
29+
- uses: actions/checkout@v6.0.2
2230
with:
2331
fetch-depth: 0
2432
- name: Install uv
25-
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
26-
uses: astral-sh/setup-uv@v7
33+
uses: astral-sh/setup-uv@v8.2.0
2734
with:
2835
python-version: 3.9
2936
enable-cache: "true"
3037
- name: Build wheel
31-
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
3238
run: uv build --wheel
3339
- name: Upload wheel artifact
34-
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
35-
uses: actions/upload-artifact@v7
40+
uses: actions/upload-artifact@v7.0.1
3641
with:
3742
name: wheel
3843
path: dist/*.whl
3944
retention-days: 1
45+
4046
migration_test:
4147
name: SQLite migration tests
4248
needs: [pre_job, build]
49+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
4350
runs-on: ubuntu-latest
4451
container:
4552
image: python:3.7-buster
@@ -52,19 +59,16 @@ jobs:
5259
echo "Acquire::Check-Valid-Until \"false\";" > /etc/apt/apt.conf.d/99archive
5360
apt-get -y -qq update
5461
apt-get install -y build-essential tcl git-lfs
55-
- uses: actions/checkout@v6
56-
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
62+
- uses: actions/checkout@v6.0.2
5763
with:
5864
lfs: true
5965
fetch-depth: 0
6066
- name: Download wheel artifact
61-
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
62-
uses: actions/download-artifact@v8
67+
uses: actions/download-artifact@v8.0.1
6368
with:
6469
name: wheel
6570
path: dist/
6671
- name: Build SQLite 3.25.3
67-
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
6872
run: |
6973
# Following the instructions from https://til.simonwillison.net/sqlite/ld-preload
7074
# to build SQLite from source, using version 3.25.3
@@ -76,16 +80,21 @@ jobs:
7680
'import sqlite3; assert sqlite3.connect(":memory").execute("select sqlite_version()").fetchone()[0] == "3.25.3"'
7781
# Once we have confirmed that this works, set it for subsequent steps
7882
echo "LD_PRELOAD=$(realpath .libs/libsqlite3.so)" >> $GITHUB_ENV
79-
- uses: actions/cache@v5
80-
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
83+
- uses: actions/cache@v5.0.5
8184
with:
8285
path: ~/.cache/pip
8386
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
8487
restore-keys: |
8588
${{ runner.os }}-pip-
89+
- name: Install uv
90+
uses: astral-sh/setup-uv@v8.2.0
91+
with:
92+
enable-cache: "true"
93+
- name: Manually install test dependencies
94+
run: |
95+
uv pip install --system --group test
8696
- name: Install dependencies
87-
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
88-
run: pip install $(ls dist/*.whl | head -n 1)[test]
97+
run: pip install "$(find dist -name '*.whl' | head -n 1)"
8998
- name: Run migrations
9099
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
91100
run: python tests/testapp/manage.py migrate

.github/workflows/pre-commit.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release-v**'
7+
pull_request:
8+
branches:
9+
- 'release-v**'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
pre_job:
17+
name: Path match check
18+
runs-on: ubuntu-latest
19+
# Map a step output to a job output
20+
outputs:
21+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
22+
steps:
23+
- id: skip_check
24+
uses: fkirc/skip-duplicate-actions@master
25+
with:
26+
github_token: ${{ github.token }}
27+
paths_ignore: '["**.po", "**.json"]'
28+
29+
linting:
30+
name: All file linting
31+
needs: pre_job
32+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v6.0.2
36+
- uses: astral-sh/setup-uv@v8.2.0
37+
with:
38+
enable-cache: true
39+
cache-python: true
40+
- name: Install and verify lock
41+
run: uv sync --group dev --locked
42+
- name: Run prek hooks
43+
run: uv run prek run --all-files --show-diff-on-failure

.github/workflows/python-publish.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
# This workflow will upload a Python Package using uv when a release is created
2-
# uv provides fast, modern Python package building and publishing
3-
41
name: Upload Python Package
2+
53
on:
64
release:
75
types: [published]
6+
87
jobs:
98
deploy:
109
runs-on: ubuntu-22.04
1110
steps:
12-
- uses: actions/checkout@v6
11+
- uses: actions/checkout@v6.0.2
1312
with:
1413
fetch-depth: 0
1514
- name: Install uv
16-
uses: astral-sh/setup-uv@v7
15+
uses: astral-sh/setup-uv@v8.2.0
1716
with:
1817
python-version: 3.9
1918
activate-environment: "true"

0 commit comments

Comments
 (0)