From b8b4bd5168d16556397538c518b59b524eaa9f8c Mon Sep 17 00:00:00 2001 From: ubaskota <19787410+ubaskota@users.noreply.github.com> Date: Tue, 19 May 2026 23:30:36 -0400 Subject: [PATCH 1/2] Rename Config and Plugin to service-specific names # Conflicts: # codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java --- .../aws/codegen/AwsUserAgentIntegration.java | 2 +- .../python/codegen/ClientGenerator.java | 12 +++--- .../smithy/python/codegen/CodegenUtils.java | 31 ++++++++++++-- .../codegen/HttpProtocolTestGenerator.java | 6 +-- .../codegen/generators/ConfigGenerator.java | 42 +++++++++++++++++-- ...king-f95518e3e1b54466bc635067abb27987.json | 4 ++ ...king-c0f0f75e892f411bbacfa24be658c8ba.json | 4 ++ ...king-231f43d52ea2468a8f2a07074310ee40.json | 4 ++ 8 files changed, 88 insertions(+), 17 deletions(-) create mode 100644 packages/aws-sdk-signers/.changes/next-release/aws-sdk-signers-breaking-f95518e3e1b54466bc635067abb27987.json create mode 100644 packages/smithy-aws-core/.changes/next-release/smithy-aws-core-breaking-c0f0f75e892f411bbacfa24be658c8ba.json create mode 100644 packages/smithy-aws-event-stream/.changes/next-release/smithy-aws-event-stream-breaking-231f43d52ea2468a8f2a07074310ee40.json diff --git a/codegen/aws/core/src/main/java/software/amazon/smithy/python/aws/codegen/AwsUserAgentIntegration.java b/codegen/aws/core/src/main/java/software/amazon/smithy/python/aws/codegen/AwsUserAgentIntegration.java index 423296913..9aaed8178 100644 --- a/codegen/aws/core/src/main/java/software/amazon/smithy/python/aws/codegen/AwsUserAgentIntegration.java +++ b/codegen/aws/core/src/main/java/software/amazon/smithy/python/aws/codegen/AwsUserAgentIntegration.java @@ -97,7 +97,7 @@ public List getClientPlugins(GenerationContext context) { moduleName + ".", writer -> { writer.write(USER_AGENT_PLUGIN, - CodegenUtils.getConfigSymbol(c.settings()), + CodegenUtils.getConfigSymbol(c.settings(), c.model()), userAgentInterceptor, versionSymbol, serviceId); diff --git a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java index e9f5d7a35..8c1995ae4 100644 --- a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java +++ b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java @@ -51,8 +51,8 @@ public void run() { private void generateService(PythonWriter writer) { var serviceSymbol = symbolProvider.toSymbol(service); writer.addLocallyDefinedSymbol(serviceSymbol); - var configSymbol = CodegenUtils.getConfigSymbol(context.settings()); - var pluginSymbol = CodegenUtils.getPluginSymbol(context.settings()); + var configSymbol = CodegenUtils.getConfigSymbol(context.settings(), context.model()); + var pluginSymbol = CodegenUtils.getPluginSymbol(context.settings(), context.model()); writer.addLogger(); writer.openBlock("class $L:", "", serviceSymbol.getName(), () -> { @@ -159,7 +159,7 @@ private void writeConstructorDocs(PythonWriter writer, String clientName) { private void generateOperation(PythonWriter writer, OperationShape operation) { var operationSymbol = symbolProvider.toSymbol(operation); var operationMethodSymbol = operationSymbol.expectProperty(OPERATION_METHOD); - var pluginSymbol = CodegenUtils.getPluginSymbol(context.settings()); + var pluginSymbol = CodegenUtils.getPluginSymbol(context.settings(), context.model()); var input = model.expectShape(operation.getInputShape()); var inputSymbol = symbolProvider.toSymbol(input); @@ -237,8 +237,8 @@ private void writeSharedOperationInit( writer.addStdlibImport("copy", "deepcopy"); writer.write(""" - operation_plugins: list[Plugin] = [ - $1C + operation_plugins: list[${plugin:T}] = [ + $C ] if plugins: operation_plugins.extend(plugins) @@ -283,7 +283,7 @@ private void generateEventStreamOperation(PythonWriter writer, OperationShape op writer.putContext("operation", operationSymbol); var operationMethodSymbol = operationSymbol.expectProperty(OPERATION_METHOD); writer.putContext("operationName", operationMethodSymbol.getName()); - var pluginSymbol = CodegenUtils.getPluginSymbol(context.settings()); + var pluginSymbol = CodegenUtils.getPluginSymbol(context.settings(), context.model()); writer.putContext("plugin", pluginSymbol); var input = model.expectShape(operation.getInputShape()); diff --git a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/CodegenUtils.java b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/CodegenUtils.java index a6def8968..069012358 100644 --- a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/CodegenUtils.java +++ b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/CodegenUtils.java @@ -26,6 +26,7 @@ import java.util.logging.Logger; import software.amazon.smithy.codegen.core.CodegenException; import software.amazon.smithy.codegen.core.Symbol; +import software.amazon.smithy.aws.traits.ServiceTrait; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.knowledge.NullableIndex; import software.amazon.smithy.model.node.Node; @@ -64,24 +65,46 @@ public final class CodegenUtils { private CodegenUtils() {} /** + * Gets the configuration object symbol for the service. + * + *

