aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.61k stars 1.01k forks source link

Migrate from attrs to dataclass #2026

Closed jamesls closed 1 year ago

jamesls commented 1 year ago

There were several motivational factors for this migration:

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.