haiway 0.10.0__tar.gz → 0.10.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.
Files changed (56) hide show
  1. {haiway-0.10.0/src/haiway.egg-info → haiway-0.10.1}/PKG-INFO +1 -1
  2. {haiway-0.10.0 → haiway-0.10.1}/pyproject.toml +1 -1
  3. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/state/attributes.py +4 -1
  4. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/state/validation.py +13 -4
  5. {haiway-0.10.0 → haiway-0.10.1/src/haiway.egg-info}/PKG-INFO +1 -1
  6. {haiway-0.10.0 → haiway-0.10.1}/LICENSE +0 -0
  7. {haiway-0.10.0 → haiway-0.10.1}/README.md +0 -0
  8. {haiway-0.10.0 → haiway-0.10.1}/setup.cfg +0 -0
  9. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/__init__.py +0 -0
  10. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/context/__init__.py +0 -0
  11. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/context/access.py +0 -0
  12. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/context/disposables.py +0 -0
  13. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/context/identifier.py +0 -0
  14. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/context/logging.py +0 -0
  15. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/context/metrics.py +0 -0
  16. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/context/state.py +0 -0
  17. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/context/tasks.py +0 -0
  18. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/context/types.py +0 -0
  19. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/helpers/__init__.py +0 -0
  20. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/helpers/asynchrony.py +0 -0
  21. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/helpers/caching.py +0 -0
  22. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/helpers/metrics.py +0 -0
  23. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/helpers/retries.py +0 -0
  24. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/helpers/throttling.py +0 -0
  25. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/helpers/timeouted.py +0 -0
  26. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/helpers/tracing.py +0 -0
  27. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/py.typed +0 -0
  28. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/state/__init__.py +0 -0
  29. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/state/path.py +0 -0
  30. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/state/requirement.py +0 -0
  31. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/state/structure.py +0 -0
  32. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/types/__init__.py +0 -0
  33. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/types/default.py +0 -0
  34. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/types/frozen.py +0 -0
  35. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/types/missing.py +0 -0
  36. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/utils/__init__.py +0 -0
  37. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/utils/always.py +0 -0
  38. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/utils/collections.py +0 -0
  39. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/utils/env.py +0 -0
  40. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/utils/freezing.py +0 -0
  41. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/utils/logs.py +0 -0
  42. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/utils/mimic.py +0 -0
  43. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/utils/noop.py +0 -0
  44. {haiway-0.10.0 → haiway-0.10.1}/src/haiway/utils/queue.py +0 -0
  45. {haiway-0.10.0 → haiway-0.10.1}/src/haiway.egg-info/SOURCES.txt +0 -0
  46. {haiway-0.10.0 → haiway-0.10.1}/src/haiway.egg-info/dependency_links.txt +0 -0
  47. {haiway-0.10.0 → haiway-0.10.1}/src/haiway.egg-info/requires.txt +0 -0
  48. {haiway-0.10.0 → haiway-0.10.1}/src/haiway.egg-info/top_level.txt +0 -0
  49. {haiway-0.10.0 → haiway-0.10.1}/tests/test_async_queue.py +0 -0
  50. {haiway-0.10.0 → haiway-0.10.1}/tests/test_attribute_path.py +0 -0
  51. {haiway-0.10.0 → haiway-0.10.1}/tests/test_auto_retry.py +0 -0
  52. {haiway-0.10.0 → haiway-0.10.1}/tests/test_cache.py +0 -0
  53. {haiway-0.10.0 → haiway-0.10.1}/tests/test_context.py +0 -0
  54. {haiway-0.10.0 → haiway-0.10.1}/tests/test_state.py +0 -0
  55. {haiway-0.10.0 → haiway-0.10.1}/tests/test_streaming.py +0 -0
  56. {haiway-0.10.0 → haiway-0.10.1}/tests/test_timeout.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: haiway
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: Framework for dependency injection and state management within structured concurrency model.
5
5
  Maintainer-email: Kacper Kaliński <kacper.kalinski@miquido.com>
6
6
  License: MIT License
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "haiway"
7
7
  description = "Framework for dependency injection and state management within structured concurrency model."
8
- version = "0.10.0"
8
+ version = "0.10.1"
9
9
  readme = "README.md"
10
10
  maintainers = [
11
11
  { name = "Kacper Kaliński", email = "kacper.kalinski@miquido.com" },
@@ -509,7 +509,10 @@ def _resolve_type_typeddict(
509
509
  self_annotation=resolved_attribute,
510
510
  recursion_guard=recursion_guard,
511
511
  ).update_required(key in annotation.__required_keys__)
512
- resolved_attribute.extra = attributes
512
+ resolved_attribute.extra = {
513
+ "attributes": attributes,
514
+ "required": annotation.__required_keys__,
515
+ }
513
516
  return resolved_attribute
514
517
 
515
518
 
@@ -86,6 +86,12 @@ class AttributeValidator[Type]:
86
86
  assert self.validation is not MISSING # nosec: B101
87
87
  return self.validation(value) # pyright: ignore[reportCallIssue, reportUnknownVariableType]
88
88
 
89
+ def __str__(self) -> str:
90
+ return f"Validator[{self.annotation}]"
91
+
92
+ def __repr__(self) -> str:
93
+ return f"Validator[{self.annotation}]"
94
+
89
95
 
90
96
  def _prepare_validator_of_any(
91
97
  annotation: AttributeAnnotation,
@@ -391,11 +397,12 @@ def _prepare_validator_of_typed_dict(
391
397
  case _:
392
398
  raise TypeError(f"'{value}' is not matching expected type of 'str'")
393
399
 
400
+ formatted_type: str = str(annotation)
394
401
  values_validators: dict[str, AttributeValidation[Any]] = {
395
402
  key: AttributeValidator.of(element, recursion_guard=recursion_guard)
396
- for key, element in annotation.extra.items()
403
+ for key, element in annotation.extra["attributes"].items()
397
404
  }
398
- formatted_type: str = str(annotation)
405
+ required_values: Set[str] = annotation.extra["required"]
399
406
 
400
407
  def validator(
401
408
  value: Any,
@@ -406,8 +413,10 @@ def _prepare_validator_of_typed_dict(
406
413
  validated: MutableMapping[str, Any] = {}
407
414
  for key, validator in values_validators.items():
408
415
  element: Any = elements.get(key, MISSING)
409
- if element is not MISSING:
410
- validated[key_validator(key)] = validator(element)
416
+ if element is MISSING and key not in required_values:
417
+ continue # skip missing and not required
418
+
419
+ validated[key_validator(key)] = validator(element)
411
420
 
412
421
  # TODO: make sure dict is not mutable with MappingProxyType?
413
422
  return validated
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: haiway
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: Framework for dependency injection and state management within structured concurrency model.
5
5
  Maintainer-email: Kacper Kaliński <kacper.kalinski@miquido.com>
6
6
  License: MIT License
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