omlish 0.0.0.dev484__py3-none-any.whl → 0.0.0.dev506__py3-none-any.whl

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.

Potentially problematic release.


This version of omlish might be problematic. Click here for more details.

Files changed (93) hide show
  1. omlish/CODESTYLE.md +345 -0
  2. omlish/README.md +199 -0
  3. omlish/__about__.py +12 -5
  4. omlish/_check.cc +209 -0
  5. omlish/check.py +11 -0
  6. omlish/dataclasses/__init__.py +4 -0
  7. omlish/dataclasses/impl/concerns/frozen.py +4 -1
  8. omlish/dataclasses/impl/generation/plans.py +2 -17
  9. omlish/dataclasses/impl/generation/processor.py +2 -2
  10. omlish/dataclasses/impl/processing/driving.py +13 -1
  11. omlish/dataclasses/tools/replace.py +27 -0
  12. omlish/diag/_pycharm/runhack.py +1 -1
  13. omlish/dispatch/functions.py +1 -1
  14. omlish/formats/json/stream/lexing.py +13 -5
  15. omlish/formats/json/stream/parsing.py +1 -1
  16. omlish/inject/README.md +430 -0
  17. omlish/inject/__init__.py +20 -11
  18. omlish/inject/_dataclasses.py +1545 -1383
  19. omlish/inject/binder.py +7 -4
  20. omlish/inject/eagers.py +2 -4
  21. omlish/inject/elements.py +4 -0
  22. omlish/inject/helpers/late.py +76 -0
  23. omlish/inject/{managed.py → helpers/managed.py} +37 -34
  24. omlish/inject/impl/elements.py +7 -4
  25. omlish/inject/impl/injector.py +14 -26
  26. omlish/inject/impl/inspect.py +0 -8
  27. omlish/inject/impl/origins.py +1 -0
  28. omlish/inject/impl/privates.py +2 -6
  29. omlish/inject/impl/providers.py +0 -4
  30. omlish/inject/impl/scopes.py +14 -18
  31. omlish/inject/inspect.py +10 -1
  32. omlish/inject/multis.py +0 -3
  33. omlish/inject/scopes.py +7 -5
  34. omlish/io/buffers.py +35 -8
  35. omlish/lang/__init__.py +10 -0
  36. omlish/lang/classes/simple.py +2 -1
  37. omlish/lang/iterables.py +6 -0
  38. omlish/lang/objects.py +13 -0
  39. omlish/lang/outcomes.py +1 -1
  40. omlish/lang/recursion.py +1 -1
  41. omlish/lang/sequences.py +33 -0
  42. omlish/lifecycles/README.md +30 -0
  43. omlish/lifecycles/__init__.py +87 -13
  44. omlish/lifecycles/_dataclasses.py +1388 -0
  45. omlish/lifecycles/base.py +178 -64
  46. omlish/lifecycles/contextmanagers.py +113 -4
  47. omlish/lifecycles/controller.py +150 -87
  48. omlish/lifecycles/injection.py +143 -0
  49. omlish/lifecycles/listeners.py +56 -0
  50. omlish/lifecycles/managed.py +142 -0
  51. omlish/lifecycles/manager.py +218 -93
  52. omlish/lifecycles/states.py +2 -0
  53. omlish/lifecycles/transitions.py +3 -0
  54. omlish/lifecycles/unwrap.py +57 -0
  55. omlish/lite/maybes.py +7 -0
  56. omlish/lite/typing.py +33 -0
  57. omlish/logs/_amalg.py +1 -1
  58. omlish/logs/all.py +36 -11
  59. omlish/logs/asyncs.py +73 -0
  60. omlish/logs/base.py +101 -12
  61. omlish/logs/bisync.py +99 -0
  62. omlish/logs/contexts.py +4 -1
  63. omlish/logs/lists.py +125 -0
  64. omlish/logs/modules.py +19 -1
  65. omlish/logs/std/loggers.py +6 -1
  66. omlish/logs/std/noisy.py +11 -9
  67. omlish/logs/{standard.py → std/standard.py} +3 -4
  68. omlish/logs/utils.py +16 -1
  69. omlish/marshal/_dataclasses.py +813 -813
  70. omlish/reflect/__init__.py +43 -26
  71. omlish/reflect/ops.py +10 -1
  72. omlish/specs/jmespath/_dataclasses.py +597 -597
  73. omlish/specs/jsonschema/keywords/_dataclasses.py +244 -244
  74. omlish/sql/__init__.py +24 -5
  75. omlish/sql/api/dbapi.py +1 -1
  76. omlish/sql/dbapi/__init__.py +15 -0
  77. omlish/sql/{dbapi.py → dbapi/drivers.py} +2 -2
  78. omlish/sql/queries/__init__.py +3 -0
  79. omlish/testing/pytest/plugins/asyncs/plugin.py +2 -0
  80. omlish/text/docwrap/cli.py +5 -0
  81. omlish/typedvalues/_collection.cc +500 -0
  82. omlish/typedvalues/collection.py +159 -62
  83. omlish/typedvalues/generic.py +5 -4
  84. omlish/typedvalues/values.py +6 -0
  85. {omlish-0.0.0.dev484.dist-info → omlish-0.0.0.dev506.dist-info}/METADATA +14 -9
  86. {omlish-0.0.0.dev484.dist-info → omlish-0.0.0.dev506.dist-info}/RECORD +92 -77
  87. omlish/lifecycles/abstract.py +0 -86
  88. /omlish/inject/{impl → helpers}/proxy.py +0 -0
  89. /omlish/sql/{abc.py → dbapi/abc.py} +0 -0
  90. {omlish-0.0.0.dev484.dist-info → omlish-0.0.0.dev506.dist-info}/WHEEL +0 -0
  91. {omlish-0.0.0.dev484.dist-info → omlish-0.0.0.dev506.dist-info}/entry_points.txt +0 -0
  92. {omlish-0.0.0.dev484.dist-info → omlish-0.0.0.dev506.dist-info}/licenses/LICENSE +0 -0
  93. {omlish-0.0.0.dev484.dist-info → omlish-0.0.0.dev506.dist-info}/top_level.txt +0 -0
