haiway 0.10.17__tar.gz → 0.11.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {haiway-0.10.17 → haiway-0.11.1}/Makefile +1 -1
- {haiway-0.10.17 → haiway-0.11.1}/PKG-INFO +1 -1
- haiway-0.11.1/junit/test-results.xml +1 -0
- {haiway-0.10.17 → haiway-0.11.1}/pyproject.toml +1 -1
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/__init__.py +4 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/context/__init__.py +4 -1
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/context/access.py +6 -1
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/helpers/tracing.py +43 -18
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/utils/queue.py +11 -7
- {haiway-0.10.17 → haiway-0.11.1}/uv.lock +23 -23
- haiway-0.10.17/junit/test-results.xml +0 -1
- {haiway-0.10.17 → haiway-0.11.1}/.github/workflows/ci.yml +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/.github/workflows/publish.yml +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/.gitignore +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/LICENSE +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/README.md +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/config/pre-push +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/.dockerignore +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/Dockerfile +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/Makefile +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/README.md +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/config/.env.example +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/config/unit.json +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/docker-compose.yml +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/pyproject.toml +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/features/__int__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/features/todos/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/features/todos/calls.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/features/todos/config.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/features/todos/state.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/features/todos/types.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/features/todos/user_tasks.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/integrations/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/integrations/postgres/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/integrations/postgres/client.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/integrations/postgres/config.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/integrations/postgres/state.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/integrations/postgres/types.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/server/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/server/__main__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/server/application.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/server/config.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/server/middlewares/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/server/middlewares/context.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/server/routes/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/server/routes/technical.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/server/routes/todos.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/solutions/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/solutions/user_tasks/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/solutions/user_tasks/calls.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/solutions/user_tasks/config.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/solutions/user_tasks/postgres.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/solutions/user_tasks/state.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/src/solutions/user_tasks/types.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/examples/fastAPI/uv.lock +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/guidelines/functionalities.md +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/guidelines/packages.md +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/context/disposables.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/context/identifier.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/context/logging.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/context/metrics.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/context/state.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/context/tasks.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/context/types.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/helpers/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/helpers/asynchrony.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/helpers/caching.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/helpers/metrics.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/helpers/retries.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/helpers/throttling.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/helpers/timeouted.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/py.typed +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/state/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/state/attributes.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/state/path.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/state/requirement.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/state/structure.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/state/validation.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/types/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/types/default.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/types/frozen.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/types/missing.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/utils/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/utils/always.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/utils/collections.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/utils/env.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/utils/freezing.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/utils/logs.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/utils/mimic.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/src/haiway/utils/noop.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/tests/__init__.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/tests/test_async_queue.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/tests/test_attribute_path.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/tests/test_auto_retry.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/tests/test_cache.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/tests/test_context.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/tests/test_state.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/tests/test_streaming.py +0 -0
- {haiway-0.10.17 → haiway-0.11.1}/tests/test_timeout.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: haiway
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.11.1
|
4
4
|
Summary: Framework for dependency injection and state management within structured concurrency model.
|
5
5
|
Project-URL: Homepage, https://miquido.com
|
6
6
|
Project-URL: Repository, https://github.com/miquido/haiway.git
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="79" time="1.147" timestamp="2025-03-12T15:42:57.104519" hostname="fv-az1333-211"><testcase classname="tests.test_async_queue" name="test_fails_when_stream_fails" time="0.002" /><testcase classname="tests.test_async_queue" name="test_cancels_when_iteration_cancels" time="0.001" /><testcase classname="tests.test_async_queue" name="test_ends_when_stream_ends" time="0.001" /><testcase classname="tests.test_async_queue" name="test_buffers_values_when_not_reading" time="0.001" /><testcase classname="tests.test_async_queue" name="test_delivers_buffer_when_streaming_fails" time="0.001" /><testcase classname="tests.test_async_queue" name="test_delivers_updates_when_sending" time="0.001" /><testcase classname="tests.test_async_queue" name="test_fails_when_sending_to_finished" time="0.001" /><testcase classname="tests.test_async_queue" name="test_ignores_when_finishing_when_finished" time="0.001" /><testcase classname="tests.test_attribute_path" name="test_id_path_points_to_self" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_attribute_path_points_to_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_nested_attribute_path_points_to_nested_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_recursive_attribute_path_points_to_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_list_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_tuple_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_mixed_tuple_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_dict_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_id_path_set_updates_self" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_attribute_path_set_updates_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_nested_attribute_path_set_updates_nested_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_recursive_attribute_set_updates_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_list_item_path_set_updates_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_tuple_item_path_set_updates_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_mixed_tuple_item_set_updates_item" time="0.001" /><testcase classname="tests.test_attribute_path" name="test_dict_item_path_set_updates_item" time="0.000" /><testcase classname="tests.test_auto_retry" name="test_returns_value_without_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_retries_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_logs_issue_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_fails_with_exceeding_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_fails_with_cancellation" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_retries_with_selected_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_fails_with_not_selected_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_returns_value_without_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_retries_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_with_exceeding_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_with_cancellation" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_when_cancelled" time="0.021" /><testcase classname="tests.test_auto_retry" name="test_async_uses_delay_with_errors" time="0.102" /><testcase classname="tests.test_auto_retry" name="test_async_uses_computed_delay_with_errors" time="0.107" /><testcase classname="tests.test_auto_retry" name="test_async_logs_issue_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_retries_with_selected_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_with_not_selected_errors" time="0.001" /><testcase classname="tests.test_cache" name="test_returns_cache_value_with_same_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_returns_fresh_value_with_different_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_returns_fresh_value_with_limit_exceed" time="0.001" /><testcase classname="tests.test_cache" name="test_returns_same_value_with_repeating_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_fails_with_error" time="0.001" /><testcase classname="tests.test_cache" name="test_returns_fresh_value_with_expiration_time_exceed" time="0.021" /><testcase classname="tests.test_cache" name="test_async_returns_cache_value_with_same_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_fresh_value_with_different_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_fresh_value_with_limit_exceed" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_same_value_with_repeating_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_fresh_value_with_expiration_time_exceed" time="0.021" /><testcase classname="tests.test_cache" name="test_async_cancel_waiting_does_not_cancel_task" time="0.502" /><testcase classname="tests.test_cache" name="test_async_expiration_does_not_cancel_task" time="0.021" /><testcase classname="tests.test_cache" name="test_async_expiration_creates_new_task" time="0.041" /><testcase classname="tests.test_cache" name="test_async_fails_with_error" time="0.001" /><testcase classname="tests.test_context" name="test_state_is_available_according_to_context" time="0.001" /><testcase classname="tests.test_context" name="test_state_update_updates_local_context" time="0.001" /><testcase classname="tests.test_context" name="test_exceptions_are_propagated" time="0.001" /><testcase classname="tests.test_state" name="test_basic_initializes_with_arguments" time="0.002" /><testcase classname="tests.test_state" name="test_basic_initializes_with_defaults" time="0.001" /><testcase classname="tests.test_state" name="test_basic_equals_checks_properties" time="0.000" /><testcase classname="tests.test_state" name="test_basic_initializes_with_arguments_and_defaults" time="0.001" /><testcase classname="tests.test_state" name="test_parametrized_initializes_with_proper_parameters" time="0.000" /><testcase classname="tests.test_state" name="test_nested_initializes_with_proper_arguments" time="0.001" /><testcase classname="tests.test_state" name="test_dict_skips_missing_properties" time="0.000" /><testcase classname="tests.test_state" name="test_initialization_allows_missing_properties" time="0.000" /><testcase classname="tests.test_state" name="test_generic_subtypes_validation" time="0.002" /><testcase classname="tests.test_state" name="test_copying_leaves_same_object" time="0.000" /><testcase classname="tests.test_streaming" name="test_fails_when_generator_fails" time="0.001" /><testcase classname="tests.test_streaming" name="test_cancels_when_iteration_cancels" time="0.001" /><testcase classname="tests.test_streaming" name="test_ends_when_generator_ends" time="0.001" /><testcase classname="tests.test_streaming" name="test_delivers_updates_when_generating" time="0.001" /><testcase classname="tests.test_streaming" name="test_streaming_context_variables_access_is_preserved" time="0.001" /><testcase classname="tests.test_streaming" name="test_nested_streaming_streams_correctly" time="0.001" /><testcase classname="tests.test_timeout" name="test_returns_result_when_returning_value" time="0.001" /><testcase classname="tests.test_timeout" name="test_raises_with_error" time="0.001" /><testcase classname="tests.test_timeout" name="test_raises_with_cancel" time="0.011" /><testcase classname="tests.test_timeout" name="test_raises_with_timeout" time="0.011" /></testsuite></testsuites>
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
5
5
|
[project]
|
6
6
|
name = "haiway"
|
7
7
|
description = "Framework for dependency injection and state management within structured concurrency model."
|
8
|
-
version = "0.
|
8
|
+
version = "0.11.1"
|
9
9
|
readme = "README.md"
|
10
10
|
maintainers = [
|
11
11
|
{ name = "Kacper Kaliński", email = "kacper.kalinski@miquido.com" },
|
@@ -9,7 +9,9 @@ from haiway.context import (
|
|
9
9
|
MetricsScopeExiting,
|
10
10
|
MissingContext,
|
11
11
|
MissingState,
|
12
|
+
ScopeContext,
|
12
13
|
ScopeIdentifier,
|
14
|
+
StateContext,
|
13
15
|
ctx,
|
14
16
|
)
|
15
17
|
from haiway.helpers import (
|
@@ -78,8 +80,10 @@ __all__ = [
|
|
78
80
|
"MissingContext",
|
79
81
|
"MissingState",
|
80
82
|
"ResultTrace",
|
83
|
+
"ScopeContext",
|
81
84
|
"ScopeIdentifier",
|
82
85
|
"State",
|
86
|
+
"StateContext",
|
83
87
|
"always",
|
84
88
|
"as_dict",
|
85
89
|
"as_list",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from haiway.context.access import ctx
|
1
|
+
from haiway.context.access import ScopeContext, ctx
|
2
2
|
from haiway.context.disposables import Disposable, Disposables
|
3
3
|
from haiway.context.identifier import ScopeIdentifier
|
4
4
|
from haiway.context.metrics import (
|
@@ -9,6 +9,7 @@ from haiway.context.metrics import (
|
|
9
9
|
MetricsScopeEntering,
|
10
10
|
MetricsScopeExiting,
|
11
11
|
)
|
12
|
+
from haiway.context.state import StateContext
|
12
13
|
from haiway.context.types import MissingContext, MissingState
|
13
14
|
|
14
15
|
__all__ = [
|
@@ -22,6 +23,8 @@ __all__ = [
|
|
22
23
|
"MetricsScopeExiting",
|
23
24
|
"MissingContext",
|
24
25
|
"MissingState",
|
26
|
+
"ScopeContext",
|
25
27
|
"ScopeIdentifier",
|
28
|
+
"StateContext",
|
26
29
|
"ctx",
|
27
30
|
]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from asyncio import iscoroutinefunction
|
2
2
|
from collections.abc import Callable, Coroutine, Mapping, Sequence
|
3
|
-
from typing import Any, Self, cast
|
3
|
+
from typing import Any, Self, cast, overload
|
4
4
|
|
5
5
|
from haiway.context import ctx
|
6
6
|
from haiway.state import State
|
@@ -61,28 +61,53 @@ class ResultTrace(State):
|
|
61
61
|
result: Any | Missing
|
62
62
|
|
63
63
|
|
64
|
+
@overload
|
64
65
|
def traced[**Args, Result](
|
65
66
|
function: Callable[Args, Result],
|
66
67
|
/,
|
67
|
-
) -> Callable[Args, Result]:
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
),
|
76
|
-
)
|
68
|
+
) -> Callable[Args, Result]: ...
|
69
|
+
|
70
|
+
|
71
|
+
@overload
|
72
|
+
def traced[**Args, Result](
|
73
|
+
*,
|
74
|
+
label: str,
|
75
|
+
) -> Callable[[Callable[Args, Result]], Callable[Args, Result]]: ...
|
77
76
|
|
78
|
-
else:
|
79
|
-
return _traced_sync(
|
80
|
-
function,
|
81
|
-
label=function.__name__,
|
82
|
-
)
|
83
77
|
|
84
|
-
|
85
|
-
|
78
|
+
def traced[**Args, Result](
|
79
|
+
function: Callable[Args, Result] | None = None,
|
80
|
+
/,
|
81
|
+
*,
|
82
|
+
label: str | None = None,
|
83
|
+
) -> Callable[[Callable[Args, Result]], Callable[Args, Result]] | Callable[Args, Result]:
|
84
|
+
def wrap(
|
85
|
+
wrapped: Callable[Args, Result],
|
86
|
+
) -> Callable[Args, Result]:
|
87
|
+
if __debug__:
|
88
|
+
if iscoroutinefunction(wrapped):
|
89
|
+
return cast(
|
90
|
+
Callable[Args, Result],
|
91
|
+
_traced_async(
|
92
|
+
wrapped,
|
93
|
+
label=label or wrapped.__name__,
|
94
|
+
),
|
95
|
+
)
|
96
|
+
|
97
|
+
else:
|
98
|
+
return _traced_sync(
|
99
|
+
wrapped,
|
100
|
+
label=label or wrapped.__name__,
|
101
|
+
)
|
102
|
+
|
103
|
+
else: # do not trace on non debug runs
|
104
|
+
return wrapped
|
105
|
+
|
106
|
+
if function := function:
|
107
|
+
return wrap(wrapped=function)
|
108
|
+
|
109
|
+
else:
|
110
|
+
return wrap
|
86
111
|
|
87
112
|
|
88
113
|
def _traced_sync[**Args, Result](
|
@@ -23,9 +23,6 @@ class AsyncQueue[Element](AsyncIterator[Element]):
|
|
23
23
|
self._waiting: Future[Element] | None = None
|
24
24
|
self._finish_reason: BaseException | None = None
|
25
25
|
|
26
|
-
def __del__(self) -> None:
|
27
|
-
self.finish()
|
28
|
-
|
29
26
|
@property
|
30
27
|
def is_finished(self) -> bool:
|
31
28
|
return self._finish_reason is not None
|
@@ -34,7 +31,6 @@ class AsyncQueue[Element](AsyncIterator[Element]):
|
|
34
31
|
self,
|
35
32
|
element: Element,
|
36
33
|
/,
|
37
|
-
*elements: Element,
|
38
34
|
) -> None:
|
39
35
|
if self.is_finished:
|
40
36
|
raise RuntimeError("AsyncQueue is already finished")
|
@@ -45,8 +41,6 @@ class AsyncQueue[Element](AsyncIterator[Element]):
|
|
45
41
|
else:
|
46
42
|
self._queue.append(element)
|
47
43
|
|
48
|
-
self._queue.extend(elements)
|
49
|
-
|
50
44
|
def finish(
|
51
45
|
self,
|
52
46
|
exception: BaseException | None = None,
|
@@ -57,7 +51,17 @@ class AsyncQueue[Element](AsyncIterator[Element]):
|
|
57
51
|
self._finish_reason = exception or StopAsyncIteration()
|
58
52
|
|
59
53
|
if self._waiting is not None and not self._waiting.done():
|
60
|
-
|
54
|
+
# checking loop only on finish as the rest of operations
|
55
|
+
# should always have a valid loop in a typical environment
|
56
|
+
# and we are not supporting multithreading yet
|
57
|
+
if get_running_loop() is not self._loop:
|
58
|
+
self._loop.call_soon_threadsafe(
|
59
|
+
self._waiting.set_exception,
|
60
|
+
self._finish_reason,
|
61
|
+
)
|
62
|
+
|
63
|
+
else:
|
64
|
+
self._waiting.set_exception(self._finish_reason)
|
61
65
|
|
62
66
|
def cancel(self) -> None:
|
63
67
|
self.finish(exception=CancelledError())
|
@@ -67,7 +67,7 @@ wheels = [
|
|
67
67
|
|
68
68
|
[[package]]
|
69
69
|
name = "haiway"
|
70
|
-
version = "0.
|
70
|
+
version = "0.11.1"
|
71
71
|
source = { editable = "." }
|
72
72
|
|
73
73
|
[package.optional-dependencies]
|
@@ -264,36 +264,36 @@ wheels = [
|
|
264
264
|
|
265
265
|
[[package]]
|
266
266
|
name = "ruff"
|
267
|
-
version = "0.9.
|
267
|
+
version = "0.9.10"
|
268
268
|
source = { registry = "https://pypi.org/simple" }
|
269
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
269
|
+
sdist = { url = "https://files.pythonhosted.org/packages/20/8e/fafaa6f15c332e73425d9c44ada85360501045d5ab0b81400076aff27cf6/ruff-0.9.10.tar.gz", hash = "sha256:9bacb735d7bada9cfb0f2c227d3658fc443d90a727b47f206fb33f52f3c0eac7", size = 3759776 }
|
270
270
|
wheels = [
|
271
|
-
{ url = "https://files.pythonhosted.org/packages/
|
272
|
-
{ url = "https://files.pythonhosted.org/packages/
|
273
|
-
{ url = "https://files.pythonhosted.org/packages/
|
274
|
-
{ url = "https://files.pythonhosted.org/packages/
|
275
|
-
{ url = "https://files.pythonhosted.org/packages/
|
276
|
-
{ url = "https://files.pythonhosted.org/packages/
|
277
|
-
{ url = "https://files.pythonhosted.org/packages/
|
278
|
-
{ url = "https://files.pythonhosted.org/packages/
|
279
|
-
{ url = "https://files.pythonhosted.org/packages/
|
280
|
-
{ url = "https://files.pythonhosted.org/packages/
|
281
|
-
{ url = "https://files.pythonhosted.org/packages/
|
282
|
-
{ url = "https://files.pythonhosted.org/packages/
|
283
|
-
{ url = "https://files.pythonhosted.org/packages/
|
284
|
-
{ url = "https://files.pythonhosted.org/packages/
|
285
|
-
{ url = "https://files.pythonhosted.org/packages/
|
286
|
-
{ url = "https://files.pythonhosted.org/packages/
|
287
|
-
{ url = "https://files.pythonhosted.org/packages/
|
271
|
+
{ url = "https://files.pythonhosted.org/packages/73/b2/af7c2cc9e438cbc19fafeec4f20bfcd72165460fe75b2b6e9a0958c8c62b/ruff-0.9.10-py3-none-linux_armv6l.whl", hash = "sha256:eb4d25532cfd9fe461acc83498361ec2e2252795b4f40b17e80692814329e42d", size = 10049494 },
|
272
|
+
{ url = "https://files.pythonhosted.org/packages/6d/12/03f6dfa1b95ddd47e6969f0225d60d9d7437c91938a310835feb27927ca0/ruff-0.9.10-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:188a6638dab1aa9bb6228a7302387b2c9954e455fb25d6b4470cb0641d16759d", size = 10853584 },
|
273
|
+
{ url = "https://files.pythonhosted.org/packages/02/49/1c79e0906b6ff551fb0894168763f705bf980864739572b2815ecd3c9df0/ruff-0.9.10-py3-none-macosx_11_0_arm64.whl", hash = "sha256:5284dcac6b9dbc2fcb71fdfc26a217b2ca4ede6ccd57476f52a587451ebe450d", size = 10155692 },
|
274
|
+
{ url = "https://files.pythonhosted.org/packages/5b/01/85e8082e41585e0e1ceb11e41c054e9e36fed45f4b210991052d8a75089f/ruff-0.9.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47678f39fa2a3da62724851107f438c8229a3470f533894b5568a39b40029c0c", size = 10369760 },
|
275
|
+
{ url = "https://files.pythonhosted.org/packages/a1/90/0bc60bd4e5db051f12445046d0c85cc2c617095c0904f1aa81067dc64aea/ruff-0.9.10-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:99713a6e2766b7a17147b309e8c915b32b07a25c9efd12ada79f217c9c778b3e", size = 9912196 },
|
276
|
+
{ url = "https://files.pythonhosted.org/packages/66/ea/0b7e8c42b1ec608033c4d5a02939c82097ddcb0b3e393e4238584b7054ab/ruff-0.9.10-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:524ee184d92f7c7304aa568e2db20f50c32d1d0caa235d8ddf10497566ea1a12", size = 11434985 },
|
277
|
+
{ url = "https://files.pythonhosted.org/packages/d5/86/3171d1eff893db4f91755175a6e1163c5887be1f1e2f4f6c0c59527c2bfd/ruff-0.9.10-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:df92aeac30af821f9acf819fc01b4afc3dfb829d2782884f8739fb52a8119a16", size = 12155842 },
|
278
|
+
{ url = "https://files.pythonhosted.org/packages/89/9e/700ca289f172a38eb0bca752056d0a42637fa17b81649b9331786cb791d7/ruff-0.9.10-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de42e4edc296f520bb84954eb992a07a0ec5a02fecb834498415908469854a52", size = 11613804 },
|
279
|
+
{ url = "https://files.pythonhosted.org/packages/f2/92/648020b3b5db180f41a931a68b1c8575cca3e63cec86fd26807422a0dbad/ruff-0.9.10-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d257f95b65806104b6b1ffca0ea53f4ef98454036df65b1eda3693534813ecd1", size = 13823776 },
|
280
|
+
{ url = "https://files.pythonhosted.org/packages/5e/a6/cc472161cd04d30a09d5c90698696b70c169eeba2c41030344194242db45/ruff-0.9.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b60dec7201c0b10d6d11be00e8f2dbb6f40ef1828ee75ed739923799513db24c", size = 11302673 },
|
281
|
+
{ url = "https://files.pythonhosted.org/packages/6c/db/d31c361c4025b1b9102b4d032c70a69adb9ee6fde093f6c3bf29f831c85c/ruff-0.9.10-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:d838b60007da7a39c046fcdd317293d10b845001f38bcb55ba766c3875b01e43", size = 10235358 },
|
282
|
+
{ url = "https://files.pythonhosted.org/packages/d1/86/d6374e24a14d4d93ebe120f45edd82ad7dcf3ef999ffc92b197d81cdc2a5/ruff-0.9.10-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ccaf903108b899beb8e09a63ffae5869057ab649c1e9231c05ae354ebc62066c", size = 9886177 },
|
283
|
+
{ url = "https://files.pythonhosted.org/packages/00/62/a61691f6eaaac1e945a1f3f59f1eea9a218513139d5b6c2b8f88b43b5b8f/ruff-0.9.10-py3-none-musllinux_1_2_i686.whl", hash = "sha256:f9567d135265d46e59d62dc60c0bfad10e9a6822e231f5b24032dba5a55be6b5", size = 10864747 },
|
284
|
+
{ url = "https://files.pythonhosted.org/packages/ee/94/2c7065e1d92a8a8a46d46d9c3cf07b0aa7e0a1e0153d74baa5e6620b4102/ruff-0.9.10-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5f202f0d93738c28a89f8ed9eaba01b7be339e5d8d642c994347eaa81c6d75b8", size = 11360441 },
|
285
|
+
{ url = "https://files.pythonhosted.org/packages/a7/8f/1f545ea6f9fcd7bf4368551fb91d2064d8f0577b3079bb3f0ae5779fb773/ruff-0.9.10-py3-none-win32.whl", hash = "sha256:bfb834e87c916521ce46b1788fbb8484966e5113c02df216680102e9eb960029", size = 10247401 },
|
286
|
+
{ url = "https://files.pythonhosted.org/packages/4f/18/fb703603ab108e5c165f52f5b86ee2aa9be43bb781703ec87c66a5f5d604/ruff-0.9.10-py3-none-win_amd64.whl", hash = "sha256:f2160eeef3031bf4b17df74e307d4c5fb689a6f3a26a2de3f7ef4044e3c484f1", size = 11366360 },
|
287
|
+
{ url = "https://files.pythonhosted.org/packages/35/85/338e603dc68e7d9994d5d84f24adbf69bae760ba5efd3e20f5ff2cec18da/ruff-0.9.10-py3-none-win_arm64.whl", hash = "sha256:5fd804c0327a5e5ea26615550e706942f348b197d5475ff34c19733aee4b2e69", size = 10436892 },
|
288
288
|
]
|
289
289
|
|
290
290
|
[[package]]
|
291
291
|
name = "setuptools"
|
292
|
-
version = "
|
292
|
+
version = "76.0.0"
|
293
293
|
source = { registry = "https://pypi.org/simple" }
|
294
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
294
|
+
sdist = { url = "https://files.pythonhosted.org/packages/32/d2/7b171caf085ba0d40d8391f54e1c75a1cda9255f542becf84575cfd8a732/setuptools-76.0.0.tar.gz", hash = "sha256:43b4ee60e10b0d0ee98ad11918e114c70701bc6051662a9a675a0496c1a158f4", size = 1349387 }
|
295
295
|
wheels = [
|
296
|
-
{ url = "https://files.pythonhosted.org/packages/
|
296
|
+
{ url = "https://files.pythonhosted.org/packages/37/66/d2d7e6ad554f3a7c7297c3f8ef6e22643ad3d35ef5c63bf488bc89f32f31/setuptools-76.0.0-py3-none-any.whl", hash = "sha256:199466a166ff664970d0ee145839f5582cb9bca7a0a3a2e795b6a9cb2308e9c6", size = 1236106 },
|
297
297
|
]
|
298
298
|
|
299
299
|
[[package]]
|
@@ -1 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="79" time="1.133" timestamp="2025-03-10T08:19:43.409896" hostname="fv-az2027-73"><testcase classname="tests.test_async_queue" name="test_fails_when_stream_fails" time="0.001" /><testcase classname="tests.test_async_queue" name="test_cancels_when_iteration_cancels" time="0.001" /><testcase classname="tests.test_async_queue" name="test_ends_when_stream_ends" time="0.001" /><testcase classname="tests.test_async_queue" name="test_buffers_values_when_not_reading" time="0.001" /><testcase classname="tests.test_async_queue" name="test_delivers_buffer_when_streaming_fails" time="0.001" /><testcase classname="tests.test_async_queue" name="test_delivers_updates_when_sending" time="0.001" /><testcase classname="tests.test_async_queue" name="test_fails_when_sending_to_finished" time="0.001" /><testcase classname="tests.test_async_queue" name="test_ignores_when_finishing_when_finished" time="0.001" /><testcase classname="tests.test_attribute_path" name="test_id_path_points_to_self" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_attribute_path_points_to_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_nested_attribute_path_points_to_nested_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_recursive_attribute_path_points_to_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_list_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_tuple_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_mixed_tuple_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_dict_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_id_path_set_updates_self" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_attribute_path_set_updates_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_nested_attribute_path_set_updates_nested_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_recursive_attribute_set_updates_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_list_item_path_set_updates_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_tuple_item_path_set_updates_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_mixed_tuple_item_set_updates_item" time="0.001" /><testcase classname="tests.test_attribute_path" name="test_dict_item_path_set_updates_item" time="0.000" /><testcase classname="tests.test_auto_retry" name="test_returns_value_without_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_retries_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_logs_issue_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_fails_with_exceeding_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_fails_with_cancellation" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_retries_with_selected_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_fails_with_not_selected_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_returns_value_without_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_retries_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_with_exceeding_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_with_cancellation" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_when_cancelled" time="0.021" /><testcase classname="tests.test_auto_retry" name="test_async_uses_delay_with_errors" time="0.102" /><testcase classname="tests.test_auto_retry" name="test_async_uses_computed_delay_with_errors" time="0.107" /><testcase classname="tests.test_auto_retry" name="test_async_logs_issue_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_retries_with_selected_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_with_not_selected_errors" time="0.001" /><testcase classname="tests.test_cache" name="test_returns_cache_value_with_same_argument" time="0.000" /><testcase classname="tests.test_cache" name="test_returns_fresh_value_with_different_argument" time="0.000" /><testcase classname="tests.test_cache" name="test_returns_fresh_value_with_limit_exceed" time="0.000" /><testcase classname="tests.test_cache" name="test_returns_same_value_with_repeating_argument" time="0.000" /><testcase classname="tests.test_cache" name="test_fails_with_error" time="0.000" /><testcase classname="tests.test_cache" name="test_returns_fresh_value_with_expiration_time_exceed" time="0.021" /><testcase classname="tests.test_cache" name="test_async_returns_cache_value_with_same_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_fresh_value_with_different_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_fresh_value_with_limit_exceed" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_same_value_with_repeating_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_fresh_value_with_expiration_time_exceed" time="0.021" /><testcase classname="tests.test_cache" name="test_async_cancel_waiting_does_not_cancel_task" time="0.502" /><testcase classname="tests.test_cache" name="test_async_expiration_does_not_cancel_task" time="0.021" /><testcase classname="tests.test_cache" name="test_async_expiration_creates_new_task" time="0.041" /><testcase classname="tests.test_cache" name="test_async_fails_with_error" time="0.001" /><testcase classname="tests.test_context" name="test_state_is_available_according_to_context" time="0.001" /><testcase classname="tests.test_context" name="test_state_update_updates_local_context" time="0.001" /><testcase classname="tests.test_context" name="test_exceptions_are_propagated" time="0.001" /><testcase classname="tests.test_state" name="test_basic_initializes_with_arguments" time="0.002" /><testcase classname="tests.test_state" name="test_basic_initializes_with_defaults" time="0.001" /><testcase classname="tests.test_state" name="test_basic_equals_checks_properties" time="0.000" /><testcase classname="tests.test_state" name="test_basic_initializes_with_arguments_and_defaults" time="0.001" /><testcase classname="tests.test_state" name="test_parametrized_initializes_with_proper_parameters" time="0.000" /><testcase classname="tests.test_state" name="test_nested_initializes_with_proper_arguments" time="0.001" /><testcase classname="tests.test_state" name="test_dict_skips_missing_properties" time="0.000" /><testcase classname="tests.test_state" name="test_initialization_allows_missing_properties" time="0.000" /><testcase classname="tests.test_state" name="test_generic_subtypes_validation" time="0.002" /><testcase classname="tests.test_state" name="test_copying_leaves_same_object" time="0.001" /><testcase classname="tests.test_streaming" name="test_fails_when_generator_fails" time="0.001" /><testcase classname="tests.test_streaming" name="test_cancels_when_iteration_cancels" time="0.001" /><testcase classname="tests.test_streaming" name="test_ends_when_generator_ends" time="0.001" /><testcase classname="tests.test_streaming" name="test_delivers_updates_when_generating" time="0.001" /><testcase classname="tests.test_streaming" name="test_streaming_context_variables_access_is_preserved" time="0.001" /><testcase classname="tests.test_streaming" name="test_nested_streaming_streams_correctly" time="0.001" /><testcase classname="tests.test_timeout" name="test_returns_result_when_returning_value" time="0.001" /><testcase classname="tests.test_timeout" name="test_raises_with_error" time="0.001" /><testcase classname="tests.test_timeout" name="test_raises_with_cancel" time="0.011" /><testcase classname="tests.test_timeout" name="test_raises_with_timeout" time="0.011" /></testsuite></testsuites>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|