There were several motivational factors for this migration:
Attrs is a popular library and we ran into conflicting version issues
as we're careful with the version ranges we choose.
Dataclass didn't exist (or wasn't part of Python) when we first introduced
attrs.
Other typecheckers (notably the one used in VS code and other python language
servers) don't support type checking attrs. Mypy supports this from a custom
mypy specific plugin.
This simplifies things for us without any disruption. Dataclasses is largely
API compatible with attrs. This also makes things easier for us when we look
into extending the model definitions for plugins. Using dataclass as a base,
which is part of Python's stdlib is easier than having to support multiple
versions of attrs.
There were several motivational factors for this migration:
Attrs is a popular library and we ran into conflicting version issues as we're careful with the version ranges we choose.
Dataclass didn't exist (or wasn't part of Python) when we first introduced attrs.
Other typecheckers (notably the one used in VS code and other python language servers) don't support type checking attrs. Mypy supports this from a custom mypy specific plugin.
This simplifies things for us without any disruption. Dataclasses is largely API compatible with attrs. This also makes things easier for us when we look into extending the model definitions for plugins. Using dataclass as a base, which is part of Python's stdlib is easier than having to support multiple versions of attrs.
I've also added an additional commit that converts the files I've modified from type comments over to type annotations. To just review the dataclass changes, see the first commit https://github.com/aws/chalice/commit/3571c7bd166dc2d5f49bbeebe0e754340819cb55
Fixes #2020.