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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ jobs:

- name: Run protocol tests
run: |
make test-protocols
make generate-protocol-tests test-protocols
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ header:
- '**/*.java'
- 'LICENSE'
- 'NOTICE'
- 'codegen-output/**'
- '**/smithy_core/rfc3986.py'

language:
Expand Down
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ test-protocols: ## Generates and runs protocol tests for all supported protocols
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
rm -rf codegen-output
mkdir -p codegen-output
@set -e; for projection_dir in codegen/protocol-test/build/smithyprojections/protocol-test/*/python-client-codegen; do \
projection=$$(basename $$(dirname "$$projection_dir")); \
echo "Copying $$projection -> codegen-output/$$projection"; \
cp -r "$$projection_dir" "codegen-output/$$projection"; \
echo "Formatting codegen-output/$$projection"; \
uv run ruff check --fix "codegen-output/$$projection"; \
uv run ruff format "codegen-output/$$projection"; \
done
@if ! git diff --quiet --exit-code -- codegen-output || [ -n "$$(git ls-files --others --exclude-standard -- codegen-output)" ]; then \
echo "ERROR: generated codegen-output differs from the committed snapshot."; \
echo "Review the diff and commit it if the change is intended:"; \
git --no-pager status --short -- codegen-output; \
git --no-pager diff -- codegen-output; \
exit 1; \
fi
@echo "codegen-output is up to date."


lint-py: ## Runs linters and formatters on the python packages.
uv run ruff check packages --fix --config pyproject.toml
uv run ruff format packages --config pyproject.toml
Expand Down
5 changes: 5 additions & 0 deletions codegen-output/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.

## Sample Json 1.0 Protocol Service Client

awsjson10 client
66 changes: 66 additions & 0 deletions codegen-output/aws-json-1-0/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Code generated by smithy-python-codegen DO NOT EDIT.

[project]
name = "awsjson10"
version = "0.0.1"
description = "awsjson10 client"
readme = "README.md"
requires-python = ">=3.12"
keywords = ["smithy", "awsjson10"]
license = {text = "Apache-2.0"}
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Natural Language :: English",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14"
]

dependencies = [
"smithy_aws_core[json]~=0.11.0",
"smithy_core~=0.8.0",
"smithy_http[aiohttp]~=0.5.0"
]

[project.optional-dependencies]
awscrt = [
"smithy_http[awscrt]~=0.5.0"
]

[dependency-groups]
test = [
"pytest>=9.0.1,<10.0.0",
"pytest-asyncio>=1.3.0,<1.4.0"
]

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

[tool.pyright]
typeCheckingMode = "strict"
reportPrivateUsage = false
reportUnusedFunction = false
reportUnusedVariable = false
reportUnnecessaryComparison = false
reportUnusedClass = false
enableExperimentalFeatures = true

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

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

[tool.ruff.format]
skip-magic-trailing-comma = true

[tool.pytest.ini_options]
python_classes = ["!Test"]
asyncio_mode = "auto"
3 changes: 3 additions & 0 deletions codegen-output/aws-json-1-0/src/awsjson10/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code generated by smithy-python-codegen DO NOT EDIT.

__version__: str = "0.0.1"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Code generated by smithy-python-codegen DO NOT EDIT.
Loading
Loading