Skip to content

Commit 2d9e348

Browse files
committed
Merge branch 'main' into add-lowest-dependency-test
2 parents 1226aa3 + adf3271 commit 2d9e348

24 files changed

+1138
-1131
lines changed

.github/workflows/shared.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Shared Checks
33
on:
44
workflow_call:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
pre-commit:
811
runs-on: ubuntu-latest
@@ -54,3 +57,18 @@ jobs:
5457
uv run --no-sync pytest
5558
env:
5659
UV_RESOLUTION: lowest-direct
60+
readme-snippets:
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v4
64+
65+
- uses: astral-sh/setup-uv@v5
66+
with:
67+
enable-cache: true
68+
version: 0.7.2
69+
70+
- name: Install dependencies
71+
run: uv sync --frozen --all-extras --python 3.10
72+
73+
- name: Check README snippets are up to date
74+
run: uv run --frozen scripts/update_readme_snippets.py --check

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ repos:
2323
types: [python]
2424
language: system
2525
pass_filenames: false
26+
exclude: ^README\.md$
2627
- id: pyright
2728
name: pyright
2829
entry: uv run pyright
@@ -36,3 +37,9 @@ repos:
3637
language: system
3738
files: ^(pyproject\.toml|uv\.lock)$
3839
pass_filenames: false
40+
- id: readme-snippets
41+
name: Check README snippets are up to date
42+
entry: uv run scripts/update_readme_snippets.py --check
43+
language: system
44+
files: ^(README\.md|examples/.*\.py|scripts/update_readme_snippets\.py)$
45+
pass_filenames: false

CONTRIBUTING.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ uv run ruff check .
4040
uv run ruff format .
4141
```
4242

43-
7. Submit a pull request to the same branch you branched from
43+
7. Update README snippets if you modified example code:
44+
```bash
45+
uv run scripts/update_readme_snippets.py
46+
```
47+
48+
8. Submit a pull request to the same branch you branched from
4449

4550
## Code Style
4651

0 commit comments

Comments
 (0)