Loading .pre-commit-config.yaml +1 −0 Original line number Diff line number Diff line Loading @@ -89,5 +89,6 @@ repos: hooks: - id: mypy additional_dependencies: - types-orjson - types-requests - git+https://code.kodo.org.uk/dom/type-stubs.git#type-stubs[jsonpath,parse] behave_utils/json.py +3 −3 Original line number Diff line number Diff line Loading @@ -10,12 +10,12 @@ JSON classes for container types (objects and arrays) from __future__ import annotations import json from typing import Any from typing import Callable from typing import TypeVar from typing import overload import orjson from jsonpath import JSONPath __all__ = [ Loading Loading @@ -61,7 +61,7 @@ class JSONObject(JSONPathMixin, dict[str, Any]): """ Create a JSONObject from a JSON string """ return cls(json.loads(string)) return cls(orjson.loads(string)) class JSONArray(JSONPathMixin, list[Any]): Loading @@ -76,4 +76,4 @@ class JSONArray(JSONPathMixin, list[Any]): """ Create a JSONArray from a JSON string """ return cls(json.loads(string)) return cls(orjson.loads(string)) behave_utils/proc.py +2 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ from typing import overload import trio.abc T = TypeVar('T') Deserialiser = Callable[[bytes], T] Deserialiser = Callable[[memoryview], T] PathLike = os.PathLike[str] PathArg = Union[PathLike, str] Loading Loading @@ -90,7 +90,7 @@ def exec_io( proc = trio.run(_exec_io, cmd, data, stdout, stderr, kwargs) if deserialiser: assert isinstance(stdout, io.BytesIO) return deserialiser(stdout.getvalue()) return deserialiser(stdout.getbuffer()) return proc.returncode Loading pyproject.toml +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ include = [ python = "~=3.9" behave = "~=1.2" jsonpath-python = "~=1.0" orjson = "~=3.6.1" parse = "~=1.19" requests = "~=2.26" trio = "~=0.19" Loading Loading
.pre-commit-config.yaml +1 −0 Original line number Diff line number Diff line Loading @@ -89,5 +89,6 @@ repos: hooks: - id: mypy additional_dependencies: - types-orjson - types-requests - git+https://code.kodo.org.uk/dom/type-stubs.git#type-stubs[jsonpath,parse]
behave_utils/json.py +3 −3 Original line number Diff line number Diff line Loading @@ -10,12 +10,12 @@ JSON classes for container types (objects and arrays) from __future__ import annotations import json from typing import Any from typing import Callable from typing import TypeVar from typing import overload import orjson from jsonpath import JSONPath __all__ = [ Loading Loading @@ -61,7 +61,7 @@ class JSONObject(JSONPathMixin, dict[str, Any]): """ Create a JSONObject from a JSON string """ return cls(json.loads(string)) return cls(orjson.loads(string)) class JSONArray(JSONPathMixin, list[Any]): Loading @@ -76,4 +76,4 @@ class JSONArray(JSONPathMixin, list[Any]): """ Create a JSONArray from a JSON string """ return cls(json.loads(string)) return cls(orjson.loads(string))
behave_utils/proc.py +2 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ from typing import overload import trio.abc T = TypeVar('T') Deserialiser = Callable[[bytes], T] Deserialiser = Callable[[memoryview], T] PathLike = os.PathLike[str] PathArg = Union[PathLike, str] Loading Loading @@ -90,7 +90,7 @@ def exec_io( proc = trio.run(_exec_io, cmd, data, stdout, stderr, kwargs) if deserialiser: assert isinstance(stdout, io.BytesIO) return deserialiser(stdout.getvalue()) return deserialiser(stdout.getbuffer()) return proc.returncode Loading
pyproject.toml +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ include = [ python = "~=3.9" behave = "~=1.2" jsonpath-python = "~=1.0" orjson = "~=3.6.1" parse = "~=1.19" requests = "~=2.26" trio = "~=0.19" Loading