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
28 changes: 16 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DEFAULT_GOAL:=help

.PHONY: help check-imports check-conventions check-api check-dependencies check-packaging check-import-stability install format-java check-java build-java generate-protocol-tests generate-codegen-output-py api-snapshot aio-check changelog-check canonical-imports dunder-all source-order dynamic-imports banned-imports ruff-extra docstrings declared-deps import-cycles dep-specifiers package-metadata version-consistency export-names exception-hierarchy secret-repr import-hygiene import-deprecations import-side-effects import-cost wheel-contents type-completeness optional-deps lowest-bounds gen ci lint-py check-py lint-rust check-rust third-party-licenses test-py test-protocols typecheck-protocols static-analysis test-unit test-functional test-integration benchmark build-py clean
.PHONY: help check-imports check-conventions check-api check-dependencies check-packaging check-import-stability install format-java check-java build-java generate-protocol-tests generate-codegen-output-py check-codegen-output-py test-codegen-output-py api-snapshot aio-check changelog-check canonical-imports dunder-all source-order dynamic-imports banned-imports ruff-extra docstrings declared-deps import-cycles dep-specifiers package-metadata version-consistency export-names exception-hierarchy secret-repr import-hygiene import-deprecations import-side-effects import-cost wheel-contents type-completeness optional-deps lowest-bounds gen ci lint-py check-py lint-rust check-rust third-party-licenses test-py test-protocols typecheck-protocols static-analysis test-unit test-functional test-integration benchmark build-py clean

help: ## Show this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
Expand All @@ -17,6 +17,7 @@ static-analysis: ## Catches defects CI can find without running the code's tests
$(MAKE) check-packaging
$(MAKE) check-import-stability
$(MAKE) check-api
$(MAKE) check-codegen-output-py


test-unit: ## Runs the python unit tests.
Expand All @@ -34,7 +35,8 @@ test-functional: ## Runs the python functional tests and test-protocols.
test-integration: ## Builds and tests the Java codegen and asserts the regenerated snapshots match.
$(MAKE) build-java
$(MAKE) generate-protocol-tests
$(MAKE) generate-codegen-output-py
$(MAKE) check-codegen-output-py
$(MAKE) test-codegen-output-py


ci: ## Runs the full CI sequence locally.
Expand Down Expand Up @@ -132,17 +134,19 @@ generate-protocol-tests: ## Generates protocol-test clients, copies them to ./co
@echo "codegen-output is up to date."


generate-codegen-output-py: ## Generates Python output and asserts no snapshot diff.
rm -rf codegen-output-py
generate-codegen-output-py: ## Regenerates standalone types snapshots using only Python.
uv run python scripts/codegen-output-py/generate.py
@if ! git diff --quiet --exit-code -- codegen-output-py || [ -n "$$(git ls-files --others --exclude-standard -- codegen-output-py)" ]; then \
echo "ERROR: generated codegen-output-py differs from the committed snapshot."; \
echo "Review the diff and commit it if the change is intended:"; \
git --no-pager status --short -- codegen-output-py; \
git --no-pager diff -- codegen-output-py; \
exit 1; \
fi
@echo "codegen-output-py is up to date."


check-codegen-output-py: ## Checks native snapshots, Ruff, and strict Pyright using only Python.
uv run python scripts/codegen-output-py/generate.py --check
uv run ruff check scripts/codegen-output-py codegen-output-py --config pyproject.toml
uv run ruff format --check scripts/codegen-output-py codegen-output-py --config pyproject.toml
uv run pyright --project scripts/codegen-output-py/pyrightconfig.json


test-codegen-output-py: ## Checks native model/schema behavior against the ASTs and Java snapshots.
uv run pytest scripts/codegen-output-py/tests --no-cov


api-snapshot: ## Records the public API surface and dual-mode mirrors of each package and asserts no git diff.
Expand Down
13 changes: 13 additions & 0 deletions codegen-output-py/aws-json-1-0/.smithy-python-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"files": {
"README.md": "767e060d5d96f9a0ca03b7855b5c44f45c5b06969c3246b7e7f03fefb92300ec",
"pyproject.toml": "d09f5af8330c8de6457c45a24952476adc4e53eb138a954e2221afd1b2be6cd3",
"src/awsjson10/__init__.py": "619a033058229139a02f912a44a6b8997fb35c5af6736d09edd49927876a49dd",
"src/awsjson10/_private/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"src/awsjson10/_private/schemas.py": "e915ac3d2ddf32319cc868437dc2f1320fa799993d72e08886f7ff12430f743e",
"src/awsjson10/models.py": "bab8e32bb4d8e30eea86ae4ae6edb727934e11209506353bc3c4baeef1d79b6d",
"src/awsjson10/models.pyi": "4484730b2e0464045ab86690fb55ebeb2c6469de6e545b5772b6b425ec54e65d",
"src/awsjson10/py.typed": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
"version": 1
}
5 changes: 5 additions & 0 deletions codegen-output-py/aws-json-1-0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- Code generated by smithy-python-codegen DO NOT EDIT. -->

## awsjson10 Types Package

Native Python types for the aws-json-1-0 projection
36 changes: 36 additions & 0 deletions codegen-output-py/aws-json-1-0/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Code generated by smithy-python-codegen DO NOT EDIT.

[project]
name = "awsjson10"
version = "0.0.1"
description = "Native Python types for the aws-json-1-0 projection"
readme = "README.md"
requires-python = ">=3.12"
keywords = ["smithy", "awsjson10"]
license = {text = "Apache-2.0"}
dependencies = [
"smithy-core~=0.10.0",
]

[build-system]
requires = [
"hatchling",
]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = [
"src/awsjson10",
]

[tool.pyright]
typeCheckingMode = "strict"

[tool.ruff]
target-version = "py312"

[tool.ruff.lint]
ignore = ["F841"]

[tool.ruff.format]
skip-magic-trailing-comma = true
1 change: 1 addition & 0 deletions codegen-output-py/aws-json-1-0/src/awsjson10/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__: str = "0.0.1"
Empty file.
Loading
Loading