haiway 0.19.0__tar.gz → 0.19.2__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.
Files changed (106) hide show
  1. {haiway-0.19.0 → haiway-0.19.2}/PKG-INFO +1 -1
  2. {haiway-0.19.0 → haiway-0.19.2}/junit/test-results.xml +1 -1
  3. {haiway-0.19.0 → haiway-0.19.2}/pyproject.toml +1 -1
  4. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/context/observability.py +8 -17
  5. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/helpers/observability.py +2 -2
  6. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/helpers/tracing.py +19 -4
  7. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/utils/formatting.py +5 -2
  8. {haiway-0.19.0 → haiway-0.19.2}/uv.lock +1 -1
  9. {haiway-0.19.0 → haiway-0.19.2}/.github/workflows/ci.yml +0 -0
  10. {haiway-0.19.0 → haiway-0.19.2}/.github/workflows/publish.yml +0 -0
  11. {haiway-0.19.0 → haiway-0.19.2}/.gitignore +0 -0
  12. {haiway-0.19.0 → haiway-0.19.2}/LICENSE +0 -0
  13. {haiway-0.19.0 → haiway-0.19.2}/Makefile +0 -0
  14. {haiway-0.19.0 → haiway-0.19.2}/README.md +0 -0
  15. {haiway-0.19.0 → haiway-0.19.2}/config/pre-push +0 -0
  16. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/.dockerignore +0 -0
  17. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/Dockerfile +0 -0
  18. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/Makefile +0 -0
  19. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/README.md +0 -0
  20. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/config/.env.example +0 -0
  21. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/config/unit.json +0 -0
  22. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/docker-compose.yml +0 -0
  23. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/pyproject.toml +0 -0
  24. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/features/__int__.py +0 -0
  25. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/features/todos/__init__.py +0 -0
  26. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/features/todos/config.py +0 -0
  27. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/features/todos/state.py +0 -0
  28. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/features/todos/types.py +0 -0
  29. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/features/todos/user_tasks.py +0 -0
  30. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/integrations/__init__.py +0 -0
  31. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/integrations/postgres/__init__.py +0 -0
  32. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/integrations/postgres/client.py +0 -0
  33. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/integrations/postgres/config.py +0 -0
  34. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/integrations/postgres/state.py +0 -0
  35. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/integrations/postgres/types.py +0 -0
  36. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/migrations/__init__.py +0 -0
  37. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/migrations/__main__.py +0 -0
  38. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/migrations/postgres/__init__.py +0 -0
  39. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/migrations/postgres/execution.py +0 -0
  40. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/migrations/postgres/migration_0.py +0 -0
  41. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/migrations/postgres/types.py +0 -0
  42. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/server/__init__.py +0 -0
  43. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/server/__main__.py +0 -0
  44. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/server/application.py +0 -0
  45. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/server/config.py +0 -0
  46. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/server/middlewares/__init__.py +0 -0
  47. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/server/middlewares/context.py +0 -0
  48. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/server/routes/__init__.py +0 -0
  49. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/server/routes/technical.py +0 -0
  50. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/server/routes/todos.py +0 -0
  51. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/solutions/__init__.py +0 -0
  52. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/solutions/user_tasks/__init__.py +0 -0
  53. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/solutions/user_tasks/config.py +0 -0
  54. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/solutions/user_tasks/postgres.py +0 -0
  55. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/solutions/user_tasks/state.py +0 -0
  56. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/src/solutions/user_tasks/types.py +0 -0
  57. {haiway-0.19.0 → haiway-0.19.2}/examples/fastAPI/uv.lock +0 -0
  58. {haiway-0.19.0 → haiway-0.19.2}/guidelines/functionalities.md +0 -0
  59. {haiway-0.19.0 → haiway-0.19.2}/guidelines/packages.md +0 -0
  60. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/__init__.py +0 -0
  61. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/context/__init__.py +0 -0
  62. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/context/access.py +0 -0
  63. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/context/disposables.py +0 -0
  64. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/context/identifier.py +0 -0
  65. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/context/state.py +0 -0
  66. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/context/tasks.py +0 -0
  67. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/context/types.py +0 -0
  68. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/helpers/__init__.py +0 -0
  69. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/helpers/asynchrony.py +0 -0
  70. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/helpers/caching.py +0 -0
  71. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/helpers/retries.py +0 -0
  72. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/helpers/throttling.py +0 -0
  73. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/helpers/timeouted.py +0 -0
  74. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/opentelemetry/__init__.py +0 -0
  75. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/opentelemetry/observability.py +0 -0
  76. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/py.typed +0 -0
  77. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/state/__init__.py +0 -0
  78. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/state/attributes.py +0 -0
  79. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/state/path.py +0 -0
  80. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/state/requirement.py +0 -0
  81. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/state/structure.py +0 -0
  82. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/state/validation.py +0 -0
  83. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/types/__init__.py +0 -0
  84. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/types/default.py +0 -0
  85. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/types/frozen.py +0 -0
  86. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/types/missing.py +0 -0
  87. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/utils/__init__.py +0 -0
  88. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/utils/always.py +0 -0
  89. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/utils/collections.py +0 -0
  90. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/utils/env.py +0 -0
  91. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/utils/freezing.py +0 -0
  92. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/utils/logs.py +0 -0
  93. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/utils/mimic.py +0 -0
  94. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/utils/noop.py +0 -0
  95. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/utils/queue.py +0 -0
  96. {haiway-0.19.0 → haiway-0.19.2}/src/haiway/utils/stream.py +0 -0
  97. {haiway-0.19.0 → haiway-0.19.2}/tests/__init__.py +0 -0
  98. {haiway-0.19.0 → haiway-0.19.2}/tests/test_async_queue.py +0 -0
  99. {haiway-0.19.0 → haiway-0.19.2}/tests/test_async_stream.py +0 -0
  100. {haiway-0.19.0 → haiway-0.19.2}/tests/test_attribute_path.py +0 -0
  101. {haiway-0.19.0 → haiway-0.19.2}/tests/test_auto_retry.py +0 -0
  102. {haiway-0.19.0 → haiway-0.19.2}/tests/test_cache.py +0 -0
  103. {haiway-0.19.0 → haiway-0.19.2}/tests/test_context.py +0 -0
  104. {haiway-0.19.0 → haiway-0.19.2}/tests/test_state.py +0 -0
  105. {haiway-0.19.0 → haiway-0.19.2}/tests/test_streaming.py +0 -0
  106. {haiway-0.19.0 → haiway-0.19.2}/tests/test_timeout.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haiway
