Typecats

Latest version: v2.0.2

Safety actively analyzes 687918 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

2.0.2

- Fixes regression in post cattrs-1.1.2 where attrs objects in `typing.Any` fields are
returned as-is and not unstructured

2.0.1

- Fixes error in structuring parameterized generic wildcats

2.0.0

Breaking changes:

- Upgrades `cattrs` from 1.1.2 to 22.1.0, `attrs` from 20.3.0 to 21.4.0 and switches to the
GenConverter, which supports the newer style type annotations (e.g, list[] instead of typing.List[]).
- Detailed validation from cattrs is enabled by default. Disable it if you wish by calling `set_detailed_validation_mode_not_threadsafe(enable=False)`
- Removed `typecats.types.CommonStructuringExceptions`. Structuring validation errors are now all `typecats.StructuringError`s (aliased to `cattrs.errors.BaseValidationError`), regardless of detailed validation.
- MyPy plugin changed from resolving from `__builtins__.<type>` to `builtins.<type>` to avoid errors. This might not work on older mypy versions.

Other changes:

- Exports `register_struc_hook_func` and `register_unstruc_hook_func`, which are methods bound to typecats's default cattrs converter.
- Changed imports from `cattr` to `cattrs`
- Supports Python 3.8 and 3.9.
- Changed function parameter types from `cattrs.Converter` to `cattrs.GenConverter` where necessary, though typecats assumes `GenConverter` throughout, so you should probably update too.

1.7.1

- Correctly reference typing_extensions as a dependency in setup.py

1.7.0

- Upgrades `cattrs` from 1.0.0 to 1.1.2 and `attrs` from 19.1.0 to 20.3.0,
primarily to fix a `cattrs` bug wherein union field types where types in the
union have defaults are not always correctly structured.

1.6.1

- Wildcats now properly implement `__eq__` to include the actual
wildcat dictionary. Additionally, this fixes a bug where
`unstruc_strip_defaults` did not properly strip attributes that
themselves had unstructurable data.

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.