Skip to content
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

Codegenerate StructureShape, BlobShape, application, server and Python runtime #1403

Merged
merged 62 commits into from
Jun 14, 2022
Merged
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
4367c00
Partial structure generation
crisidev May 21, 2022
8cca266
Add Python server decorator
crisidev May 21, 2022
49a7656
Wrap Blob type with PyClass
crisidev May 22, 2022
cc46039
Add documentation to PythonServerCodegenDecorator
crisidev May 22, 2022
5e68c85
Generate structures, wrap blob types and implement SymbolProvider.
crisidev May 22, 2022
8afe768
Codegenerate python operation implementation
crisidev May 22, 2022
95d128f
Add autogeneration of all operation handlers and routers
crisidev May 23, 2022
95d9db2
Remove leftovers
crisidev May 23, 2022
bc6afd7
Update documentation
crisidev May 23, 2022
e6d2d53
Refactor server to be fully code generated
crisidev May 23, 2022
52881c1
Merge branch 'main' into oxipy-struct-codegen
crisidev May 23, 2022
1585aa7
Fix documentation
crisidev May 23, 2022
7cf4615
Merge branch 'main' into oxipy-struct-codegen
crisidev May 23, 2022
8b36d85
Merge branch 'main' into oxipy-struct-codegen
crisidev May 23, 2022
3082c83
Add enum generation
crisidev May 23, 2022
8e90b1a
Merge branch 'main' into oxipy-struct-codegen
crisidev May 24, 2022
45ed6b6
Improve symbol matching when replacing types.
crisidev May 24, 2022
28c4a06
Fix string representation in Python
crisidev May 24, 2022
4eda17e
Use right name for mod export
crisidev May 24, 2022
52b7eba
Merge branch 'main' into oxipy-struct-codegen
crisidev May 24, 2022
1c9c969
Move most of the server logic inside the runtime crate.
crisidev May 25, 2022
543d207
Fix cargo doc
crisidev May 25, 2022
134cf5d
Fix another broken doc
crisidev May 25, 2022
c972b87
Fix Python binding generation for structures
crisidev May 25, 2022
f65cbf1
Merge branch 'main' into oxipy-struct-codegen
crisidev May 26, 2022
f8925e3
Update pyo3 versions
crisidev May 26, 2022
1313869
Fix documentation
crisidev May 26, 2022
8ca146c
Merge branch 'main' into oxipy-struct-codegen
crisidev May 26, 2022
def14e2
Merge branch 'main' into oxipy-struct-codegen
crisidev May 27, 2022
41cf120
Merge branch 'main' into oxipy-struct-codegen
crisidev May 27, 2022
cf66d41
Apply suggestions from code review
crisidev Jun 8, 2022
f6037b4
Merge branch 'main' into oxipy-struct-codegen
crisidev Jun 8, 2022
b08c324
Refactor following CR comments
crisidev Jun 8, 2022
3f6b40b
Fix name refactor
crisidev Jun 8, 2022
0c86e15
Update codegen-server/python/src/main/kotlin/software/amazon/smithy/r…
crisidev Jun 8, 2022
d6f7e21
Use directly types from PythonServerRuntimeTypes inside PythonServerS…
crisidev Jun 8, 2022
7ccc719
Use coroutine instead of coro inside Python codegenerator
crisidev Jun 8, 2022
db3d196
Refactor enum generation to promote more code re-use
crisidev Jun 8, 2022
b31869d
Refactor renderPyO3Methods() to use a single rust block
crisidev Jun 8, 2022
fd90b59
Refactor ServerServiceGenerator to promote code reusal with Python impl
crisidev Jun 8, 2022
2446e13
Merge branch 'main' into oxipy-struct-codegen
crisidev Jun 8, 2022
302d3d3
Merge branch 'main' into oxipy-struct-codegen
crisidev Jun 9, 2022
f18bb60
Better refactor of ServerServiceGenerator using renderExtras() function
crisidev Jun 9, 2022
4f4c307
Refactor PythonServerCombinedErrorGenerator
crisidev Jun 9, 2022
4a0ff86
Refactor PythonStructureGenerator to use writable
crisidev Jun 10, 2022
b174639
Add broken test to allow Daniele to help me
crisidev Jun 10, 2022
f6afd03
Remove test for python combined error generator since it has problems…
crisidev Jun 10, 2022
8dab93e
Refactor PythonServerOperationHandlerGenerator to use writables
crisidev Jun 10, 2022
f69c211
Refactor Blob wrapper to have the same Rust API as its inner from aws…
crisidev Jun 10, 2022
671e0aa
Merge branch 'main' into oxipy-struct-codegen
crisidev Jun 10, 2022
893c3cd
Remove leftover
crisidev Jun 10, 2022
4cdfd67
Merge branch 'main' into oxipy-struct-codegen
crisidev Jun 12, 2022
d8a1a40
Merge branch 'main' into oxipy-struct-codegen
crisidev Jun 13, 2022
ef8b592
Remove tower tracing layer to prevent logging of sensitive stuff
crisidev Jun 13, 2022
e4d2b4e
Merge branch 'main' into oxipy-struct-codegen
crisidev Jun 13, 2022
b314f1c
Apply suggestions from code review
crisidev Jun 13, 2022
276519b
Merge branch 'main' into oxipy-struct-codegen
crisidev Jun 14, 2022
15e1b34
Use RuntimeType.From for impl From
crisidev Jun 14, 2022
ec2ad28
Fix documentation
crisidev Jun 14, 2022
8fe764e
Refactor StructureGenerator to promote code reuse for Python
crisidev Jun 14, 2022
4240344
Merge branch 'main' into oxipy-struct-codegen
crisidev Jun 14, 2022
50ba6cb
Merge branch 'main' into oxipy-struct-codegen
crisidev Jun 14, 2022
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
Prev Previous commit
Next Next commit
Add documentation to PythonServerCodegenDecorator
crisidev committed May 22, 2022
commit cc46039038a1a4354de81da9441cfac3119e6d45
Original file line number Diff line number Diff line change
@@ -11,9 +11,8 @@ import software.amazon.smithy.rust.codegen.smithy.customize.CombinedCodegenDecor
import software.amazon.smithy.rust.codegen.smithy.customize.RustCodegenDecorator
import software.amazon.smithy.rust.codegen.smithy.generators.ManifestCustomizations

val DECORATORS = listOf(AddInternalServerErrorToAllOpsDecorator(), CdylibDecorator())

class CdylibDecorator : RustCodegenDecorator {
// Configure the [lib] section to Cargo.toml.
class CdylibManifestDecorator : RustCodegenDecorator {
override val name: String = "CdylibDecorator"
override val order: Byte = 0

@@ -23,6 +22,20 @@ class CdylibDecorator : RustCodegenDecorator {
mapOf("lib" to mapOf("name" to codegenContext.settings.moduleName, "crate-type" to listOf("cdylib")))
}

val DECORATORS = listOf(
// Add the InternalServerError error to all operations.
// This is done because the Python interpreter can raise exceptions during execution
// and we cannot guarantee infallible execution of operations.
AddInternalServerErrorToAllOpsDecorator(),
// Add the [lib] section to Cargo.toml to configure the generation of the shared library:
//
// [lib]
// name = "$CRATE_NAME"
// crate-type = ["cdylib"]
CdylibManifestDecorator()
)

// Combined codegen decorator for Python services.
class PythonServerCodegenDecorator : CombinedCodegenDecorator(DECORATORS) {
override val name: String = "PythonServerCodegenDecorator"
override val order: Byte = -1