For AWS services with a {@code ServiceTrait}, this derives the name from the SDK ID + * (e.g., "Bedrock Runtime" becomes "BedrockRuntimeConfig"). For services without a + * {@code ServiceTrait}, falls back to the generic "Config" name. + * * @param settings The client settings, used to account for module configuration. + * @param model The model containing the service shape. * @return Returns the client's configuration object symbol. */ - public static Symbol getConfigSymbol(PythonSettings settings) { + public static Symbol getConfigSymbol(PythonSettings settings, Model model) { + var service = settings.service(model); + var name = service.getTrait(ServiceTrait.class) + .map(trait -> StringUtils.capitalize(trait.getSdkId()).replace(" ", "") + "Config") + .orElse("Config"); return Symbol.builder() - .name("Config") + .name(name) .namespace(String.format("%s.config", settings.moduleName()), ".") .definitionFile(String.format("./src/%s/config.py", settings.moduleName())) .build(); } /** + * Gets the plugin type hint symbol for the service. + * + *

For AWS services with a {@code ServiceTrait}, this derives the name from the SDK ID + * (e.g., "Bedrock Runtime" becomes "BedrockRuntimePlugin"). For services without a + * {@code ServiceTrait}, falls back to the generic "Plugin" name. + * * @param settings The client settings, used to account for module configuration. + * @param model The model containing the service shape. * @return Returns the client's plugin type hint symbol. */ - public static Symbol getPluginSymbol(PythonSettings settings) { + public static Symbol getPluginSymbol(PythonSettings settings, Model model) { + var service = settings.service(model); + var name = service.getTrait(ServiceTrait.class) + .map(trait -> StringUtils.capitalize(trait.getSdkId()).replace(" ", "") + "Plugin") + .orElse("Plugin"); return Symbol.builder() - .name("Plugin") + .name(name) .namespace(String.format("%s.config", settings.moduleName()), ".") .definitionFile(String.format("./src/%s/config.py", settings.moduleName())) .build(); diff --git a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/HttpProtocolTestGenerator.java b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/HttpProtocolTestGenerator.java index bd15c9bb8..e0bb13c99 100644 --- a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/HttpProtocolTestGenerator.java +++ b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/HttpProtocolTestGenerator.java @@ -191,7 +191,7 @@ private void generateRequestTest(OperationShape operation, HttpRequestTestCase t ${C|} ) """, - CodegenUtils.getConfigSymbol(context.settings()), + CodegenUtils.getConfigSymbol(context.settings(), context.model()), host, path, REQUEST_TEST_ASYNC_HTTP_CLIENT_SYMBOL, @@ -452,7 +452,7 @@ private void generateResponseTest(OperationShape operation, HttpResponseTestCase ${C|} ) """, - CodegenUtils.getConfigSymbol(context.settings()), + CodegenUtils.getConfigSymbol(context.settings(), context.model()), RESPONSE_TEST_ASYNC_HTTP_CLIENT_SYMBOL, testCase.getCode(), CodegenUtils.toTuples(testCase.getHeaders()), @@ -507,7 +507,7 @@ private void generateErrorResponseTest( ${C|} ) """, - CodegenUtils.getConfigSymbol(context.settings()), + CodegenUtils.getConfigSymbol(context.settings(), context.model()), RESPONSE_TEST_ASYNC_HTTP_CLIENT_SYMBOL, testCase.getCode(), CodegenUtils.toTuples(testCase.getHeaders()), diff --git a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ConfigGenerator.java b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ConfigGenerator.java index 30d2b07ef..ab76eced6 100644 --- a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ConfigGenerator.java +++ b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ConfigGenerator.java @@ -259,21 +259,57 @@ private static void writeDefaultAuthSchemes(GenerationContext context, PythonWri @Override public void run() { - var config = CodegenUtils.getConfigSymbol(context.settings()); + var model = context.model(); + var config = CodegenUtils.getConfigSymbol(context.settings(), model); + var genericConfigName = "Config"; context.writerDelegator().useFileWriter(config.getDefinitionFile(), config.getNamespace(), writer -> { writeInterceptorsType(writer); generateConfig(context, writer); + + // Generate deprecated Config alias if name differs from the generic name + if (!config.getName().equals(genericConfigName)) { + writer.addStdlibImport("warnings", "warn"); + writer.addStdlibImport("typing", "Any"); + writer.write(""" + + + class $1L($2L): + \"""Deprecated: Use :class:`$2L` instead.\""" + + def __init__(self, *args: Any, **kwargs: Any): + warn( + "Importing '$1L' is deprecated. Use '$2L' instead.", + DeprecationWarning, + stacklevel=2, + ) + super().__init__(*args, **kwargs) + """, + genericConfigName, + config.getName()); + } }); // Generate the plugin symbol. This is just a callable. We could do something // like have a class to implement, but that seems unnecessarily burdensome for // a single function. - var plugin = CodegenUtils.getPluginSymbol(context.settings()); + var plugin = CodegenUtils.getPluginSymbol(context.settings(), model); + var genericPluginName = "Plugin"; context.writerDelegator().useFileWriter(plugin.getDefinitionFile(), plugin.getNamespace(), writer -> { writer.addStdlibImport("typing", "Callable"); writer.addStdlibImport("typing", "TypeAlias"); writer.write("$L: TypeAlias = Callable[[$T], None]", plugin.getName(), config); writer.writeDocs("A callable that allows customizing the config object on each request.", context); + + // Generate deprecated Plugin alias if name differs from the generic name + if (!plugin.getName().equals(genericPluginName)) { + writer.write(""" + + $1L: TypeAlias = $2L + \"""Deprecated: Use :data:`$2L` instead.\""" + """, + genericPluginName, + plugin.getName()); + } }); } @@ -305,7 +341,7 @@ private void writeInterceptorsType(PythonWriter writer) { } private void generateConfig(GenerationContext context, PythonWriter writer) { - var configSymbol = CodegenUtils.getConfigSymbol(context.settings()); + var configSymbol = CodegenUtils.getConfigSymbol(context.settings(), context.model()); // Initialize a set of config properties with our base properties. var properties = new TreeSet<>(Comparator.comparing(ConfigProperty::name)); diff --git a/packages/aws-sdk-signers/.changes/next-release/aws-sdk-signers-breaking-f95518e3e1b54466bc635067abb27987.json b/packages/aws-sdk-signers/.changes/next-release/aws-sdk-signers-breaking-f95518e3e1b54466bc635067abb27987.json new file mode 100644 index 000000000..e475cb5b5 --- /dev/null +++ b/packages/aws-sdk-signers/.changes/next-release/aws-sdk-signers-breaking-f95518e3e1b54466bc635067abb27987.json @@ -0,0 +1,4 @@ +{ + "type": "breaking", + "description": "Renamed generated Config to Config and Plugin to Plugin. Deprecated aliases are provided." +} \ No newline at end of file diff --git a/packages/smithy-aws-core/.changes/next-release/smithy-aws-core-breaking-c0f0f75e892f411bbacfa24be658c8ba.json b/packages/smithy-aws-core/.changes/next-release/smithy-aws-core-breaking-c0f0f75e892f411bbacfa24be658c8ba.json new file mode 100644 index 000000000..e475cb5b5 --- /dev/null +++ b/packages/smithy-aws-core/.changes/next-release/smithy-aws-core-breaking-c0f0f75e892f411bbacfa24be658c8ba.json @@ -0,0 +1,4 @@ +{ + "type": "breaking", + "description": "Renamed generated Config to Config and Plugin to Plugin. Deprecated aliases are provided." +} \ No newline at end of file diff --git a/packages/smithy-aws-event-stream/.changes/next-release/smithy-aws-event-stream-breaking-231f43d52ea2468a8f2a07074310ee40.json b/packages/smithy-aws-event-stream/.changes/next-release/smithy-aws-event-stream-breaking-231f43d52ea2468a8f2a07074310ee40.json new file mode 100644 index 000000000..e475cb5b5 --- /dev/null +++ b/packages/smithy-aws-event-stream/.changes/next-release/smithy-aws-event-stream-breaking-231f43d52ea2468a8f2a07074310ee40.json @@ -0,0 +1,4 @@ +{ + "type": "breaking", + "description": "Renamed generated Config to Config and Plugin to Plugin. Deprecated aliases are provided." +} \ No newline at end of file From e535514fd1d8c1b4d28e269ce44112119f5aa85f Mon Sep 17 00:00:00 2001 From: ubaskota <19787410+ubaskota@users.noreply.github.com> Date: Fri, 10 Jul 2026 12:51:52 -0400 Subject: [PATCH 2/2] Add Async prefix to generated Config names --- .../aws/codegen/AwsServiceIdIntegration.java | 22 +--------- .../python/codegen/ClientGenerator.java | 3 +- .../smithy/python/codegen/CodegenUtils.java | 42 +++++++++++++++--- .../codegen/generators/ConfigGenerator.java | 43 ++++++++----------- 4 files changed, 55 insertions(+), 55 deletions(-) diff --git a/codegen/aws/core/src/main/java/software/amazon/smithy/python/aws/codegen/AwsServiceIdIntegration.java b/codegen/aws/core/src/main/java/software/amazon/smithy/python/aws/codegen/AwsServiceIdIntegration.java index cb32a3005..5fd506091 100644 --- a/codegen/aws/core/src/main/java/software/amazon/smithy/python/aws/codegen/AwsServiceIdIntegration.java +++ b/codegen/aws/core/src/main/java/software/amazon/smithy/python/aws/codegen/AwsServiceIdIntegration.java @@ -4,13 +4,13 @@ */ package software.amazon.smithy.python.aws.codegen; -import java.util.Set; import software.amazon.smithy.aws.traits.ServiceTrait; import software.amazon.smithy.codegen.core.Symbol; import software.amazon.smithy.codegen.core.SymbolProvider; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.python.codegen.CodegenUtils; import software.amazon.smithy.python.codegen.PythonSettings; import software.amazon.smithy.python.codegen.SymbolProperties; import software.amazon.smithy.python.codegen.integrations.PythonIntegration; @@ -18,24 +18,6 @@ public final class AwsServiceIdIntegration implements PythonIntegration { - /** - * SDK IDs of the AWS clients that were published under the unprefixed - * {@code Client} name before the {@code Async} prefix was adopted. - * - *

