We are pleased to announce the release of Snowplow Python Tracker version 0.10.0.
This release brings two enhancements:
In order to add support for Python 3.10, the use of the
pycontracts library was removed. In its place, we added Python 3 type hints to enable static type checking and implemented custom contract validations for runtime checking of value ranges. However, as a consequence of adding type hints, we had to drop support for Python 2.
Configurable timeouts for HTTP requests enable setting GET and POST HTTP request timeouts in the Emitter. By configuring timeouts, one can configure emitter behavior in case of unresponsive collectors or hanging requests. Connect and read timeouts can be configured together or separately. This is a community contribution, thanks to @DDeyanov!
This version removes the use of
pycontracts library to check for contract validations in function arguments. This results in some changes in behavior:
- Instead of the
contracts.interface.ContractNotRespectederror, a standard
ValueErroris raised when constraints on argument value ranges are violated.
- While value ranges are still validated at runtime, argument types are no longer checked at runtime. Instead, we introduced type hints to support static type checking. Our recommendation is to use IDEs that can surface type violations in your code.
Support for Python 2 was dropped with this release. In order to use the tracker with Python 2 codebase, please remain on tracker versions 0.9.x.
To upgrade using pip:
pip install snowplow-tracker==0.10.0
See the setup section in the documentation for more information.