omlish 0.0.0.dev362__py3-none-any.whl → 0.0.0.dev364__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/.manifests.json +1 -1
- omlish/__about__.py +2 -2
- omlish/algorithm/distribute.py +3 -0
- omlish/algorithm/toposort.py +3 -0
- omlish/algorithm/unify.py +3 -0
- omlish/argparse/cli.py +1 -1
- omlish/asyncs/utils.py +1 -1
- omlish/codecs/base.py +1 -1
- omlish/codecs/chain.py +3 -0
- omlish/codecs/funcs.py +3 -0
- omlish/concurrent/executors.py +3 -0
- omlish/configs/nginx.py +3 -0
- omlish/configs/types.py +1 -1
- omlish/daemons/reparent.py +3 -0
- omlish/daemons/services.py +1 -1
- omlish/dataclasses/api/classes/conversion.py +1 -1
- omlish/dataclasses/processing/priority.py +3 -0
- omlish/datetimes.py +2 -1
- omlish/diag/pydevd.py +3 -0
- omlish/diag/replserver/console.py +3 -0
- omlish/diag/replserver/server.py +3 -0
- omlish/docker/cli.py +3 -0
- omlish/docker/compose.py +3 -0
- omlish/docker/manifests.py +3 -0
- omlish/formats/json/backends/base.py +3 -0
- omlish/formats/json/literals.py +1 -1
- omlish/formats/json5/__init__.py +4 -0
- omlish/formats/json5/codec.py +19 -0
- omlish/formats/json5/rendering.py +1 -1
- omlish/formats/props.py +3 -0
- omlish/formats/toml/writer.py +3 -0
- omlish/funcs/match.py +3 -0
- omlish/graphs/trees.py +1 -1
- omlish/http/clients/base.py +2 -2
- omlish/http/coro/fdio.py +3 -0
- omlish/http/coro/simple.py +3 -0
- omlish/http/dates.py +3 -0
- omlish/http/multipart.py +3 -0
- omlish/http/versions.py +3 -0
- omlish/inject/multis.py +2 -2
- omlish/io/compress/base.py +3 -0
- omlish/io/coro/readers.py +1 -1
- omlish/io/fileno.py +3 -0
- omlish/io/pyio.py +3 -0
- omlish/lang/__init__.py +1 -1
- omlish/lang/classes/abstract.py +1 -1
- omlish/lang/contextmanagers.py +1 -1
- omlish/lang/strings.py +1 -1
- omlish/lifecycles/abstract.py +3 -0
- omlish/lifecycles/base.py +3 -0
- omlish/lifecycles/contextmanagers.py +3 -0
- omlish/lifecycles/controller.py +3 -0
- omlish/lifecycles/manager.py +3 -0
- omlish/lifecycles/states.py +3 -0
- omlish/lifecycles/transitions.py +3 -0
- omlish/lite/check.py +1 -1
- omlish/lite/pycharm.py +3 -0
- omlish/lite/runtime.py +3 -0
- omlish/lite/secrets.py +3 -0
- omlish/manifests/types.py +3 -0
- omlish/marshal/naming.py +3 -0
- omlish/marshal/proxy.py +3 -0
- omlish/marshal/registries.py +3 -0
- omlish/multiprocessing/proxies.py +3 -0
- omlish/multiprocessing/spawn.py +3 -0
- omlish/os/deathsig.py +3 -0
- omlish/os/fcntl.py +3 -0
- omlish/os/filemodes.py +3 -0
- omlish/os/files.py +3 -0
- omlish/os/linux.py +3 -0
- omlish/os/mangle.py +1 -1
- omlish/os/paths.py +3 -0
- omlish/os/pidfiles/cli.py +3 -0
- omlish/os/signals.py +3 -0
- omlish/os/sizes.py +3 -0
- omlish/os/temp.py +3 -0
- omlish/reflect/ops.py +3 -0
- omlish/reflect/subst.py +3 -0
- omlish/specs/irc/messages/messages.py +1 -1
- omlish/specs/irc/numerics/formats.py +3 -0
- omlish/specs/irc/protocol/message.py +3 -0
- omlish/specs/irc/protocol/nuh.py +3 -0
- omlish/specs/irc/protocol/parsing.py +3 -0
- omlish/specs/irc/protocol/rendering.py +3 -0
- omlish/specs/irc/protocol/tags.py +3 -0
- omlish/specs/irc/protocol/utils.py +3 -0
- omlish/specs/jsonrpc/errors.py +3 -0
- omlish/specs/jsonrpc/marshal.py +3 -0
- omlish/specs/jsonschema/keywords/parse.py +11 -11
- omlish/sql/alchemy/asyncs.py +6 -3
- omlish/sql/alchemy/duckdb.py +3 -0
- omlish/sql/alchemy/exprs.py +3 -0
- omlish/sql/alchemy/secrets.py +4 -1
- omlish/sql/alchemy/sqlean.py +3 -0
- omlish/sql/tabledefs/alchemy.py +3 -0
- omlish/sql/tabledefs/dtypes.py +3 -0
- omlish/sql/tabledefs/lower.py +3 -0
- omlish/sql/tabledefs/marshal.py +3 -0
- omlish/subprocesses/run.py +2 -2
- omlish/term/vt100/c.py +3 -0
- omlish/testing/pytest/marks.py +3 -0
- omlish/testing/pytest/plugins/asyncs/backends/asyncio.py +3 -0
- omlish/testing/pytest/plugins/asyncs/backends/base.py +3 -0
- omlish/testing/pytest/plugins/asyncs/backends/trio.py +3 -0
- omlish/testing/pytest/plugins/asyncs/backends/trio_asyncio.py +3 -0
- omlish/testing/pytest/plugins/asyncs/utils.py +3 -0
- omlish/testing/pytest/plugins/depskip.py +3 -0
- omlish/testing/pytest/plugins/logging.py +3 -0
- omlish/testing/pytest/plugins/managermarks.py +3 -0
- omlish/testing/pytest/plugins/pydevd.py +3 -0
- omlish/testing/pytest/plugins/repeat.py +3 -0
- omlish/testing/pytest/plugins/skips.py +3 -0
- omlish/testing/pytest/plugins/spacing.py +3 -0
- omlish/testing/pytest/plugins/utils.py +3 -0
- omlish/text/go/quoting.py +3 -0
- omlish/text/parts.py +1 -1
- omlish/text/templating.py +31 -0
- {omlish-0.0.0.dev362.dist-info → omlish-0.0.0.dev364.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev362.dist-info → omlish-0.0.0.dev364.dist-info}/RECORD +123 -123
- {omlish-0.0.0.dev362.dist-info → omlish-0.0.0.dev364.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev362.dist-info → omlish-0.0.0.dev364.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev362.dist-info → omlish-0.0.0.dev364.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev362.dist-info → omlish-0.0.0.dev364.dist-info}/top_level.txt +0 -0
omlish/.manifests.json
CHANGED
omlish/__about__.py
CHANGED
omlish/algorithm/distribute.py
CHANGED
omlish/algorithm/toposort.py
CHANGED
omlish/algorithm/unify.py
CHANGED
omlish/argparse/cli.py
CHANGED
|
@@ -259,7 +259,7 @@ class ArgparseCli:
|
|
|
259
259
|
|
|
260
260
|
if self._unknown_args and not (cmd is not None and cmd.accepts_unknown):
|
|
261
261
|
msg = f'unrecognized arguments: {" ".join(self._unknown_args)}'
|
|
262
|
-
if (parser := self.get_parser()).exit_on_error:
|
|
262
|
+
if (parser := self.get_parser()).exit_on_error:
|
|
263
263
|
parser.error(msg)
|
|
264
264
|
else:
|
|
265
265
|
raise argparse.ArgumentError(None, msg)
|
omlish/asyncs/utils.py
CHANGED
|
@@ -9,7 +9,7 @@ T = ta.TypeVar('T')
|
|
|
9
9
|
##
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
async def call_with_async_exit_stack(
|
|
12
|
+
async def call_with_async_exit_stack(
|
|
13
13
|
fn: ta.Callable[ta.Concatenate[contextlib.AsyncExitStack, P], ta.Awaitable[T]],
|
|
14
14
|
*args: ta.Any,
|
|
15
15
|
**kwargs: ta.Any,
|
omlish/codecs/base.py
CHANGED
|
@@ -72,7 +72,7 @@ class Codec:
|
|
|
72
72
|
name: str = dc.xfield(coerce=check_codec_name)
|
|
73
73
|
aliases: ta.Collection[str] | None = dc.xfield(
|
|
74
74
|
default=None,
|
|
75
|
-
coerce=lang.opt_fn(lambda s: [check_codec_name(a) for a in s]),
|
|
75
|
+
coerce=lang.opt_fn(lambda s: [check_codec_name(a) for a in s]),
|
|
76
76
|
)
|
|
77
77
|
|
|
78
78
|
input: rfl.Type = dc.xfield(coerce=rfl.type_)
|
omlish/codecs/chain.py
CHANGED
omlish/codecs/funcs.py
CHANGED
omlish/concurrent/executors.py
CHANGED
omlish/configs/nginx.py
CHANGED
omlish/configs/types.py
CHANGED
omlish/daemons/reparent.py
CHANGED
omlish/daemons/services.py
CHANGED
|
@@ -108,7 +108,7 @@ class ServiceDaemon(lang.Final, ta.Generic[ServiceT, ServiceConfigT]):
|
|
|
108
108
|
def service_(self) -> ServiceT:
|
|
109
109
|
with self._lock:
|
|
110
110
|
if isinstance(self.service, Service):
|
|
111
|
-
return self.service
|
|
111
|
+
return self.service
|
|
112
112
|
elif isinstance(self.service, Service.Config):
|
|
113
113
|
return Service.from_config(self.service) # type: ignore[return-value]
|
|
114
114
|
else:
|
omlish/datetimes.py
CHANGED
|
@@ -68,7 +68,8 @@ def parse_timedelta(s: str) -> datetime.timedelta:
|
|
|
68
68
|
timedelta_kwargs = {
|
|
69
69
|
k: float(v)
|
|
70
70
|
for k, v in match.groupdict().items()
|
|
71
|
-
if k != 'negative' and v is not None
|
|
71
|
+
if k != 'negative' and v is not None
|
|
72
|
+
}
|
|
72
73
|
if not timedelta_kwargs:
|
|
73
74
|
raise ValueError
|
|
74
75
|
sign = -1 if match.groupdict().get('negative') else 1
|
omlish/diag/pydevd.py
CHANGED
omlish/diag/replserver/server.py
CHANGED
omlish/docker/cli.py
CHANGED
omlish/docker/compose.py
CHANGED
omlish/docker/manifests.py
CHANGED
omlish/formats/json/literals.py
CHANGED
omlish/formats/json5/__init__.py
CHANGED
omlish/formats/json5/codec.py
CHANGED
|
@@ -42,10 +42,29 @@ def dumps_compact(obj: ta.Any, **kwargs: ta.Any) -> str:
|
|
|
42
42
|
return dumps(obj, **json.COMPACT_KWARGS, **kwargs)
|
|
43
43
|
|
|
44
44
|
|
|
45
|
+
def dump(obj: ta.Any, fp: ta.Any, **kwargs: ta.Any) -> None:
|
|
46
|
+
fp.write(dumps(obj, **kwargs))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def dump_pretty(obj: ta.Any, fp: ta.Any, **kwargs: ta.Any) -> None:
|
|
50
|
+
fp.write(dumps_pretty(obj, **kwargs))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def dump_compact(obj: ta.Any, fp: ta.Any, **kwargs: ta.Any) -> None:
|
|
54
|
+
fp.write(dumps_compact(obj, **kwargs))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
#
|
|
58
|
+
|
|
59
|
+
|
|
45
60
|
def loads(s: str, **kwargs: ta.Any) -> ta.Any:
|
|
46
61
|
return parsing.parse(s, **kwargs)
|
|
47
62
|
|
|
48
63
|
|
|
64
|
+
def load(fp: ta.Any, **kwargs: ta.Any) -> ta.Any:
|
|
65
|
+
return loads(fp.read(), **kwargs)
|
|
66
|
+
|
|
67
|
+
|
|
49
68
|
##
|
|
50
69
|
|
|
51
70
|
|
omlish/formats/props.py
CHANGED
omlish/formats/toml/writer.py
CHANGED
omlish/funcs/match.py
CHANGED
|
@@ -143,6 +143,7 @@ class CachedMatchFn(MatchFn[P, T]):
|
|
|
143
143
|
lock: lang.DefaultLockable = None,
|
|
144
144
|
) -> None:
|
|
145
145
|
super().__init__()
|
|
146
|
+
|
|
146
147
|
self._f = f
|
|
147
148
|
self._key = key
|
|
148
149
|
self._lock = lock
|
|
@@ -206,8 +207,10 @@ class MatchFnClass(MatchFn[P, T]):
|
|
|
206
207
|
|
|
207
208
|
def __init_subclass__(cls, strict: bool = False, **kwargs: ta.Any) -> None:
|
|
208
209
|
super().__init_subclass__()
|
|
210
|
+
|
|
209
211
|
if '_cls_match_fn' in cls.__dict__:
|
|
210
212
|
raise AttributeError('_cls_match_fn')
|
|
213
|
+
|
|
211
214
|
d = {}
|
|
212
215
|
for c in cls.__mro__:
|
|
213
216
|
for a, o in c.__dict__.items():
|
omlish/graphs/trees.py
CHANGED
|
@@ -62,7 +62,7 @@ class BasicTreeAnalysis(ta.Generic[NodeT]):
|
|
|
62
62
|
|
|
63
63
|
self._set_fac: ta.Callable[..., ta.MutableSet[NodeT]] = col.IdentitySet if identity else set
|
|
64
64
|
self._dict_fac: ta.Callable[..., ta.MutableMapping[NodeT, ta.Any]] = col.IdentityKeyDict if identity else dict
|
|
65
|
-
self._rank_seq_fac: ta.Callable[..., col.RankedSeq[NodeT]] = functools.partial(col.RankedSeq, identity=identity)
|
|
65
|
+
self._rank_seq_fac: ta.Callable[..., col.RankedSeq[NodeT]] = functools.partial(col.RankedSeq, identity=identity)
|
|
66
66
|
|
|
67
67
|
def walk(cur: NodeT, parent: NodeT | None) -> None:
|
|
68
68
|
check.not_none(cur)
|
omlish/http/clients/base.py
CHANGED
|
@@ -116,12 +116,12 @@ def close_response(resp: BaseHttpResponse) -> None:
|
|
|
116
116
|
@contextlib.contextmanager
|
|
117
117
|
def closing_response(resp: BaseHttpResponseT) -> ta.Iterator[BaseHttpResponseT]:
|
|
118
118
|
if isinstance(resp, HttpResponse):
|
|
119
|
-
yield resp
|
|
119
|
+
yield resp
|
|
120
120
|
return
|
|
121
121
|
|
|
122
122
|
elif isinstance(resp, StreamHttpResponse):
|
|
123
123
|
with contextlib.closing(resp):
|
|
124
|
-
yield resp
|
|
124
|
+
yield resp
|
|
125
125
|
|
|
126
126
|
else:
|
|
127
127
|
raise TypeError(resp)
|
omlish/http/coro/fdio.py
CHANGED
omlish/http/coro/simple.py
CHANGED
omlish/http/dates.py
CHANGED
omlish/http/multipart.py
CHANGED
omlish/http/versions.py
CHANGED
omlish/inject/multis.py
CHANGED
|
@@ -87,7 +87,7 @@ class SetBinder(ElementGenerator, ta.Generic[T]):
|
|
|
87
87
|
if not isinstance(self, SetBinder):
|
|
88
88
|
raise TypeError
|
|
89
89
|
self._sbs.extend(SetBinding(self._multi_key, as_key(k)) for k in keys)
|
|
90
|
-
return self
|
|
90
|
+
return self
|
|
91
91
|
|
|
92
92
|
def __iter__(self) -> ta.Iterator[Element]:
|
|
93
93
|
yield self._set_provider_binding
|
|
@@ -115,7 +115,7 @@ class MapBinder(ElementGenerator, ta.Generic[K, V]):
|
|
|
115
115
|
if not isinstance(self, MapBinder):
|
|
116
116
|
raise TypeError
|
|
117
117
|
self._mbs.append(MapBinding(self._multi_key, map_key, as_key(map_value_key)))
|
|
118
|
-
return self
|
|
118
|
+
return self
|
|
119
119
|
|
|
120
120
|
def __iter__(self) -> ta.Iterator[Element]:
|
|
121
121
|
yield self._map_provider_binding
|
omlish/io/compress/base.py
CHANGED
omlish/io/coro/readers.py
CHANGED
omlish/io/fileno.py
CHANGED
omlish/io/pyio.py
CHANGED
omlish/lang/__init__.py
CHANGED
omlish/lang/classes/abstract.py
CHANGED
|
@@ -19,7 +19,7 @@ _INTERNAL_ABSTRACT_ATTRS = frozenset([_FORCE_ABSTRACT_ATTR])
|
|
|
19
19
|
|
|
20
20
|
def make_abstract(obj: T) -> T:
|
|
21
21
|
if callable(obj):
|
|
22
|
-
return
|
|
22
|
+
return abc.abstractmethod(obj)
|
|
23
23
|
elif isinstance(obj, property):
|
|
24
24
|
return ta.cast(T, property(
|
|
25
25
|
abc.abstractmethod(obj.fget) if obj.fget is not None else None,
|
omlish/lang/contextmanagers.py
CHANGED
omlish/lang/strings.py
CHANGED
|
@@ -216,7 +216,7 @@ STRING_BOOL_VALUES: ta.Mapping[str, bool] = {
|
|
|
216
216
|
##
|
|
217
217
|
|
|
218
218
|
|
|
219
|
-
def
|
|
219
|
+
def iter_pat(pat: re.Pattern[str], s: str, **kwargs: ta.Any) -> ta.Generator[str | re.Match]:
|
|
220
220
|
p = 0
|
|
221
221
|
for m in re.finditer(pat, s, **kwargs):
|
|
222
222
|
if p < (l := m.start()):
|
omlish/lifecycles/abstract.py
CHANGED
|
@@ -9,6 +9,9 @@ from .base import Lifecycle
|
|
|
9
9
|
AbstractLifecycleT = ta.TypeVar('AbstractLifecycleT', bound='AbstractLifecycle')
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
##
|
|
13
|
+
|
|
14
|
+
|
|
12
15
|
class AbstractLifecycle(lang.Abstract):
|
|
13
16
|
@dc.dataclass(frozen=True)
|
|
14
17
|
class _Lifecycle(Lifecycle, lang.Final, ta.Generic[AbstractLifecycleT]):
|
omlish/lifecycles/base.py
CHANGED
|
@@ -14,6 +14,9 @@ LifecycleT = ta.TypeVar('LifecycleT', bound='Lifecycle')
|
|
|
14
14
|
ContextManagerT = ta.TypeVar('ContextManagerT', bound=ta.ContextManager)
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
##
|
|
18
|
+
|
|
19
|
+
|
|
17
20
|
@dc.dataclass(frozen=True)
|
|
18
21
|
class ContextManagerLifecycle(Lifecycle, lang.Final, ta.Generic[ContextManagerT]):
|
|
19
22
|
cm: ContextManagerT
|
omlish/lifecycles/controller.py
CHANGED
omlish/lifecycles/manager.py
CHANGED
omlish/lifecycles/states.py
CHANGED
omlish/lifecycles/transitions.py
CHANGED
omlish/lite/check.py
CHANGED