omlish 0.0.0.dev412__py3-none-any.whl → 0.0.0.dev414__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 +3 -3
- omlish/asyncs/bridge.py +1 -1
- omlish/lang/__init__.py +19 -10
- omlish/lang/asyncs.py +7 -14
- omlish/lang/descriptors.py +14 -0
- omlish/lang/maysyncs.py +40 -43
- omlish/lite/maysyncs.py +302 -504
- omlish/subprocesses/maysyncs.py +8 -103
- {omlish-0.0.0.dev412.dist-info → omlish-0.0.0.dev414.dist-info}/METADATA +3 -3
- {omlish-0.0.0.dev412.dist-info → omlish-0.0.0.dev414.dist-info}/RECORD +14 -14
- {omlish-0.0.0.dev412.dist-info → omlish-0.0.0.dev414.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev412.dist-info → omlish-0.0.0.dev414.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev412.dist-info → omlish-0.0.0.dev414.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev412.dist-info → omlish-0.0.0.dev414.dist-info}/top_level.txt +0 -0
omlish/subprocesses/maysyncs.py
CHANGED
@@ -4,12 +4,8 @@ import abc
|
|
4
4
|
import sys
|
5
5
|
import typing as ta
|
6
6
|
|
7
|
-
from ..lite.maysyncs import Maywaitable
|
8
7
|
from ..lite.maysyncs import make_maysync
|
9
|
-
from ..lite.maysyncs import maysync
|
10
|
-
from ..lite.timeouts import TimeoutLike
|
11
8
|
from .asyncs import AbstractAsyncSubprocesses
|
12
|
-
from .base import BaseSubprocesses
|
13
9
|
from .run import SubprocessRun
|
14
10
|
from .run import SubprocessRunOutput
|
15
11
|
from .sync import AbstractSubprocesses
|
@@ -18,98 +14,7 @@ from .sync import AbstractSubprocesses
|
|
18
14
|
##
|
19
15
|
|
20
16
|
|
21
|
-
class
|
22
|
-
@abc.abstractmethod
|
23
|
-
def run_(self, run: SubprocessRun) -> Maywaitable[SubprocessRunOutput]:
|
24
|
-
raise NotImplementedError
|
25
|
-
|
26
|
-
def run(
|
27
|
-
self,
|
28
|
-
*cmd: str,
|
29
|
-
input: ta.Any = None, # noqa
|
30
|
-
timeout: TimeoutLike = None,
|
31
|
-
check: bool = False,
|
32
|
-
capture_output: ta.Optional[bool] = None,
|
33
|
-
**kwargs: ta.Any,
|
34
|
-
) -> Maywaitable[SubprocessRunOutput]:
|
35
|
-
return self.run_(SubprocessRun(
|
36
|
-
cmd=cmd,
|
37
|
-
input=input,
|
38
|
-
timeout=timeout,
|
39
|
-
check=check,
|
40
|
-
capture_output=capture_output,
|
41
|
-
kwargs=kwargs,
|
42
|
-
))
|
43
|
-
|
44
|
-
#
|
45
|
-
|
46
|
-
@abc.abstractmethod
|
47
|
-
def check_call(
|
48
|
-
self,
|
49
|
-
*cmd: str,
|
50
|
-
stdout: ta.Any = sys.stderr,
|
51
|
-
**kwargs: ta.Any,
|
52
|
-
) -> Maywaitable[None]:
|
53
|
-
raise NotImplementedError
|
54
|
-
|
55
|
-
@abc.abstractmethod
|
56
|
-
def check_output(
|
57
|
-
self,
|
58
|
-
*cmd: str,
|
59
|
-
**kwargs: ta.Any,
|
60
|
-
) -> Maywaitable[bytes]:
|
61
|
-
raise NotImplementedError
|
62
|
-
|
63
|
-
#
|
64
|
-
|
65
|
-
@maysync
|
66
|
-
async def check_output_str(
|
67
|
-
self,
|
68
|
-
*cmd: str,
|
69
|
-
**kwargs: ta.Any,
|
70
|
-
) -> str:
|
71
|
-
return (await self.check_output(*cmd, **kwargs).a()).decode().strip()
|
72
|
-
|
73
|
-
#
|
74
|
-
|
75
|
-
@maysync
|
76
|
-
async def try_call(
|
77
|
-
self,
|
78
|
-
*cmd: str,
|
79
|
-
**kwargs: ta.Any,
|
80
|
-
) -> bool:
|
81
|
-
if isinstance(await self.async_try_fn(self.check_call(*cmd, **kwargs).a), Exception):
|
82
|
-
return False
|
83
|
-
else:
|
84
|
-
return True
|
85
|
-
|
86
|
-
@maysync
|
87
|
-
async def try_output(
|
88
|
-
self,
|
89
|
-
*cmd: str,
|
90
|
-
**kwargs: ta.Any,
|
91
|
-
) -> ta.Optional[bytes]:
|
92
|
-
if isinstance(ret := await self.async_try_fn(self.check_output(*cmd, **kwargs).a), Exception):
|
93
|
-
return None
|
94
|
-
else:
|
95
|
-
return ret
|
96
|
-
|
97
|
-
@maysync
|
98
|
-
async def try_output_str(
|
99
|
-
self,
|
100
|
-
*cmd: str,
|
101
|
-
**kwargs: ta.Any,
|
102
|
-
) -> ta.Optional[str]:
|
103
|
-
if (ret := await self.try_output(*cmd, **kwargs).a()) is None:
|
104
|
-
return None
|
105
|
-
else:
|
106
|
-
return ret.decode().strip()
|
107
|
-
|
108
|
-
|
109
|
-
##
|
110
|
-
|
111
|
-
|
112
|
-
class MaysyncSubprocesses(AbstractMaysyncSubprocesses):
|
17
|
+
class MaysyncSubprocesses(AbstractAsyncSubprocesses, abc.ABC):
|
113
18
|
def __init__(
|
114
19
|
self,
|
115
20
|
subprocesses: AbstractSubprocesses,
|
@@ -122,7 +27,7 @@ class MaysyncSubprocesses(AbstractMaysyncSubprocesses):
|
|
122
27
|
|
123
28
|
#
|
124
29
|
|
125
|
-
def run_(self, run: SubprocessRun) ->
|
30
|
+
def run_(self, run: SubprocessRun) -> ta.Awaitable[SubprocessRunOutput]:
|
126
31
|
return make_maysync(
|
127
32
|
self._subprocesses.run,
|
128
33
|
self._async_subprocesses.run,
|
@@ -130,23 +35,23 @@ class MaysyncSubprocesses(AbstractMaysyncSubprocesses):
|
|
130
35
|
|
131
36
|
#
|
132
37
|
|
133
|
-
def check_call(
|
38
|
+
async def check_call(
|
134
39
|
self,
|
135
40
|
*cmd: str,
|
136
41
|
stdout: ta.Any = sys.stderr,
|
137
42
|
**kwargs: ta.Any,
|
138
|
-
) ->
|
139
|
-
return make_maysync(
|
43
|
+
) -> None:
|
44
|
+
return await make_maysync(
|
140
45
|
self._subprocesses.check_call,
|
141
46
|
self._async_subprocesses.check_call,
|
142
47
|
)(*cmd, stdout=stdout, **kwargs)
|
143
48
|
|
144
|
-
def check_output(
|
49
|
+
async def check_output(
|
145
50
|
self,
|
146
51
|
*cmd: str,
|
147
52
|
**kwargs: ta.Any,
|
148
|
-
) ->
|
149
|
-
return make_maysync(
|
53
|
+
) -> bytes:
|
54
|
+
return await make_maysync(
|
150
55
|
self._subprocesses.check_output,
|
151
56
|
self._async_subprocesses.check_output,
|
152
57
|
)(*cmd, **kwargs)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: omlish
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev414
|
4
4
|
Summary: omlish
|
5
5
|
Author: wrmsr
|
6
6
|
License-Expression: BSD-3-Clause
|
@@ -42,7 +42,7 @@ Requires-Dist: aiomysql~=0.2; extra == "all"
|
|
42
42
|
Requires-Dist: aiosqlite~=0.21; extra == "all"
|
43
43
|
Requires-Dist: asyncpg~=0.30; extra == "all"
|
44
44
|
Requires-Dist: apsw~=3.50; extra == "all"
|
45
|
-
Requires-Dist: sqlean.py~=3.
|
45
|
+
Requires-Dist: sqlean.py~=3.50; extra == "all"
|
46
46
|
Requires-Dist: duckdb~=1.3; extra == "all"
|
47
47
|
Requires-Dist: markupsafe~=3.0; extra == "all"
|
48
48
|
Requires-Dist: jinja2~=3.1; extra == "all"
|
@@ -90,7 +90,7 @@ Requires-Dist: aiomysql~=0.2; extra == "sqldrivers"
|
|
90
90
|
Requires-Dist: aiosqlite~=0.21; extra == "sqldrivers"
|
91
91
|
Requires-Dist: asyncpg~=0.30; extra == "sqldrivers"
|
92
92
|
Requires-Dist: apsw~=3.50; extra == "sqldrivers"
|
93
|
-
Requires-Dist: sqlean.py~=3.
|
93
|
+
Requires-Dist: sqlean.py~=3.50; extra == "sqldrivers"
|
94
94
|
Requires-Dist: duckdb~=1.3; extra == "sqldrivers"
|
95
95
|
Provides-Extra: templates
|
96
96
|
Requires-Dist: markupsafe~=3.0; extra == "templates"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
omlish/.manifests.json,sha256=FLw7xkPiSXuImZgqSP8BwrEib2R1doSzUPLUkc-QUIA,8410
|
2
|
-
omlish/__about__.py,sha256=
|
2
|
+
omlish/__about__.py,sha256=5lJafuAwdynN20SptUoGmCSL1duPAhIzl1epOqICNdM,3601
|
3
3
|
omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
|
4
4
|
omlish/c3.py,sha256=rer-TPOFDU6fYq_AWio_AmA-ckZ8JDY5shIzQ_yXfzA,8414
|
5
5
|
omlish/cached.py,sha256=MLap_p0rdGoDIMVhXVHm1tsbcWobJF0OanoodV03Ju8,542
|
@@ -22,7 +22,7 @@ omlish/argparse/all.py,sha256=NeeMM5MIebY7XDAHaCxUzeesEoUYwsf5i9PrBUcO1cI,1057
|
|
22
22
|
omlish/argparse/cli.py,sha256=60cfq_WFLwL3YsIQxGAQ7XDi-LzNjH33RavcKdRnhUU,8737
|
23
23
|
omlish/asyncs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
24
|
omlish/asyncs/all.py,sha256=cS7dTWR8l3vF0oWYYiV9JXp0YGxOecVyCuJ2fydAPU0,526
|
25
|
-
omlish/asyncs/bridge.py,sha256=
|
25
|
+
omlish/asyncs/bridge.py,sha256=BPwEeiv3iG0uMk23PIWFkdGLyiBq_x3qnzheV7ysOqY,10129
|
26
26
|
omlish/asyncs/buffers.py,sha256=_Ds4Aa1bUWQwQTGmcYsKLjcJ_d5HgbSkPTFrG9y-eMQ,1424
|
27
27
|
omlish/asyncs/flavors.py,sha256=1mNxGNRVmjUHzA13K5ht8vdJv4CLEmzYTQ6BZXr1520,4866
|
28
28
|
omlish/asyncs/trio.py,sha256=fmZ5b_lKdVV8NQ3euCUutWgnkqTFzSnOjvJSA_jvmrE,367
|
@@ -425,8 +425,8 @@ omlish/iterators/iterators.py,sha256=RxW35yQ5ed8vBQ22IqpDXFx-i5JiLQdp7-pkMZXhJJ8
|
|
425
425
|
omlish/iterators/recipes.py,sha256=wOwOZg-zWG9Zc3wcAxJFSe2rtavVBYwZOfG09qYEx_4,472
|
426
426
|
omlish/iterators/tools.py,sha256=M16LXrJhMdsz5ea2qH0vws30ZvhQuQSCVFSLpRf_gTg,2096
|
427
427
|
omlish/iterators/unique.py,sha256=BSE-eanva8byFCJi09Nt2zzTsVr8LnTqY1PIInGYRs0,1396
|
428
|
-
omlish/lang/__init__.py,sha256=
|
429
|
-
omlish/lang/asyncs.py,sha256=
|
428
|
+
omlish/lang/__init__.py,sha256=Tsvtn9FC0eNYueMlASmwRK8MQsPTJUxMqWvVh52o5AU,7588
|
429
|
+
omlish/lang/asyncs.py,sha256=SmzkYghQID77vcgm1Evnd3r9_jd5DlfzJ8uQK7nkh0E,1517
|
430
430
|
omlish/lang/attrs.py,sha256=zFiVuGVOq88x45464T_LxDa-ZEq_RD9zJLq2zeVEBDc,5105
|
431
431
|
omlish/lang/casing.py,sha256=cFUlbDdXLhwnWwcYx4qnM5c4zGX7hIRUfcjiZbxUD28,4636
|
432
432
|
omlish/lang/clsdct.py,sha256=HAGIvBSbCefzRjXriwYSBLO7QHKRv2UsE78jixOb-fA,1828
|
@@ -434,14 +434,14 @@ omlish/lang/collections.py,sha256=XI76WcSi4SclWmEGirErg7EzQUfjtmiK2xSK7jJISzY,25
|
|
434
434
|
omlish/lang/comparison.py,sha256=MOwEG0Yny-jBPHO9kQto9FSRyeNpQW24UABsghkrHxY,1356
|
435
435
|
omlish/lang/contextmanagers.py,sha256=S4Dg_XqyP_ObmnEyKIDMVSCgyXV79IrvptZWsYSqFlM,7686
|
436
436
|
omlish/lang/datetimes.py,sha256=01tg21QOx-PWDlm-CSFTalym3vpqF0EKzeinmtcVNoU,379
|
437
|
-
omlish/lang/descriptors.py,sha256=
|
437
|
+
omlish/lang/descriptors.py,sha256=sVJ1Pr4ihp26Tu9UCvDSyfSf-DhBnFGnbpYIFF32c7g,6877
|
438
438
|
omlish/lang/enums.py,sha256=F9tflHfaAoV2MpyuhZzpfX9-H55M3zNa9hCszsngEo8,111
|
439
439
|
omlish/lang/errors.py,sha256=shcS-NCnEUudF8qC_SmO2TQyjivKlS4TDjaz_faqQ0c,44
|
440
440
|
omlish/lang/functions.py,sha256=aLdxhmqG0Pj9tBgsKdoCu_q15r82WIkNqDDSPQU19L8,5689
|
441
441
|
omlish/lang/generators.py,sha256=a4D5HU_mySs2T2z3xCmE_s3t4QJkj0YRrK4-hhpGd0A,5197
|
442
442
|
omlish/lang/iterables.py,sha256=y1SX2Co3VsOeX2wlfFF7K3rwLvF7Dtre7VY6EpfwAwA,3338
|
443
443
|
omlish/lang/lazyglobals.py,sha256=G1hwpyIgM4PUkVJ_St3K-EdQkHQdWpFOcXao6I5LwyY,1435
|
444
|
-
omlish/lang/maysyncs.py,sha256=
|
444
|
+
omlish/lang/maysyncs.py,sha256=S90OrGQ8OShmcg7dt0Tf1GLTGCKwOPO80PRzaZHKsxY,1630
|
445
445
|
omlish/lang/objects.py,sha256=eOhFyFiwvxqpbLs5QTEkXU3rdSt_tQXDgHoWF5SA28E,6119
|
446
446
|
omlish/lang/outcomes.py,sha256=0PqxoKaGbBXU9UYZ6AE2QSq94Z-gFDt6wYdp0KomNQw,8712
|
447
447
|
omlish/lang/overrides.py,sha256=IBzK6ljfLX6TLgIyKTSjhqTLcuKRkQNVtEOnBLS4nuA,2095
|
@@ -490,7 +490,7 @@ omlish/lite/json.py,sha256=m0Ce9eqUZG23-H7-oOp8n1sf4fzno5vtK4AK_4Vc-Mg,706
|
|
490
490
|
omlish/lite/logs.py,sha256=CWFG0NKGhqNeEgryF5atN2gkPYbUdTINEw_s1phbINM,51
|
491
491
|
omlish/lite/marshal.py,sha256=K_wnZwfC8cftGILyE3RlmzQEYuZOfzkMLKey41zuwtM,20296
|
492
492
|
omlish/lite/maybes.py,sha256=0p_fzb6yiOjEpvMKaQ53Q6CH1VPW1or7v7Lt1JIKcgM,4359
|
493
|
-
omlish/lite/maysyncs.py,sha256
|
493
|
+
omlish/lite/maysyncs.py,sha256=-GT3IHaNwiaYNbP7wBB9sLmYPq__udW61SfYlXvG1LQ,14381
|
494
494
|
omlish/lite/pycharm.py,sha256=FRHGcCDo42UzZXqNwW_DkhI-6kb_CmJKPiQ8F6mYkLA,1174
|
495
495
|
omlish/lite/reflect.py,sha256=gI-Qlws9V-jND7kvCQFaIhBFrndVpDsikTQ7C6U2z3w,2434
|
496
496
|
omlish/lite/reprs.py,sha256=2Bc7ukhKvYNTKmxPIuv9glZIph13C37y_W4fg9pBnu8,2006
|
@@ -765,7 +765,7 @@ omlish/subprocesses/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
765
765
|
omlish/subprocesses/asyncs.py,sha256=G9wj275s3r0ueftHFl73Lt4kMRBc2hJOKcoJQCDlBms,2663
|
766
766
|
omlish/subprocesses/base.py,sha256=r60N3ad4ooSvdgFmT94L_xZEy7FMbMX6JcG2VgpHo6w,6139
|
767
767
|
omlish/subprocesses/editor.py,sha256=xBrd7gY0akhRfDIBK5YIBrYMHECtl_8r499iKViyfpQ,2634
|
768
|
-
omlish/subprocesses/maysyncs.py,sha256=
|
768
|
+
omlish/subprocesses/maysyncs.py,sha256=y4q-LnuSYRmiCrncGoa9SwejCSWnq0Cnzzu9qHcq5EE,1445
|
769
769
|
omlish/subprocesses/run.py,sha256=8EeMm2FdNEFmEmbhhzJyHXASUhCCMMRN_-8ybqFhgLI,4378
|
770
770
|
omlish/subprocesses/sync.py,sha256=L-ZNj9RrZd69XjlKrXjt-EJ-XUpQF8E35Mh3b3SI3vc,3671
|
771
771
|
omlish/subprocesses/utils.py,sha256=v5uEzxmbmRvXwOl_0DtBa5Il6yITKYRgmVSGHcLsT4o,402
|
@@ -909,9 +909,9 @@ omlish/typedvalues/marshal.py,sha256=AtBz7Jq-BfW8vwM7HSxSpR85JAXmxK2T0xDblmm1HI0
|
|
909
909
|
omlish/typedvalues/of_.py,sha256=UXkxSj504WI2UrFlqdZJbu2hyDwBhL7XVrc2qdR02GQ,1309
|
910
910
|
omlish/typedvalues/reflect.py,sha256=PAvKW6T4cW7u--iX80w3HWwZUS3SmIZ2_lQjT65uAyk,1026
|
911
911
|
omlish/typedvalues/values.py,sha256=ym46I-q2QJ_6l4UlERqv3yj87R-kp8nCKMRph0xQ3UA,1307
|
912
|
-
omlish-0.0.0.
|
913
|
-
omlish-0.0.0.
|
914
|
-
omlish-0.0.0.
|
915
|
-
omlish-0.0.0.
|
916
|
-
omlish-0.0.0.
|
917
|
-
omlish-0.0.0.
|
912
|
+
omlish-0.0.0.dev414.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
913
|
+
omlish-0.0.0.dev414.dist-info/METADATA,sha256=WyKbSwUeFHk3nrepnSOnkTTwc0AunQSWov7rYWlEjHc,18881
|
914
|
+
omlish-0.0.0.dev414.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
915
|
+
omlish-0.0.0.dev414.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
|
916
|
+
omlish-0.0.0.dev414.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
|
917
|
+
omlish-0.0.0.dev414.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|