Skip to content

Commit 71c6fde

Browse files
committed
Add an empty aws codegen package
1 parent 141e475 commit 71c6fde

File tree

6 files changed

+89
-0
lines changed

6 files changed

+89
-0
lines changed

codegen/aws/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## Smithy AWS Python Codegen
2+
3+
These packages implement AWS-specific code generation plugins to the python generator.
4+
Anything that is specific to AWS MUST be implemented here. Examples include most [AWS
5+
protocols](https://smithy.io/2.0/aws/protocols/index.html)(*),
6+
[SigV4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html),
7+
and AWS service customizations. Conversely, any features that are
8+
NOT specific to AWS MUST NOT be implemented here.
9+
10+
*The only exception to this rule is the `RestJson1` protocol implementation, which is
11+
included in the generic generator for now to provide a default supported protocol.
12+
13+
One very important thing to keep in mind when implementing features and integrations
14+
here is that they MUST NOT be coupled wherever possible. For example, a user
15+
MUST be able to use SigV4 even if they aren't using an AWS protocol or even the
16+
[service trait](https://smithy.io/2.0/aws/aws-core.html#aws-api-service-trait).
17+
18+
### Why separate AWS components from the core package and each other?
19+
20+
Smithy is intended to be a generic IDL that can describe a broad range of protocols,
21+
not just AWS protocols. Separating the code generation components forces developers
22+
to provide interfaces capable of achieving that goal and ensures that users only
23+
have to take what they need.
24+
25+
In the future, these components may be moved to an entirely different repository to
26+
strengthen that divide even more.
27+
28+
### When should I change this package?
29+
30+
Any time an AWS component needs to be modified or added. This can include adding
31+
support for new protocols, new auth traits, or new service customizations.

codegen/aws/core/build.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
plugins {
2+
id("smithy-python.module-conventions")
3+
id("smithy-python.integ-test-conventions")
4+
}
5+
6+
description = "This module provides the core aws codegen functionality for Smithy Python"
7+
group = "software.amazon.smithy.python.codegen.aws"
8+
9+
extra["displayName"] = "Smithy :: Python :: AWS :: Codegen"
10+
extra["moduleName"] = "software.amazon.smithy.python.aws.codegen"
11+
12+
dependencies {
13+
implementation(project(":core"))
14+
implementation(libs.smithy.aws.traits)
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
package software.amazon.smithy.python.aws.codegen;
6+
7+
import software.amazon.smithy.python.codegen.integrations.PythonIntegration;
8+
import software.amazon.smithy.utils.SmithyInternalApi;
9+
10+
/**
11+
* Adds support for AWS auth traits.
12+
*/
13+
@SmithyInternalApi
14+
public class AwsAuthIntegration implements PythonIntegration {}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
package software.amazon.smithy.python.aws.codegen;
6+
7+
import java.util.List;
8+
import software.amazon.smithy.python.codegen.generators.ProtocolGenerator;
9+
import software.amazon.smithy.python.codegen.integrations.PythonIntegration;
10+
import software.amazon.smithy.utils.SmithyInternalApi;
11+
12+
/**
13+
* Adds AWS protocols to the generator's list of supported protocols.
14+
*/
15+
@SmithyInternalApi
16+
public class AwsProtocolsIntegration implements PythonIntegration {
17+
@Override
18+
public List<ProtocolGenerator> getProtocolGenerators() {
19+
return List.of();
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
software.amazon.smithy.python.aws.codegen.AwsAuthIntegration
7+
software.amazon.smithy.python.aws.codegen.AwsProtocolsIntegration

codegen/settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
rootProject.name = "smithy-python"
1717
include(":core")
1818
include(":protocol-test")
19+
include(":aws:core")

0 commit comments

Comments
 (0)