@@ -9,52 +9,69 @@ with _lang.auto_proxy_init(
9
9
  ##
10
10
 
11
11
  from .inspect import ( # noqa
12
+ has_annotations,
13
+
12
14
  get_annotations,
15
+
13
16
  get_filtered_type_hints,
14
- has_annotations,
15
17
  )
16
18
 
17
19
  from .ops import ( # noqa
18
- get_concrete_type,
19
- get_underlying,
20
- strip_annotations,
21
20
  strip_objs,
22
- to_annotation,
21
+ strip_annotations,
22
+
23
23
  types_equivalent,
24
+
25
+ get_underlying,
26
+ get_concrete_type,
27
+
28
+ to_annotation,
24
29
  )
25
30
 
26
31
  from .subst import ( # noqa
27
- ALIAS_UPDATING_GENERIC_SUBSTITUTION,
28
- DEFAULT_GENERIC_SUBSTITUTION,
32
+ get_type_var_replacements,
33
+ replace_type_vars,
34
+
29
35
  GenericSubstitution,
36
+ DEFAULT_GENERIC_SUBSTITUTION,
37
+ ALIAS_UPDATING_GENERIC_SUBSTITUTION,
38
+
30
39
  generic_mro,
31
40
  get_generic_bases,
32
- get_type_var_replacements,
33
- replace_type_vars,
34
41
  )
35
42
 
36
43
  from .types import ( # noqa
37
- ANY,
38
- Annotated,
39
- Any,
40
- DEFAULT_REFLECTOR,
41
- Generic,
44
+ is_simple_generic_alias_type,
45
+ get_params,
46
+ is_union_type,
47
+ get_orig_bases,
48
+ get_orig_class,
49
+ get_newtype_supertype,
50
+ get_type_var_bound,
51
+
52
+ TypeInfo,
53
+ Type,
54
+ TYPES,
55
+
56
+ Union,
57
+
42
58
  GenericLike,
43
- Literal,
44
- NewType,
59
+ Generic,
45
60
  Protocol,
61
+
62
+ NewType,
63
+
64
+ Annotated,
65
+
66
+ Literal,
67
+
68
+ Any,
69
+ ANY,
70
+
46
71
  ReflectTypeError,
72
+
47
73
  Reflector,
48
- TYPES,
49
- Type,
50
- TypeInfo,
51
- Union,
52
- get_newtype_supertype,
53
- get_orig_bases,
54
- get_orig_class,
55
- get_params,
56
- get_type_var_bound,
74
+ DEFAULT_REFLECTOR,
57
75
  is_type,
58
- is_union_type,
59
76
  type_,
60
77
  )
omlish/reflect/ops.py CHANGED
@@ -57,6 +57,9 @@ def strip_annotations(ty: Type) -> Type:
57
57
  raise TypeError(ty)
58
58
 
59
59
 
60
+ ##
61
+
62
+
60
63
  def types_equivalent(l: Type, r: Type) -> bool:
61
64
  if isinstance(l, Generic) and isinstance(r, Generic):
62
65
  return l.cls == r.cls and l.args == r.args
@@ -64,6 +67,9 @@ def types_equivalent(l: Type, r: Type) -> bool:
64
67
  return l == r
65
68
 
66
69
 
70
+ ##
71
+
72
+
67
73
  def get_underlying(nt: NewType) -> Type:
68
74
  return type_(nt.obj.__supertype__) # noqa
69
75
 
@@ -97,6 +103,9 @@ def get_concrete_type(
97
103
  return rec(ty)
98
104
 
99
105
 
106
+ ##
107
+
108
+
100
109
  def to_annotation(ty: Type) -> ta.Any:
101
110
  if isinstance(ty, Generic):
102
111
  return ty.obj if ty.obj is not None else ty.cls
@@ -105,7 +114,7 @@ def to_annotation(ty: Type) -> ta.Any:
105
114
  return ta.Union[*tuple(to_annotation(e) for e in ty.args)]
106
115
 
107
116
  if isinstance(ty, Protocol):
108
- return ta.Protocol[*ty.params]
117
+ return ta.Protocol[*ty.params] # noqa
109
118
 
110
119
  if isinstance(ty, (type, ta.TypeVar, NewType)):
111
120
  return ty