From 2f84f2ab7b70064d56892dd29c21e50fe2e7fd40 Mon Sep 17 00:00:00 2001 From: karosis88 Date: Wed, 19 Jul 2023 15:19:41 +0300 Subject: [PATCH] Revert new type annotations --- hishel/_serializers.py | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hishel/_serializers.py b/hishel/_serializers.py index e61221bb..910f8bdc 100644 --- a/hishel/_serializers.py +++ b/hishel/_serializers.py @@ -82,7 +82,7 @@ def is_binary(self) -> bool: class YamlSerializer(BaseSerializer): - def dumps(self, response: Response) -> str | bytes: + def dumps(self, response: Response) -> tp.Union[str, bytes]: response_dict = { "status": response.status, "headers": [ @@ -97,7 +97,7 @@ def dumps(self, response: Response) -> str | bytes: } return yaml.safe_dump(response_dict, sort_keys=False) - def loads(self, data: str | bytes) -> Response: + def loads(self, data: tp.Union[str, bytes]) -> Response: response_dict = yaml.safe_load(data) return Response( diff --git a/pyproject.toml b/pyproject.toml index dbf07279..852ffef7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ check_untyped_defs = true [tool.pytest.ini_options] addopts = ["-rxXs", "--strict-config", "--strict-markers"] markers = ["copied_from(source, changes=None): mark test as copied from somewhere else, along with a description of changes made to accodomate e.g. our test setup"] -filterwarnings = ["error"] +filterwarnings = [] [tool.coverage.run] omit = [