Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future annotations #335

Merged
merged 55 commits into from
Dec 18, 2024
Merged

Future annotations #335

merged 55 commits into from
Dec 18, 2024

Conversation

vemel
Copy link
Collaborator

@vemel vemel commented Dec 15, 2024

Highlights

  • All packages use new syntax for type annotations

Added

  • [services] Support future type annotations in all generated files
  • [services] type: ignore comments always have a specific type

Changed

  • [services] All generated modules use __future__.annotations
  • [services] Subscripts are no longer stringified
  • [services] Subresources are sorted alphabetically, removed pseudo-topological sorting
  • [services] Replaced Optional[...] with ... | None
  • [services] Replaced inline Union with a new X | Y syntax (named Unions preserve old style for python<3.10 compatibility)
  • [services] Replaced typing.Dict/List/type with builtins equivalients
  • [services] Replaced typing.Set with builtins.set (currently unused in botocore)
  • [aio-services] Importing <service>.service_resourse is no longer safe when boto3 and aioboto3 are not installed
  • [all] All annotations synced from static stubs

Fixed

  • [services] Docstring headers for generated files were not formatted properly
  • [builder] Unnamed Union returns correct required imports for rendering
  • [services] BotocoreClientError is no longer generated, using botocore.exceptions.ClientError instead
  • [services] Client.close method is not longer generated, inherited from static stubs instead
  • [services] Client.exceptions is inherited from BaseClientExceptions
  • [services] Conditional imports marked with # type: ignore[assignment] for better mypy support

@vemel vemel merged commit 4d04bf8 into main Dec 18, 2024
3 checks passed
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.

1 participant