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
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,8 @@ jobs:
- name: Run protocol tests
run: |
make generate-protocol-tests test-protocols
- name: Type-check protocol test stubs
if: ${{ matrix.python-version == '3.12' }}
run: |
make typecheck-protocols
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,20 @@ build-java: ## Builds and tests the Java code generation packages without modify

test-protocols: ## Generates and runs protocol tests for all supported protocols.
cd codegen && ./gradlew :protocol-test:clean :protocol-test:build
uv pip install -e packages/smithy-test
@set -e; for projection_dir in codegen/protocol-test/build/smithyprojections/protocol-test/*/python-client-codegen; do \
uv pip install "$$projection_dir"; \
uv run pytest "$$projection_dir"; \
done

# pyright's wrapper imports typing_extensions, which fails to import on 3.15
# (removed typing.no_type_check_decorator); run the stub type-check on 3.12 only.
typecheck-protocols: ## Type-checks the generated protocol-test stub fixtures with pyright.
@set -e; for projection_dir in codegen/protocol-test/build/smithyprojections/protocol-test/*/python-client-codegen; do \
uv pip install "$$projection_dir"; \
uv run pyright "$$projection_dir/tests/_typecheck.py"; \
done


generate-protocol-tests: ## Generates protocol-test clients, copies them to ./codegen-output, and asserts no git diff.
cd codegen && ./gradlew :protocol-test:clean :protocol-test:build
Expand Down
3 changes: 3 additions & 0 deletions codegen-output/aws-json-1-0/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ reportUnusedVariable = false
reportUnnecessaryComparison = false
reportUnusedClass = false
enableExperimentalFeatures = true
# models.py is the dynamic runtime; models.pyi carries the typed
# surface for consumers, so don't type-check the implementation body.
exclude = ["**/models.py"]

[tool.ruff]
target-version = "py312"
Expand Down
Loading
Loading