Releases: youtype/mypy_boto3_builder
7.19.0 - Offline First
Notes
Hello, fellow citizens!
Starting from this version, --no-smart-version
flag allows you to run the builder in offline mode. Thanks to @mbalatsko for this change!
Keep sending me bug reports and feature requests, I am all for it.
Keep on keeping on!
Changed
[builder]
--no-smart-version
flag prevents pulling package data from PyPI to allow running in offline mode (implemented by @mbalatsko in #225)
Fixed
[all]
New docstring wrapper to avoid breaking MarkDown links inbotocore
docstrings[pca-connector-ad]
Fixed invalid escaping in docstrings
7.18.2
7.18.1
7.18.0 - Pydantic Typing
Notes
G'day!
Finally, boto3-stubs
is fully compatible with pydantic 2.x
. TypedDict
, Literal
, and NotRequired
are imported from typing_extensions
for Python 3.7 - 3.11. However, no code changes are required on your side. The only change is that your py37-py311 projects will now depend on typing_extensions
With pydantic 2.x
support, we can finally switch to a new TypedDict
rendering with a NotRequired
type annotation wrapper. This change decreased type_defs.py
size by 10% and overall looks nicer.
Since the changes are quite big, please report any bugs that you encounter, and do not forget to request new features.
Keep on keeping on!
Changed
[all]
Literal
andTypedDict
are imported fromtyping_extensions
forpy311
and below (suggested by @tobni in #221)[all]
Switched to a newTypedDict
renderer[all]
New detection and replacement logic for self-referencing TypeDefs
Fixed
[all]
Potential incorrect imports forUnion
-only TypeDefs[builder]
Speed up required import mapping
7.17.3
Fixed
[dynamodb]
Waiters and Paginators use separate type maps (reported by @Weber-Tr in #217)[iam]
String shapes are handled as JSON objects in they have JSON pattern[s3]
Mark arguments as optional properly in injected methods (reported by @caner-cetin in #218)
7.17.2
Fixed
[docs]
RemovedTypeDef
s list from service docs to shorten readmes (reported by @kevinnowland in #215)[dynamodb]
ReplacedTableAttributeValueTypeDef
withAttributeValueTypeDef
in outputs other thanServiceResource
andTable
(reported by @BrentSouza in #216)
7.17.1
7.17.0 - Touching Re-Union
Notes
As you know, the builder not only generates type annotations, but it also supplies tons of TypeDef
s that you can use in your code for type checking. Starting from this release TypeDef
s not only generated for TypedDict
s to help you with method inputs and outputs, but they also include named Union
s!
This is especially helpful for dynamodb
service because it has a complex TableAttributeTypeDef
Union
. However, I added support for all Union
s, even for small ones, even for the ones added in version 7.16.0
to merge input and output shapes! Just import them from <service_name>.type_defs
and start using them in your projects!
Small usage example just for you:
import boto3
from mypy_boto3_s3.type_defs import BlobTypeDef, PutObjectOutputTypeDef
# BlobTypeDef is a Union[str, bytes, IO[Any], botocore.response.StreamingBody]
# let's use it in our function!
def put_object(body: BlobTypeDef) -> PutObjectOutputTypeDef:
s3_client = boto3.client("s3")
return s3_client.put_object(body=body)
Keep on keeping on!
Added
[services]
AllUnion
s now have named type annotations intype_defs.py
(requested by @perlow in #196)[builder]
TypeUnion
type annotation to support namedUnion
s[builder]
TypeDefSortable
protocol to topologically sort bothTypedDict
s andUnion
s[docs]
Added namedUnion
s support
Changed
[docs]
TypeDef
usage examples were removed to make docs lighter
Fixed
[builder]
Formatting withblack
andisort
uses temp path[builder]
Moved reusable templates totemplates/common
[dynamodb]
ReplaceAttributeValueTypeDef
withTableAttributeValueTypeDef
inTable
methods output (reported by @fizyk in #210)[iam]
FixedPolicyDocumentTypeDef
with hardcode, bug inbotocore
(reported by @skeggsein #212)
7.16.2
7.16.1
Fixed
[builder]
TypedDict
topological sort now always succeeds (fallback to alphabetical sort is still here just in case)[builder]
Fixed infinite loop onTypedDict
comparison[builder]
TypedDict
sorting is now consistent and should[types-aiobotocore]
AddedServiceResource
import to library top level__init__.py