Skip to content

Conversation

@alextwoods
Copy link
Contributor

@alextwoods alextwoods commented Mar 7, 2025

Description of changes:
Addresses comment from: #409 (comment)

The issue is that optional dependencies are stored as typed properties on the symbol dependencies and those properties are not merged by smithy's gatherDependencies method. We're adding the smithy_http dependency hundreds of times through out the code, but only once with the optionalDependencies specified.

This PR sets awscrt and aiohttp as optional dependencies on the smithy_http SymbolDependency (undooing changes from #409) and uses a custom gatherDependencies with a custom merge function that merges the OPTIONAL_DEPENDENCIES property.

Resulting dependencies for generated client:

dependencies = [
    "aws_event_stream==0.0.1",
    "smithy_core==0.0.1",
    "smithy_event_stream==0.0.1",
    "smithy_http[awscrt]==0.0.1",
    "smithy_json==0.0.1"
]

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@alextwoods alextwoods requested a review from a team as a code owner March 7, 2025 16:00
@alextwoods alextwoods merged commit 8bced95 into smithy-lang:develop Mar 10, 2025
2 checks passed
@alextwoods alextwoods deleted the crt_as_extra branch March 10, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants