omlish 0.0.0.dev419__py3-none-any.whl → 0.0.0.dev421__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.
- omlish/__about__.py +2 -2
- omlish/asyncs/bluelet/core.py +2 -2
- omlish/asyncs/bluelet/events.py +4 -3
- omlish/asyncs/bluelet/files.py +2 -2
- omlish/asyncs/bluelet/sockets.py +2 -2
- omlish/collections/frozen.py +1 -1
- omlish/collections/kv/base.py +1 -1
- omlish/collections/multimaps.py +1 -1
- omlish/collections/persistent/treapmap.py +2 -1
- omlish/concurrent/threadlets.py +2 -2
- omlish/configs/all.py +39 -32
- omlish/configs/formats.py +5 -4
- omlish/configs/processing/all.py +32 -26
- omlish/configs/processing/flattening.py +2 -1
- omlish/configs/processing/rewriting.py +2 -2
- omlish/configs/shadow.py +3 -2
- omlish/daemons/spawning.py +2 -2
- omlish/daemons/targets.py +1 -1
- omlish/daemons/waiting.py +2 -1
- omlish/dataclasses/impl/generation/base.py +3 -2
- omlish/dataclasses/impl/generation/compilation.py +2 -1
- omlish/dataclasses/impl/generation/ops.py +2 -2
- omlish/dataclasses/impl/generation/processor.py +1 -1
- omlish/dataclasses/metaclass/meta.py +1 -0
- omlish/dataclasses/tools/static.py +5 -1
- omlish/formats/dotenv.py +3 -1
- omlish/formats/json/backends/default.py +14 -7
- omlish/formats/logfmt.py +111 -0
- omlish/formats/yaml.py +1 -1
- omlish/funcs/builders.py +2 -1
- omlish/funcs/match.py +1 -1
- omlish/funcs/pairs.py +41 -23
- omlish/funcs/pipes.py +3 -1
- omlish/http/asgi.py +2 -1
- omlish/http/coro/client/io.py +3 -2
- omlish/http/coro/server/server.py +2 -2
- omlish/http/handlers.py +2 -1
- omlish/http/jwt.py +1 -1
- omlish/http/parsing.py +2 -2
- omlish/io/compress/base.py +3 -2
- omlish/io/coro/readers.py +4 -3
- omlish/io/fdio/handlers.py +3 -2
- omlish/io/fdio/pollers.py +3 -1
- omlish/lang/__init__.py +20 -8
- omlish/lang/attrs.py +3 -1
- omlish/lang/casing.py +3 -1
- omlish/lang/classes/abstract.py +35 -96
- omlish/lang/classes/virtual.py +2 -2
- omlish/lang/contextmanagers.py +6 -4
- omlish/lang/generators.py +2 -2
- omlish/lang/iterables.py +6 -6
- omlish/lang/objects.py +0 -58
- omlish/lang/outcomes.py +3 -1
- omlish/lang/typing.py +5 -24
- omlish/lite/abstract.py +119 -0
- omlish/lite/contextmanagers.py +4 -1
- omlish/lite/inject.py +9 -9
- omlish/lite/marshal.py +230 -114
- omlish/lite/maybes.py +3 -1
- omlish/lite/maysync.py +4 -2
- omlish/lite/objects.py +81 -0
- omlish/lite/reflect.py +0 -15
- omlish/lite/timeouts.py +3 -1
- omlish/lite/wrappers.py +23 -0
- omlish/logs/abc.py +21 -5
- omlish/logs/all.py +56 -38
- omlish/logs/configs.py +13 -10
- omlish/logs/levels.py +4 -0
- omlish/logs/protocol.py +77 -39
- omlish/marshal/__init__.py +1 -0
- omlish/os/atomics.py +3 -2
- omlish/os/deathpacts/base.py +4 -2
- omlish/os/forkhooks.py +2 -2
- omlish/os/pidfiles/pinning.py +2 -1
- omlish/reflect/types.py +4 -3
- omlish/secrets/crypto.py +1 -1
- omlish/sockets/bind.py +2 -1
- omlish/sockets/handlers.py +3 -2
- omlish/sockets/server/handlers.py +2 -1
- omlish/sockets/server/server.py +4 -3
- omlish/sql/api/base.py +2 -2
- omlish/subprocesses/asyncs.py +2 -1
- omlish/subprocesses/base.py +2 -2
- omlish/subprocesses/maysync.py +1 -2
- omlish/subprocesses/run.py +2 -1
- omlish/subprocesses/sync.py +2 -1
- omlish/term/coloring.py +3 -1
- omlish/testing/pytest/plugins/asyncs/backends/base.py +3 -1
- omlish/testing/unittest/loading.py +2 -2
- omlish/text/asdl.py +4 -3
- {omlish-0.0.0.dev419.dist-info → omlish-0.0.0.dev421.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev419.dist-info → omlish-0.0.0.dev421.dist-info}/RECORD +96 -91
- {omlish-0.0.0.dev419.dist-info → omlish-0.0.0.dev421.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev419.dist-info → omlish-0.0.0.dev421.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev419.dist-info → omlish-0.0.0.dev421.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev419.dist-info → omlish-0.0.0.dev421.dist-info}/top_level.txt +0 -0
omlish/sockets/server/server.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# @omlish-lite
|
2
1
|
# ruff: noqa: UP006 UP007 UP045
|
2
|
+
# @omlish-lite
|
3
3
|
import abc
|
4
4
|
import contextlib
|
5
5
|
import enum
|
@@ -8,6 +8,7 @@ import selectors
|
|
8
8
|
import threading
|
9
9
|
import typing as ta
|
10
10
|
|
11
|
+
from ...lite.abstract import Abstract
|
11
12
|
from ...lite.contextmanagers import ExitStacked
|
12
13
|
from ...lite.contextmanagers import defer
|
13
14
|
from ..addresses import SocketAndAddress
|
@@ -19,7 +20,7 @@ from .handlers import SocketServerHandler
|
|
19
20
|
##
|
20
21
|
|
21
22
|
|
22
|
-
class SocketServer(
|
23
|
+
class SocketServer(Abstract):
|
23
24
|
_DEFAULT_LOGGER = logging.getLogger('.'.join([__name__, 'SocketServer']))
|
24
25
|
|
25
26
|
def __init__(
|
@@ -85,7 +86,7 @@ class SocketServer(abc.ABC):
|
|
85
86
|
ERROR = enum.auto()
|
86
87
|
SHUTDOWN = enum.auto()
|
87
88
|
|
88
|
-
class PollContext(ExitStacked,
|
89
|
+
class PollContext(ExitStacked, Abstract):
|
89
90
|
@abc.abstractmethod
|
90
91
|
def poll(self, timeout: ta.Optional[float] = None) -> 'SocketServer.PollResult':
|
91
92
|
raise NotImplementedError
|
omlish/sql/api/base.py
CHANGED
@@ -48,14 +48,14 @@ class Rows(ContextCloser, ta.Iterator[Row], lang.Abstract):
|
|
48
48
|
##
|
49
49
|
|
50
50
|
|
51
|
-
class Conn(Querier, lang.Abstract):
|
51
|
+
class Conn(Querier, lang.Abstract):
|
52
52
|
pass
|
53
53
|
|
54
54
|
|
55
55
|
##
|
56
56
|
|
57
57
|
|
58
|
-
class Db(Querier, lang.Abstract):
|
58
|
+
class Db(Querier, lang.Abstract):
|
59
59
|
@abc.abstractmethod
|
60
60
|
def connect(self) -> Conn:
|
61
61
|
raise NotImplementedError
|
omlish/subprocesses/asyncs.py
CHANGED
@@ -5,6 +5,7 @@ import subprocess
|
|
5
5
|
import sys
|
6
6
|
import typing as ta
|
7
7
|
|
8
|
+
from ..lite.abstract import Abstract
|
8
9
|
from ..lite.check import check
|
9
10
|
from ..lite.timeouts import TimeoutLike
|
10
11
|
from .base import BaseSubprocesses
|
@@ -15,7 +16,7 @@ from .run import SubprocessRunOutput
|
|
15
16
|
##
|
16
17
|
|
17
18
|
|
18
|
-
class AbstractAsyncSubprocesses(BaseSubprocesses):
|
19
|
+
class AbstractAsyncSubprocesses(BaseSubprocesses, Abstract):
|
19
20
|
@abc.abstractmethod
|
20
21
|
def run_(self, run: SubprocessRun) -> ta.Awaitable[SubprocessRunOutput]:
|
21
22
|
raise NotImplementedError
|
omlish/subprocesses/base.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# ruff: noqa: UP006 UP007 UP045
|
2
2
|
# @omlish-lite
|
3
|
-
import abc
|
4
3
|
import contextlib
|
5
4
|
import logging
|
6
5
|
import os
|
@@ -8,6 +7,7 @@ import subprocess
|
|
8
7
|
import time
|
9
8
|
import typing as ta
|
10
9
|
|
10
|
+
from ..lite.abstract import Abstract
|
11
11
|
from ..lite.timeouts import Timeout
|
12
12
|
from .wrap import subprocess_maybe_shell_wrap_exec
|
13
13
|
|
@@ -54,7 +54,7 @@ class VerboseCalledProcessError(subprocess.CalledProcessError):
|
|
54
54
|
return msg
|
55
55
|
|
56
56
|
|
57
|
-
class BaseSubprocesses(
|
57
|
+
class BaseSubprocesses(Abstract):
|
58
58
|
DEFAULT_LOGGER: ta.ClassVar[ta.Optional[logging.Logger]] = None
|
59
59
|
|
60
60
|
def __init__(
|
omlish/subprocesses/maysync.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# ruff: noqa: UP006 UP007 UP045
|
2
2
|
# @omlish-lite
|
3
|
-
import abc
|
4
3
|
import sys
|
5
4
|
import typing as ta
|
6
5
|
|
@@ -14,7 +13,7 @@ from .sync import AbstractSubprocesses
|
|
14
13
|
##
|
15
14
|
|
16
15
|
|
17
|
-
class MaysyncSubprocesses(AbstractAsyncSubprocesses
|
16
|
+
class MaysyncSubprocesses(AbstractAsyncSubprocesses):
|
18
17
|
def __init__(
|
19
18
|
self,
|
20
19
|
subprocesses: AbstractSubprocesses,
|
omlish/subprocesses/run.py
CHANGED
@@ -4,6 +4,7 @@ import abc
|
|
4
4
|
import dataclasses as dc
|
5
5
|
import typing as ta
|
6
6
|
|
7
|
+
from ..lite.abstract import Abstract
|
7
8
|
from ..lite.check import check
|
8
9
|
from ..lite.timeouts import TimeoutLike
|
9
10
|
|
@@ -123,7 +124,7 @@ SubprocessRun._FIELD_NAMES = frozenset(fld.name for fld in dc.fields(SubprocessR
|
|
123
124
|
##
|
124
125
|
|
125
126
|
|
126
|
-
class SubprocessRunnable(
|
127
|
+
class SubprocessRunnable(Abstract, ta.Generic[T]):
|
127
128
|
@abc.abstractmethod
|
128
129
|
def make_run(self) -> SubprocessRun:
|
129
130
|
raise NotImplementedError
|
omlish/subprocesses/sync.py
CHANGED
@@ -10,6 +10,7 @@ import subprocess
|
|
10
10
|
import sys
|
11
11
|
import typing as ta
|
12
12
|
|
13
|
+
from ..lite.abstract import Abstract
|
13
14
|
from ..lite.timeouts import TimeoutLike
|
14
15
|
from .base import BaseSubprocesses
|
15
16
|
from .run import SubprocessRun
|
@@ -19,7 +20,7 @@ from .run import SubprocessRunOutput
|
|
19
20
|
##
|
20
21
|
|
21
22
|
|
22
|
-
class AbstractSubprocesses(BaseSubprocesses,
|
23
|
+
class AbstractSubprocesses(BaseSubprocesses, Abstract):
|
23
24
|
@abc.abstractmethod
|
24
25
|
def run_(self, run: SubprocessRun) -> SubprocessRunOutput:
|
25
26
|
raise NotImplementedError
|
omlish/term/coloring.py
CHANGED
@@ -4,6 +4,8 @@ import enum
|
|
4
4
|
import os
|
5
5
|
import typing as ta
|
6
6
|
|
7
|
+
from ..lite.abstract import Abstract
|
8
|
+
|
7
9
|
|
8
10
|
##
|
9
11
|
|
@@ -15,7 +17,7 @@ class TermColor(enum.Enum):
|
|
15
17
|
BLUE = enum.auto()
|
16
18
|
|
17
19
|
|
18
|
-
class TermColoring(
|
20
|
+
class TermColoring(Abstract):
|
19
21
|
@abc.abstractmethod
|
20
22
|
def color(self, c: TermColor, s: str) -> str:
|
21
23
|
raise NotImplementedError
|
@@ -37,12 +37,12 @@ https://docs.python.org/3/library/unittest.html#command-line-interface
|
|
37
37
|
#
|
38
38
|
# 8. By copying, installing or otherwise using Python, Licensee agrees to be bound by the terms and conditions of this
|
39
39
|
# License Agreement.
|
40
|
-
import abc
|
41
40
|
import dataclasses as dc
|
42
41
|
import types
|
43
42
|
import typing as ta
|
44
43
|
import unittest
|
45
44
|
|
45
|
+
from ...lite.abstract import Abstract
|
46
46
|
from .types import UnittestTest
|
47
47
|
|
48
48
|
|
@@ -65,7 +65,7 @@ class UnittestTargetLoader:
|
|
65
65
|
|
66
66
|
#
|
67
67
|
|
68
|
-
class Target(
|
68
|
+
class Target(Abstract):
|
69
69
|
pass
|
70
70
|
|
71
71
|
class ModuleTarget(Target):
|
omlish/text/asdl.py
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# ruff: noqa: N802
|
1
2
|
"""
|
2
3
|
https://github.com/python/cpython/blob/21d2a9ab2f4dcbf1be462d3b7f7a231a46bc1cb7/Parser/asdl.py
|
3
4
|
|
@@ -54,7 +55,6 @@ constructor ::= ConstructorId [fields]
|
|
54
55
|
#
|
55
56
|
# 8. By copying, installing or otherwise using Python, Licensee agrees to be bound by the terms and conditions of this
|
56
57
|
# License Agreement.
|
57
|
-
# ruff: noqa: N802
|
58
58
|
import abc
|
59
59
|
import dataclasses as dc
|
60
60
|
import enum
|
@@ -63,6 +63,7 @@ import typing as ta
|
|
63
63
|
|
64
64
|
from .. import cached
|
65
65
|
from .. import check
|
66
|
+
from .. import lang
|
66
67
|
|
67
68
|
|
68
69
|
##
|
@@ -73,7 +74,7 @@ from .. import check
|
|
73
74
|
# parsed. This module parses Asdl files and uses a simple AST to represent them. See the EBNF at the top of the file to
|
74
75
|
# understand the logical connection between the various node types.
|
75
76
|
|
76
|
-
class Ast(
|
77
|
+
class Ast(lang.Abstract):
|
77
78
|
@abc.abstractmethod
|
78
79
|
def __repr__(self) -> str:
|
79
80
|
raise NotImplementedError
|
@@ -434,7 +435,7 @@ class FlatField:
|
|
434
435
|
|
435
436
|
|
436
437
|
@dc.dataclass(frozen=True)
|
437
|
-
class FlatNode(
|
438
|
+
class FlatNode(lang.Abstract):
|
438
439
|
name: str
|
439
440
|
fields: ta.Sequence[FlatField] = dc.field(default=(), kw_only=True)
|
440
441
|
attributes: ta.Sequence[FlatField] = dc.field(default=(), kw_only=True)
|