Skip to content

Commit 06177d1

Browse files
Merge branch 'main' into feat/client-credentials
2 parents f1d1591 + f55831e commit 06177d1

Some content is hidden

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

70 files changed

+3490
-1980
lines changed

.github/workflows/shared.yml

Lines changed: 27 additions & 1 deletion
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
@@ -26,6 +29,7 @@ jobs:
2629
test:
2730
runs-on: ${{ matrix.os }}
2831
timeout-minutes: 10
32+
continue-on-error: true
2933
strategy:
3034
matrix:
3135
python-version: ["3.10", "3.11", "3.12", "3.13"]
@@ -45,4 +49,26 @@ jobs:
4549

4650
- name: Run pytest
4751
run: uv run --frozen --no-sync pytest
48-
continue-on-error: true
52+
53+
# This must run last as it modifies the environment!
54+
- name: Run pytest with lowest versions
55+
run: |
56+
uv sync --all-extras --upgrade
57+
uv run --no-sync pytest
58+
env:
59+
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ 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
29-
args: [src]
3030
language: system
3131
types: [python]
3232
pass_filenames: false
@@ -36,3 +36,9 @@ repos:
3636
language: system
3737
files: ^(pyproject\.toml|uv\.lock)$
3838
pass_filenames: false
39+
- id: readme-snippets
40+
name: Check README snippets are up to date
41+
entry: uv run scripts/update_readme_snippets.py --check
42+
language: system
43+
files: ^(README\.md|examples/.*\.py|scripts/update_readme_snippets\.py)$
44+
pass_filenames: false

CLAUDE.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This document contains critical information about working with this codebase. Fo
1616
- Public APIs must have docstrings
1717
- Functions must be focused and small
1818
- Follow existing patterns exactly
19-
- Line length: 88 chars maximum
19+
- Line length: 120 chars maximum
2020

2121
3. Testing Requirements
2222
- Framework: `uv run --frozen pytest`
@@ -116,3 +116,15 @@ This document contains critical information about working with this codebase. Fo
116116
- Follow existing patterns
117117
- Document public APIs
118118
- Test thoroughly
119+
120+
## Exception Handling
121+
122+
- **Always use `logger.exception()` instead of `logger.error()` when catching exceptions**
123+
- Don't include the exception in the message: `logger.exception("Failed")` not `logger.exception(f"Failed: {e}")`
124+
- **Catch specific exceptions** where possible:
125+
- File ops: `except (OSError, PermissionError):`
126+
- JSON: `except json.JSONDecodeError:`
127+
- Network: `except (ConnectionError, TimeoutError):`
128+
- **Only catch `Exception` for**:
129+
- Top-level handlers that must not crash
130+
- Cleanup blocks (log at debug level)

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)