3
- Version: 0.19.0
3
+ Version: 0.19.2
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
@@ -1 +1 @@
1
- <?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="88" time="1.142" timestamp="2025-05-13T08:24:06.016960+00:00" hostname="pkrvmberfyhpb9w"><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_async_stream" name="test_fails_when_stream_fails" time="0.001" /><testcase classname="tests.test_async_stream" name="test_cancels_when_iteration_cancels" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ends_when_stream_ends" time="0.001" /><testcase classname="tests.test_async_stream" name="test_finishes_without_buffer" time="0.001" /><testcase classname="tests.test_async_stream" name="test_fails_without_buffer" time="0.001" /><testcase classname="tests.test_async_stream" name="test_delivers_updates_when_sending" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ignores_when_sending_to_finished" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ignores_when_sending_to_failed" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ignores_when_finishing_when_finished" time="0.001" /><testcase classname="tests.test_async_stream" name="test_delivers_all_when_sending_async" 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.000" /><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.005" /><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_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.000" /><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>
1
+ <?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="88" time="1.107" timestamp="2025-05-13T10:35:21.428319+00:00" hostname="pkrvmberfyhpb9w"><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_async_stream" name="test_fails_when_stream_fails" time="0.001" /><testcase classname="tests.test_async_stream" name="test_cancels_when_iteration_cancels" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ends_when_stream_ends" time="0.001" /><testcase classname="tests.test_async_stream" name="test_finishes_without_buffer" time="0.001" /><testcase classname="tests.test_async_stream" name="test_fails_without_buffer" time="0.001" /><testcase classname="tests.test_async_stream" name="test_delivers_updates_when_sending" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ignores_when_sending_to_finished" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ignores_when_sending_to_failed" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ignores_when_finishing_when_finished" time="0.001" /><testcase classname="tests.test_async_stream" name="test_delivers_all_when_sending_async" 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.000" /><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.004" /><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_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.000" /><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.19.0"
8
+ version = "0.19.2"
9
9
  readme = "README.md"
