Conversation
| /** | ||
| * AWS Dependencies used in the smithy python generator. | ||
| */ | ||
| @SmithyUnstableApi |
There was a problem hiding this comment.
This is used to mark the class as subject to breaking change: https://smithy.io/javadoc/1.19.0/software/amazon/smithy/utils/SmithyUnstableApi.html
| * AWS Dependencies used in the smithy python generator. | ||
| */ | ||
| @SmithyUnstableApi | ||
| public class AwsPythonDependency { |
There was a problem hiding this comment.
Kind of self-explanatory, but this is a class that is used to hold logic related to aws-specific dependencies in python. This class is expected to grow with more aws-specific dependencies as they are needed. For now, it just has SMITHY_AWS_CORE.
| * | ||
| * <p>While in development this will use the develop branch. | ||
| */ | ||
| public static final PythonDependency SMITHY_AWS_CORE = new PythonDependency( |
There was a problem hiding this comment.
SMITHY_AWS_CORE is referenced later - that will end up putting this in the pyproject.toml.
| public List<RuntimeClientPlugin> getClientPlugins() { | ||
| return List.of( | ||
| RuntimeClientPlugin.builder() | ||
| .addConfigProperty( |
There was a problem hiding this comment.
This addConfigProperty method is adding a configuration to the client. In this case, it's adding the configuration user_agent_extra to be added to the client.
End users will be able to pass in user_agent_extra to the client configuration somehow to be used by the client, similar to how they do in the botocore.config.Config object today.
| .nullable(true) | ||
| .build() | ||
| ) | ||
| .pythonPlugin( |
There was a problem hiding this comment.
.pythonPlugin is adding a plugin to the client. This is a smithy interceptor; this is similar to adding an event handler to an event in botocore.
| * Adds a runtime plugin to set user agent. | ||
| */ | ||
| @SmithyInternalApi | ||
| public class AwsUserAgentIntegration implements PythonIntegration { |
There was a problem hiding this comment.
A PythonIntegration is sort of a plugin to the code generator. This uses "service provider interfaces" in Java.
Basically it's referenced later in the META-INF file below and some java magic happens that allows Smithy to pick this up during build time. This is handled by smithy itself, not smithy-python, so we don't have to understand this one on low level just yet.
| @Override | ||
| public List<RuntimeClientPlugin> getClientPlugins() { | ||
| return List.of( | ||
| RuntimeClientPlugin.builder() |
There was a problem hiding this comment.
A RuntimeClientPlugin is similarly collected to be used later, but this time the code to do so is inside of smithy-python.
I'll need to do a deeper dive here to understand how this works fully, but the gist is outlined in the comment below.
| ) | ||
| .pythonPlugin( | ||
| SymbolReference.builder() | ||
| .symbol(Symbol.builder() |
There was a problem hiding this comment.
A symbol is just a reference to some form of python code. In this case, it's a reference to this new method.
Anti-review:
This PR is to take some notes on Alex's PR to help me get some understanding of what's going on in the smithy-python repo