-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export a usable Python implementation via shared library #1476
Conversation
…and refactor PyApp
7799af2
to
6b88878
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Signed-off-by: Bigo <[email protected]>
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
@rcoh @Velfi @jdisanti: the PR is long and very server / python specific. There are some simple changes I made to the If you are curious about the rest of the server changes, I'll be happy to get reviews on that part as well, but it is not necessary. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
fun ByteStream(runtimeConfig: RuntimeConfig) = | ||
RuntimeType("ByteStream", CargoDependency.SmithyHttp(runtimeConfig), "${runtimeConfig.crateSrcPrefix}_http::byte_stream") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do this change impact anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so.. the CI is happy. I can see it does some changes inside the SDK, but only in comments: https://d2luzm2xt3nokh.cloudfront.net/codegen-diff/5a5aa2f3d6b95b42c5a73dbee59b1a340a83c932/a7afa9c387054bd503d97266cb5cbc84cb667a47/diff-aws-sdk.html
...otlin/software/amazon/smithy/rust/codegen/server/python/smithy/PythonServerSymbolProvider.kt
Outdated
Show resolved
Hide resolved
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
...are/amazon/smithy/rust/codegen/server/python/smithy/generators/PythonApplicationGenerator.kt
Outdated
Show resolved
Hide resolved
|
||
override fun toMemberName(shape: MemberShape): String = when (val container = model.expectShape(shape.container)) { | ||
is StructureShape -> shape.memberName.toSnakeCase() | ||
is UnionShape -> shape.memberName.toPascalCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supported? (nit)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Union
is not supported yet, but once it will be this will work out of the box.
rust-runtime/aws-smithy-http-server-python/examples/pokemon_service.py
Outdated
Show resolved
Hide resolved
cargo doc --no-deps --open | ||
|
||
clean: | ||
cargo clean || echo "Unable to run cargo clean" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you want to use @echo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? I am in a subshell..
rust-runtime/aws-smithy-http-server-python/examples/pokemon_service_test/tests/helpers.rs
Outdated
Show resolved
Hide resolved
A new generated diff is ready to view.
A new doc preview is ready to view. |
Motivation and Context
#1367
Description
This PR add several functionalities to the Python/Rust code-generation, making it usable for models that are not using Streaming and Union shapes.
SymbolProvider
to override non-primitive types that are exposed to Python.DateTime
.Testing
A Python service based on the Pokemon service is run during CI.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.