Only these clients generate a deprecated alias for the old name so that - * existing imports keep working. New clients are generated with the - * {@code Async}-prefixed name from the start and need no alias. This set can - * be removed once the aliases are dropped. - */ - private static final Set LEGACY_ALIAS_SDK_IDS = Set.of( - "Bedrock Runtime", - "ConnectHealth", - "Lex Runtime V2", - "Polly", - "QBusiness", - "SageMaker Runtime HTTP2", - "Transcribe Streaming"); - @Override public SymbolProvider decorateSymbolProvider(Model model, PythonSettings settings, SymbolProvider symbolProvider) { return new ServiceIdSymbolProvider(symbolProvider); @@ -58,7 +40,7 @@ public Symbol toSymbol(Shape shape) { var symbolBuilder = symbol.toBuilder().name("Async" + baseClientName); // Only clients that already shipped under the unprefixed name get a // backwards-compatible alias; new clients start life Async-prefixed. - if (LEGACY_ALIAS_SDK_IDS.contains(serviceTrait.getSdkId())) { + if (CodegenUtils.LEGACY_ALIAS_SDK_IDS.contains(serviceTrait.getSdkId())) { symbolBuilder.putProperty(SymbolProperties.DEPRECATED_ALIAS, baseClientName); } symbol = symbolBuilder.build(); diff --git a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java index 8c1995ae4..303796e49 100644 --- a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java +++ b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java @@ -50,7 +50,6 @@ public void run() { private void generateService(PythonWriter writer) { var serviceSymbol = symbolProvider.toSymbol(service); - writer.addLocallyDefinedSymbol(serviceSymbol); var configSymbol = CodegenUtils.getConfigSymbol(context.settings(), context.model()); var pluginSymbol = CodegenUtils.getPluginSymbol(context.settings(), context.model()); writer.addLogger(); @@ -238,7 +237,7 @@ private void writeSharedOperationInit( writer.write(""" operation_plugins: list[${plugin:T}] = [ - $C + $1C ] if plugins: operation_plugins.extend(plugins) diff --git a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/CodegenUtils.java b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/CodegenUtils.java index 069012358..f37de707d 100644 --- a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/CodegenUtils.java +++ b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/CodegenUtils.java @@ -64,11 +64,29 @@ public final class CodegenUtils { private CodegenUtils() {} + /** + * SDK IDs of the AWS services that were published before the {@code Async} + * prefix was adopted for client and config class names. + * + *

Only these services generate deprecated aliases for the old names so that + * existing imports keep working. New services are generated with the + * {@code Async}-prefixed names from the start and need no alias. This set can + * be removed once the aliases are dropped. + */ + public static final Set LEGACY_ALIAS_SDK_IDS = Set.of( + "Bedrock Runtime", + "ConnectHealth", + "Lex Runtime V2", + "Polly", + "QBusiness", + "SageMaker Runtime HTTP2", + "Transcribe Streaming"); + /** * Gets the configuration object symbol for the service. * *

For AWS services with a {@code ServiceTrait}, this derives the name from the SDK ID - * (e.g., "Bedrock Runtime" becomes "BedrockRuntimeConfig"). For services without a + * (e.g., "Bedrock Runtime" becomes "AsyncBedrockRuntimeConfig"). For services without a * {@code ServiceTrait}, falls back to the generic "Config" name. * * @param settings The client settings, used to account for module configuration. @@ -77,14 +95,24 @@ private CodegenUtils() {} */ public static Symbol getConfigSymbol(PythonSettings settings, Model model) { var service = settings.service(model); - var name = service.getTrait(ServiceTrait.class) - .map(trait -> StringUtils.capitalize(trait.getSdkId()).replace(" ", "") + "Config") + var serviceTrait = service.getTrait(ServiceTrait.class); + var name = serviceTrait + .map(trait -> "Async" + StringUtils.capitalize(trait.getSdkId()).replace(" ", "") + "Config") .orElse("Config"); - return Symbol.builder() + var builder = Symbol.builder() .name(name) .namespace(String.format("%s.config", settings.moduleName()), ".") - .definitionFile(String.format("./src/%s/config.py", settings.moduleName())) - .build(); + .definitionFile(String.format("./src/%s/config.py", settings.moduleName())); + + // Only services that already shipped under the unprefixed name get a + // backwards-compatible alias; new services start life Async-ServiceName-prefixed. + serviceTrait.ifPresent(trait -> { + if (LEGACY_ALIAS_SDK_IDS.contains(trait.getSdkId())) { + builder.putProperty(SymbolProperties.DEPRECATED_ALIAS, "Config"); + } + }); + + return builder.build(); } /** @@ -92,7 +120,7 @@ public static Symbol getConfigSymbol(PythonSettings settings, Model model) { * *

For AWS services with a {@code ServiceTrait}, this derives the name from the SDK ID * (e.g., "Bedrock Runtime" becomes "BedrockRuntimePlugin"). For services without a - * {@code ServiceTrait}, falls back to the generic "Plugin" name. + * {@code ServiceTrait} (non-AWS SDKs), falls back to the generic "Plugin" name. * * @param settings The client settings, used to account for module configuration. * @param model The model containing the service shape. diff --git a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ConfigGenerator.java b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ConfigGenerator.java index ab76eced6..e2d1039e1 100644 --- a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ConfigGenerator.java +++ b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ConfigGenerator.java @@ -261,55 +261,46 @@ private static void writeDefaultAuthSchemes(GenerationContext context, PythonWri public void run() { var model = context.model(); var config = CodegenUtils.getConfigSymbol(context.settings(), model); - var genericConfigName = "Config"; context.writerDelegator().useFileWriter(config.getDefinitionFile(), config.getNamespace(), writer -> { writeInterceptorsType(writer); generateConfig(context, writer); - // Generate deprecated Config alias if name differs from the generic name - if (!config.getName().equals(genericConfigName)) { - writer.addStdlibImport("warnings", "warn"); + // Generate deprecated Config alias using __getattr__ if name differs + config.getProperty(SymbolProperties.DEPRECATED_ALIAS).ifPresent(alias -> { + writer.addStdlibImport("typing", "TYPE_CHECKING"); writer.addStdlibImport("typing", "Any"); + writer.addStdlibImport("warnings"); writer.write(""" - class $1L($2L): - \"""Deprecated: Use :class:`$2L` instead.\""" + if TYPE_CHECKING: + # Deprecated alias for backwards compatibility, to be removed. + $1L = $2L - def __init__(self, *args: Any, **kwargs: Any): - warn( - "Importing '$1L' is deprecated. Use '$2L' instead.", + + def __getattr__(name: str) -> Any: + if name == $1S: + warnings.warn( + "$1L is deprecated, use $2L instead. " + "This alias will be removed in a future version.", DeprecationWarning, stacklevel=2, ) - super().__init__(*args, **kwargs) - """, - genericConfigName, - config.getName()); - } + return $2L + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") + """, alias, config.getName()); + }); }); // Generate the plugin symbol. This is just a callable. We could do something // like have a class to implement, but that seems unnecessarily burdensome for // a single function. var plugin = CodegenUtils.getPluginSymbol(context.settings(), model); - var genericPluginName = "Plugin"; context.writerDelegator().useFileWriter(plugin.getDefinitionFile(), plugin.getNamespace(), writer -> { writer.addStdlibImport("typing", "Callable"); writer.addStdlibImport("typing", "TypeAlias"); writer.write("$L: TypeAlias = Callable[[$T], None]", plugin.getName(), config); writer.writeDocs("A callable that allows customizing the config object on each request.", context); - - // Generate deprecated Plugin alias if name differs from the generic name - if (!plugin.getName().equals(genericPluginName)) { - writer.write(""" - - $1L: TypeAlias = $2L - \"""Deprecated: Use :data:`$2L` instead.\""" - """, - genericPluginName, - plugin.getName()); - } }); }