10
10
  maintainers = [
11
11
  { name = "Kacper Kaliński", email = "kacper.kalinski@miquido.com" },
@@ -7,7 +7,7 @@ from logging import INFO as INFO_LOGGING
7
7
  from logging import WARNING as WARNING_LOGGING
8
8
  from logging import Logger, getLogger
9
9
  from types import TracebackType
10
- from typing import Any, Final, Protocol, Self, final, runtime_checkable
10
+ from typing import Any, Protocol, Self, final, runtime_checkable
11
11
 
12
12
  from haiway.context.identifier import ScopeIdentifier
13
13
  from haiway.state import State
@@ -15,10 +15,6 @@ from haiway.types import Missing
15
15
  from haiway.utils.formatting import format_str
16
16
 
17
17
  __all__ = (
18
- "DEBUG",
19
- "ERROR",
20
- "INFO",
21
- "WARNING",
22
18
  "Observability",
23
19
  "ObservabilityAttribute",
24
20
  "ObservabilityAttributesRecording",
@@ -40,11 +36,6 @@ class ObservabilityLevel(IntEnum):
40
36
  DEBUG = DEBUG_LOGGING
41
37
 
42
38
 
43
- ERROR: Final[int] = ObservabilityLevel.ERROR
44
- WARNING: Final[int] = ObservabilityLevel.WARNING
45
- INFO: Final[int] = ObservabilityLevel.INFO
46
- DEBUG: Final[int] = ObservabilityLevel.DEBUG
47
-
48
39
  type ObservabilityAttribute = (
49
40
  Sequence[str]
50
41
  | Sequence[float]
@@ -253,14 +244,14 @@ def _logger_observability(
253
244
  if attributes:
254
245
  logger.log(
255
246
  level,
256
- f"{scope.unique_name} Recorded metric: {metric}={value}{unit or ''}"
247
+ f"{scope.unique_name} Recorded metric: {metric} = {value}{unit or ''}"
257
248
  f"\n{format_str(attributes)}",
258
249
  )
259
250
 
260
251
  else:
261
252
  logger.log(
262
253
  level,
263
- f"{scope.unique_name} Recorded metric: {metric}={value}{unit or ''}",
254
+ f"{scope.unique_name} Recorded metric: {metric} = {value}{unit or ''}",
264
255
  )
265
256
 
266
257
  def attributes_recording(
@@ -282,7 +273,7 @@ def _logger_observability(
282
273
  /,
283
274
  ) -> None:
284
275
  logger.log(
285
- DEBUG,
276
+ ObservabilityLevel.DEBUG,
286
277
  f"{scope.unique_name} Entering scope: {scope.label}",
287
278
  )
288
279
 
@@ -293,7 +284,7 @@ def _logger_observability(
293
284
  exception: BaseException | None,
294
285
  ) -> None:
295
286
  logger.log(
296
- DEBUG,
287
+ ObservabilityLevel.DEBUG,
297
288
  f"{scope.unique_name} Exiting scope: {scope.label}",
298
289
  exc_info=exception,
299
290
  )
@@ -410,7 +401,7 @@ class ObservabilityContext:
410
401
 
411
402
  except Exception as exc:
412
403
  cls.record_log(
413
- ERROR,
404
+ ObservabilityLevel.ERROR,
414
405
  f"Failed to record event: {type(event).__qualname__}",
415
406
  exception=exc,
416
407
  )
@@ -441,7 +432,7 @@ class ObservabilityContext:
441
432
 
442
433
  except Exception as exc:
443
434
  cls.record_log(
444
- ERROR,
435
+ ObservabilityLevel.ERROR,
445
436
  f"Failed to record metric: {metric}",
446
437
  exception=exc,
447
438
  )
@@ -466,7 +457,7 @@ class ObservabilityContext:
466
457
 
467
458
  except Exception as exc:
468
459
  cls.record_log(
469
- ERROR,
460
+ ObservabilityLevel.ERROR,
470
461
  "Failed to record attributes",
471
462
  exception=exc,
472
463
  )
@@ -129,10 +129,10 @@ def LoggerObservability( # noqa: C901, PLR0915
129
129
 
130
130
  metric_str: str
131
131
  if attributes:
132
- metric_str = f"Metric: {metric}={value}{unit or ''}\n{format_str(attributes)}"
132
+ metric_str = f"Metric: {metric} = {value}{unit or ''}\n{format_str(attributes)}"
133
133
 
134
134
  else:
135
- metric_str = f"Metric: {metric}={value}{unit or ''}"
135
+ metric_str = f"Metric: {metric} = {value}{unit or ''}"
136
136
 
137
137
  if debug_context: # store only for summary
138
138
  scopes[scope.scope_id].store.append(metric_str)
@@ -3,6 +3,7 @@ from collections.abc import Callable, Coroutine
3
3
  from typing import Any, cast, overload
4
4
 
5
5
  from haiway.context import ctx
6
+ from haiway.context.observability import ObservabilityLevel
6
7
  from haiway.types import MISSING
7
8
  from haiway.utils import mimic_function
8
9
  from haiway.utils.formatting import format_str
@@ -20,6 +21,7 @@ def traced[**Args, Result](
20
21
  @overload
21
22
  def traced[**Args, Result](
22
23
  *,
24
+ level: ObservabilityLevel = ObservabilityLevel.DEBUG,
23
25
  label: str,
24
26
  ) -> Callable[[Callable[Args, Result]], Callable[Args, Result]]: ...
25
27
 
@@ -28,6 +30,7 @@ def traced[**Args, Result](
28
30
  function: Callable[Args, Result] | None = None,
29
31
  /,
30
32
  *,
33
+ level: ObservabilityLevel = ObservabilityLevel.DEBUG,
31
34
  label: str | None = None,
32
35
  ) -> Callable[[Callable[Args, Result]], Callable[Args, Result]] | Callable[Args, Result]:
33
36
  def wrap(
@@ -40,6 +43,7 @@ def traced[**Args, Result](
40
43
  _traced_async(
41
44
  wrapped,
42
45
  label=label or wrapped.__name__,
46
+ level=level,
43
47
  ),
44
48
  )
45
49
 
@@ -47,6 +51,7 @@ def traced[**Args, Result](
47
51
  return _traced_sync(
48
52
  wrapped,
49
53
  label=label or wrapped.__name__,
54
+ level=level,
50
55
  )
51
56
 
52
57
  else: # do not trace on non debug runs
@@ -63,6 +68,7 @@ def _traced_sync[**Args, Result](
63
68
  function: Callable[Args, Result],
64
69
  /,
65
70
  label: str,
71
+ level: ObservabilityLevel,
66
72
  ) -> Callable[Args, Result]:
67
73
  def traced(
68
74
  *args: Args.args,
@@ -70,17 +76,20 @@ def _traced_sync[**Args, Result](
70
76
  ) -> Result:
71
77
  with ctx.scope(label):
72
78
  ctx.record(
79
+ level,
73
80
  attributes={
74
81
  f"[{idx}]": f"{arg}" for idx, arg in enumerate(args) if arg is not MISSING
75
- }
82
+ },
76
83
  )
77
84
  ctx.record(
78
- attributes={key: f"{arg}" for key, arg in kwargs.items() if arg is not MISSING}
85
+ level,
86
+ attributes={key: f"{arg}" for key, arg in kwargs.items() if arg is not MISSING},
79
87
  )
80
88
 
81
89
  try:
82
90
  result: Result = function(*args, **kwargs)
83
91
  ctx.record(
92
+ level,
84
93
  event="result",
85
94
  attributes={"value": format_str(result)},
86
95
  )
@@ -88,6 +97,7 @@ def _traced_sync[**Args, Result](
88
97
 
89
98
  except BaseException as exc:
90
99
  ctx.record(
100
+ level,
91
101
  event="result",
92
102
  attributes={"error": f"{type(exc)}: {exc}"},
93
103
  )
@@ -103,6 +113,7 @@ def _traced_async[**Args, Result](
103
113
  function: Callable[Args, Coroutine[Any, Any, Result]],
104
114
  /,
105
115
  label: str,
116
+ level: ObservabilityLevel,
106
117
  ) -> Callable[Args, Coroutine[Any, Any, Result]]:
107
118
  async def traced(
108
119
  *args: Args.args,
@@ -110,17 +121,20 @@ def _traced_async[**Args, Result](
110
121
  ) -> Result:
111
122
  with ctx.scope(label):
112
123
  ctx.record(
124
+ level,
113
125
  attributes={
114
126
  f"[{idx}]": f"{arg}" for idx, arg in enumerate(args) if arg is not MISSING
115
- }
127
+ },
116
128
  )
117
129
  ctx.record(
118
- attributes={key: f"{arg}" for key, arg in kwargs.items() if arg is not MISSING}
130
+ level,
131
+ attributes={key: f"{arg}" for key, arg in kwargs.items() if arg is not MISSING},
119
132
  )
120
133
 
121
134
  try:
122
135
  result: Result = await function(*args, **kwargs)
123
136
  ctx.record(
137
+ level,
124
138
  event="result",
125
139
  attributes={"value": format_str(result)},
126
140
  )
@@ -128,6 +142,7 @@ def _traced_async[**Args, Result](
128
142
 
129
143
  except BaseException as exc:
130
144
  ctx.record(
145
+ level,
131
146
  event="result",
132
147
  attributes={"error": f"{type(exc)}: {exc}"},
133
148
  )
@@ -67,6 +67,9 @@ def _object_str(
67
67
  other: object,
68
68
  /,
69
69
  ) -> str:
70
+ if not hasattr(other, "__dict__"):
71
+ return str(other)
72
+
70
73
  variables: ItemsView[str, Any] = vars(other).items()
71
74
 
72
75
  parts: list[str] = [f"┍━ {type(other).__name__}:"]
@@ -116,7 +119,7 @@ def _mapping_str(
116
119
  continue # skip empty items
117
120
 
118
121
  if parts:
119
- return "{\n " + "\n".join(parts) + "\n}"
122
+ return "{\n" + "\n".join(parts) + "\n}"
120
123
 
121
124
  else:
122
125
  return "{}"
@@ -142,7 +145,7 @@ def _sequence_str(
142
145
  continue # skip empty elements
143
146
 
144
147
  if parts:
145
- return "[\n " + "\n".join(parts) + "\n]"
148
+ return "[\n" + "\n".join(parts) + "\n]"
146
149
 
147
150
  else:
148
151
  return "[]"
@@ -123,7 +123,7 @@ wheels = [
123
123
 
124
124
  [[package]]
125
125
  name = "haiway"
126
- version = "0.19.0"
126
+ version = "0.19.2"
127
127
  source = { editable = "." }
128
128
 
129
129
  [package.optional-dependencies]
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