Repository navigation
(python-codegen): Allow dashes in the package name - #968
Merged
Merged
Conversation
arandito
marked this pull request as ready for review
November 19, 2026 21:02
stobrien89
reviewed
Nov 19, 2026
| readme = "README.md" | ||
| requires-python = ">=3.12" | ||
| keywords = ["smithy", {_toml_string(settings.package)}] | ||
| keywords = ["smithy", {_toml_string(settings.import_name)}] |
Contributor
There was a problem hiding this comment.
Should keywords use settings.package instead? People search PyPI by the distribution name, so my-client seems more useful there than my_client.
stobrien89
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR lets the Python generator accept dashes in
--package.pyproject.tomlnameuses the package name as given (my-client).src/directory, and the wheelpackagesentry use the newArtifactSettings.import_nameproperty. It normalizes the name to underscores (my_client).Dashed names are the normalized form defined by the PyPA name normalization spec.
Currently, our sdk packages are forced to publish with underscores: (aws_sdk_s3, aws_sdk_ec2, etc). This change allows us to migrate to dashes and allows generic users to choose the naming scheme for their own packages.
Follow-up: When migrating to python codegen, we should change our projections to use dashes. This won't break existing releases since PyPI accepts both.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.