Skip to content

Commit 4249b1b

Browse files
authored
Merge branch 'main' into claude/issue-48-20251027-0100
2 parents bc589b5 + f238a12 commit 4249b1b

File tree

76 files changed

+5226
-699
lines changed

Some content is hidden

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

76 files changed

+5226
-699
lines changed

.github/workflows/claude-on-mention.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ jobs:
2727
with:
2828
fetch-depth: 1
2929

30+
- name: Set up Python 3.10
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: '3.10'
34+
3035
# Install UV package manager
3136
- name: Install UV
3237
uses: astral-sh/setup-uv@v7

.github/workflows/claude-on-open-label.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ jobs:
2222
with:
2323
fetch-depth: 1
2424

25+
- name: Set up Python 3.10
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.10'
29+
2530
# Install UV package manager
2631
- name: Install UV
2732
uses: astral-sh/setup-uv@v7

.github/workflows/docs.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.10'
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v5
25+
with:
26+
enable-cache: true
27+
28+
- name: Install documentation dependencies
29+
run: uv pip install --system mkdocs mkdocs-material 'mkdocstrings[python]' mkdocstrings-python
30+
31+
- name: Build documentation
32+
run: mkdocs build
33+
34+
- name: Deploy to GitHub Pages
35+
run: mkdocs gh-deploy --force

.github/workflows/test.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,52 @@ jobs:
3030
config: '.markdownlint.jsonc'
3131
globs: '**/*.md'
3232

33+
codegen_check:
34+
runs-on: ubuntu-latest
35+
permissions:
36+
contents: read
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
42+
- name: "Install uv"
43+
uses: astral-sh/setup-uv@v6
44+
45+
- name: "Set up Python 3.10"
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: "3.10"
49+
50+
- name: "Install Node.js"
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: "20"
54+
55+
- name: "Install dependencies"
56+
run: make sync
57+
58+
- name: "Run codegen"
59+
run: make codegen
60+
61+
- name: "Run lint"
62+
run: make lint
63+
64+
- name: "Check for uncommitted changes"
65+
run: |
66+
if ! git diff --exit-code; then
67+
echo "Error: Modified files detected after running 'make codegen lint'."
68+
echo "Please run 'make codegen lint' locally and commit the changes."
69+
exit 1
70+
fi
71+
if [ -n "$(git ls-files --others --exclude-standard)" ]; then
72+
echo "Error: Untracked files detected after running 'make codegen lint'."
73+
echo "Untracked files:"
74+
git ls-files --others --exclude-standard
75+
echo "Please run 'make codegen lint' locally and commit the changes."
76+
exit 1
77+
fi
78+
3379
static_analysis:
3480
runs-on: ubuntu-latest
3581

@@ -66,6 +112,7 @@ jobs:
66112
test_quick:
67113
needs:
68114
- markdown_lint
115+
- codegen_check
69116
- static_analysis
70117
timeout-minutes: 10
71118
strategy:

.markdownlint.jsonc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
"line_length": 80,
66
"code_blocks": false, // Don't restrict line length in code blocks
77
"tables": false // Don't restrict line length in tables
8+
},
9+
"MD024": {
10+
"siblings_only": true // Allow duplicate headings in different sections
811
}
912
}

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ make sync
216216
GitHub Actions workflows are in `.github/workflows/`:
217217

218218
- `test.yml` - Run tests across packages
219+
- `codegen_check` job - Ensures `make codegen lint` has been run before
220+
commits
221+
- `static_analysis` job - Runs linting and type checking per package
222+
- `test_quick` and `test_all` jobs - Run tests across Python versions and
223+
platforms
219224
- `publish.yml` - Publish packages to PyPI
220225
- `claude-on-mention.yml` - Claude Code assistant (can make PRs)
221226
- `claude-on-open-label.yml` - Claude triage assistant (read-only analysis)

DEVELOPING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ make precommit
100100

101101
This runs linting, type checking, and code generation.
102102

103+
**Important**: CI will fail if `make codegen lint` has not been run before
104+
committing. The `codegen_check` job in the test workflow verifies that
105+
running these commands produces no file changes, ensuring all generated
106+
code and formatting is up to date.
107+
103108
## Using Makefile in CI
104109

105110
The Makefile targets support per-project operations, making them

Makefile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.PHONY: bump-version bump-version-dry codegen lint typecheck sync precommit test build help
2-
.PHONY: install test-aio test-sync test-shared
2+
.PHONY: install test-aio test-sync test-shared docs-serve docs-build docs-deploy
33

44
# Default target - show help
55
.DEFAULT_GOAL := help
@@ -19,6 +19,9 @@ help:
1919
@echo " make build - Build all packages"
2020
@echo " make codegen - Generate sync package from async"
2121
@echo " make precommit - Run pre-commit checks (lint + typecheck + codegen)"
22+
@echo " make docs-serve - Start documentation server"
23+
@echo " make docs-build - Build documentation"
24+
@echo " make docs-deploy - Deploy documentation to GitHub Pages"
2225
@echo ""
2326
@echo "Per-project targets (use PROJECT=<path>):"
2427
@echo " make sync PROJECT=key-value/key-value-aio"
@@ -119,4 +122,17 @@ else
119122
@cd key-value/key-value-shared && uv build .
120123
endif
121124

122-
precommit: lint codegen lint typecheck
125+
precommit: lint codegen lint typecheck
126+
127+
# Documentation targets
128+
docs-serve:
129+
@echo "Starting documentation server..."
130+
@uv run --extra docs mkdocs serve
131+
132+
docs-build:
133+
@echo "Building documentation..."
134+
@uv run --extra docs mkdocs build
135+
136+
docs-deploy:
137+
@echo "Deploying documentation to GitHub Pages..."
138+
@uv run --extra docs mkdocs gh-deploy --force

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ This monorepo contains two libraries:
66
- `py-key-value-sync`: Sync key-value store library (under development;
77
generated from the async API).
88

9+
## Documentation
10+
11+
- [Full Documentation](https://strawgate.github.io/py-key-value/)
12+
- [Getting Started Guide](https://strawgate.github.io/py-key-value/getting-started/)
13+
- [Wrappers Guide](https://strawgate.github.io/py-key-value/wrappers/)
14+
- [Adapters Guide](https://strawgate.github.io/py-key-value/adapters/)
15+
- [API Reference](https://strawgate.github.io/py-key-value/api/protocols/)
16+
917
## Why use this library?
1018

1119
- **Multiple backends**: DynamoDB, Elasticsearch, Memcached, MongoDB,
@@ -246,6 +254,7 @@ the protocol, your application code might be simplified by using an adapter.
246254

247255
| Adapter | Description | Example |
248256
|---------|:------------|:------------------|
257+
| DataclassAdapter | Type-safe storage/retrieval of dataclass models with transparent serialization/deserialization. | `DataclassAdapter(key_value=memory_store, dataclass_type=User)` |
249258
| PydanticAdapter | Type-safe storage/retrieval of Pydantic models with transparent serialization/deserialization. | `PydanticAdapter(key_value=memory_store, pydantic_model=User)` |
250259
| RaiseOnMissingAdapter | Optional raise-on-missing behavior for `get`, `get_many`, `ttl`, and `ttl_many`. | `RaiseOnMissingAdapter(key_value=memory_store)` |
251260

0 commit comments

Comments
 (0)