omlish 0.0.0.dev484__py3-none-any.whl → 0.0.0.dev493__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.
- omlish/README.md +199 -0
- omlish/__about__.py +8 -3
- omlish/dataclasses/impl/generation/plans.py +2 -17
- omlish/dataclasses/impl/generation/processor.py +2 -2
- omlish/dataclasses/impl/processing/driving.py +13 -1
- omlish/diag/_pycharm/runhack.py +1 -1
- omlish/inject/__init__.py +19 -11
- omlish/inject/_dataclasses.py +1485 -1323
- omlish/inject/binder.py +7 -4
- omlish/inject/eagers.py +2 -0
- omlish/inject/helpers/late.py +76 -0
- omlish/inject/{managed.py → helpers/managed.py} +10 -10
- omlish/inject/impl/elements.py +7 -4
- omlish/inject/impl/injector.py +10 -7
- omlish/inject/inspect.py +1 -1
- omlish/lang/__init__.py +2 -0
- omlish/lifecycles/README.md +30 -0
- omlish/lifecycles/__init__.py +87 -13
- omlish/lifecycles/_dataclasses.py +1388 -0
- omlish/lifecycles/base.py +178 -64
- omlish/lifecycles/contextmanagers.py +113 -4
- omlish/lifecycles/controller.py +150 -87
- omlish/lifecycles/injection.py +143 -0
- omlish/lifecycles/listeners.py +56 -0
- omlish/lifecycles/managed.py +142 -0
- omlish/lifecycles/manager.py +218 -93
- omlish/lifecycles/states.py +2 -0
- omlish/lifecycles/transitions.py +3 -0
- omlish/lifecycles/unwrap.py +57 -0
- omlish/lite/typing.py +18 -0
- omlish/logs/_amalg.py +1 -1
- omlish/logs/all.py +25 -11
- omlish/logs/asyncs.py +73 -0
- omlish/logs/base.py +101 -12
- omlish/logs/contexts.py +4 -1
- omlish/logs/lists.py +125 -0
- omlish/logs/modules.py +19 -1
- omlish/logs/std/loggers.py +6 -1
- omlish/logs/std/noisy.py +11 -9
- omlish/logs/{standard.py → std/standard.py} +3 -4
- omlish/logs/utils.py +16 -1
- omlish/marshal/_dataclasses.py +781 -781
- omlish/reflect/__init__.py +43 -26
- omlish/reflect/ops.py +10 -1
- omlish/specs/jmespath/_dataclasses.py +559 -559
- omlish/specs/jsonschema/keywords/_dataclasses.py +220 -220
- omlish/sql/__init__.py +24 -5
- omlish/sql/api/dbapi.py +1 -1
- omlish/sql/dbapi/__init__.py +15 -0
- omlish/sql/{dbapi.py → dbapi/drivers.py} +2 -2
- omlish/sql/queries/__init__.py +3 -0
- omlish/testing/pytest/plugins/asyncs/plugin.py +2 -0
- omlish/text/docwrap/cli.py +5 -0
- {omlish-0.0.0.dev484.dist-info → omlish-0.0.0.dev493.dist-info}/METADATA +8 -5
- {omlish-0.0.0.dev484.dist-info → omlish-0.0.0.dev493.dist-info}/RECORD +61 -51
- omlish/lifecycles/abstract.py +0 -86
- /omlish/inject/{impl → helpers}/proxy.py +0 -0
- /omlish/sql/{abc.py → dbapi/abc.py} +0 -0
- {omlish-0.0.0.dev484.dist-info → omlish-0.0.0.dev493.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev484.dist-info → omlish-0.0.0.dev493.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev484.dist-info → omlish-0.0.0.dev493.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev484.dist-info → omlish-0.0.0.dev493.dist-info}/top_level.txt +0 -0
omlish/reflect/__init__.py
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
28
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|