omlish 0.0.0.dev259__py3-none-any.whl → 0.0.0.dev260__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 CHANGED
@@ -1,5 +1,5 @@
1
- __version__ = '0.0.0.dev259'
2
- __revision__ = '5fb30c5ff443151db83d45b682f3eaf8d8427cb2'
1
+ __version__ = '0.0.0.dev260'
2
+ __revision__ = 'a6928086771a585741f218a766bca18cea32e734'
3
3
 
4
4
 
5
5
  #
omlish/asyncs/all.py CHANGED
@@ -1,4 +1,4 @@
1
- from .asyncs import ( # noqa
1
+ from .sync import ( # noqa
2
2
  SyncableIterable,
3
3
  async_list,
4
4
  sync_await,
@@ -33,3 +33,7 @@ from .flavors import ( # noqa
33
33
  mark_trio,
34
34
  with_adapter_loop,
35
35
  )
36
+
37
+ from .utils import ( # noqa
38
+ call_with_async_exit_stack,
39
+ )
omlish/asyncs/bridge.py CHANGED
@@ -32,7 +32,7 @@ from .. import check
32
32
  from .. import lang
33
33
  from .. import sync
34
34
  from ..concurrent import threadlets
35
- from .asyncs import sync_await
35
+ from .sync import sync_await
36
36
 
37
37
 
38
38
  if ta.TYPE_CHECKING:
omlish/asyncs/buffers.py CHANGED
@@ -37,6 +37,8 @@ class AsyncBufferedReader:
37
37
  return r
38
38
  o = r
39
39
  b = await self._read()
40
+ if not b:
41
+ raise EOFError
40
42
  self._buf.feed(b)
41
43
 
42
44
  async def read_exact(
@@ -52,4 +54,6 @@ class AsyncBufferedReader:
52
54
  if r is not None:
53
55
  return r
54
56
  b = await self._read()
57
+ if not b:
58
+ raise EOFError
55
59
  self._buf.feed(b)
@@ -16,6 +16,9 @@ import typing as ta
16
16
  T = ta.TypeVar('T')
17
17
 
18
18
 
19
+ ##
20
+
21
+
19
22
  def sync_await(fn: ta.Callable[..., T], *args: ta.Any, **kwargs: ta.Any) -> T:
20
23
  ret = missing = object()
21
24
 
omlish/asyncs/utils.py ADDED
@@ -0,0 +1,18 @@
1
+ import contextlib
2
+ import typing as ta
3
+
4
+
5
+ P = ta.ParamSpec('P')
6
+ T = ta.TypeVar('T')
7
+
8
+
9
+ ##
10
+
11
+
12
+ async def call_with_async_exit_stack( # type: ignore[return] # ???
13
+ fn: ta.Callable[ta.Concatenate[contextlib.AsyncExitStack, P], ta.Awaitable[T]],
14
+ *args: ta.Any,
15
+ **kwargs: ta.Any,
16
+ ) -> T:
17
+ async with contextlib.AsyncExitStack() as aes:
18
+ return await fn(aes, *args, **kwargs)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omlish
3
- Version: 0.0.0.dev259
3
+ Version: 0.0.0.dev260
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -1,5 +1,5 @@
1
1
  omlish/.manifests.json,sha256=x26AIwDzScUvnX-p4xlq6Zc5QYrAo0Vmgf1qHc1KL_M,8253
2
- omlish/__about__.py,sha256=QWfWomoVrAlTxHpzmKS8W74S6KcEi_KRE_xJsJmoxqo,3380
2
+ omlish/__about__.py,sha256=TYkbJu3PdyieNOUbdum9MiWF15ojfJww_QglLmLSmD8,3380
3
3
  omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
4
4
  omlish/c3.py,sha256=ubu7lHwss5V4UznbejAI0qXhXahrU01MysuHOZI9C4U,8116
5
5
  omlish/cached.py,sha256=MLap_p0rdGoDIMVhXVHm1tsbcWobJF0OanoodV03Ju8,542
@@ -90,13 +90,14 @@ omlish/argparse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
90
90
  omlish/argparse/all.py,sha256=NeeMM5MIebY7XDAHaCxUzeesEoUYwsf5i9PrBUcO1cI,1057
91
91
  omlish/argparse/cli.py,sha256=vVLlhJPt0PKaNfIBrXTzz9cHyy2dFEY8hlQ3GvtKbwc,8704
92
92
  omlish/asyncs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
93
- omlish/asyncs/all.py,sha256=uUz9ziKh4_QrgmdhKFMgq6j7mFbiZd3LiogguDCQsGI,587
94
- omlish/asyncs/asyncs.py,sha256=x72xDJenumWV5a_myJOdWlaTdBNZPCwJ_u7_6yhZyBk,2034
95
- omlish/asyncs/bridge.py,sha256=zVAhbFVDvw3qJjcvOKKY2mI8AwrmcmddKsW9KIzPdLI,9740
96
- omlish/asyncs/buffers.py,sha256=xQO6EDdLSus88Lg5Cw2wpZsSLXR1g4GCwc_1K1tSwV0,1312
93
+ omlish/asyncs/all.py,sha256=MjW0P9K8XBrw6AaH2X_qD5Y7hEZOF0cktqFv5BDGH-k,649
94
+ omlish/asyncs/bridge.py,sha256=oFCqwGY9u9JYB-tee7GS0gjtIFp19rdZD2Z0YPRjj9k,9738
95
+ omlish/asyncs/buffers.py,sha256=ip9oDRT-XbBDpeAa72osv-TtZXxdF_ggW4lHkGKxCwE,1418
97
96
  omlish/asyncs/flavors.py,sha256=1mNxGNRVmjUHzA13K5ht8vdJv4CLEmzYTQ6BZXr1520,4866
97
+ omlish/asyncs/sync.py,sha256=qfK8zRMQ0B_huC-6CsMG8vhKB0ktw7Ttq0NnySdWPwQ,2039
98
98
  omlish/asyncs/trio.py,sha256=fmZ5b_lKdVV8NQ3euCUutWgnkqTFzSnOjvJSA_jvmrE,367
99
99
  omlish/asyncs/trio_asyncio.py,sha256=oqdOHy0slj9PjVxaDf3gJkq9AAgg7wYZbB469jOftVw,1327
100
+ omlish/asyncs/utils.py,sha256=1QQMQ1WJBG86QLu4hQZRBFeUg-AypCVhlB8-niHHE4s,400
100
101
  omlish/asyncs/anyio/__init__.py,sha256=AkwRD3XFWmEzBeHV-eAzwpA4F04bl7xyyapigrxMR8g,1747
101
102
  omlish/asyncs/anyio/backends.py,sha256=jJIymWoiedaEJJm82gvKiJ41EWLQZ-bcyNHpbDpKKi4,1584
102
103
  omlish/asyncs/anyio/futures.py,sha256=Nm1gLerZEnHk-rlsmr0UfK168IWIK6zA8EebZFtoY_E,2052
@@ -767,9 +768,9 @@ omlish/text/parts.py,sha256=Q9NvoyEGQKIWgiPD4D_Qc66cWAuyEKE033dT9m7c3Wk,6662
767
768
  omlish/text/random.py,sha256=jNWpqiaKjKyTdMXC-pWAsSC10AAP-cmRRPVhm59ZWLk,194
768
769
  omlish/text/go/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
769
770
  omlish/text/go/quoting.py,sha256=N9EYdnFdEX_A8fOviH-1w4jwV3XOQ7VU2WsoUNubYVY,9137
770
- omlish-0.0.0.dev259.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
771
- omlish-0.0.0.dev259.dist-info/METADATA,sha256=_6IPhJ7Wj-ZeElcErhEi86336VzmKQkKraGj9huqv8s,4198
772
- omlish-0.0.0.dev259.dist-info/WHEEL,sha256=tTnHoFhvKQHCh4jz3yCn0WPTYIy7wXx3CJtJ7SJGV7c,91
773
- omlish-0.0.0.dev259.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
774
- omlish-0.0.0.dev259.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
775
- omlish-0.0.0.dev259.dist-info/RECORD,,
771
+ omlish-0.0.0.dev260.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
772
+ omlish-0.0.0.dev260.dist-info/METADATA,sha256=2zWJ8R0gGrP9bm0OLlyCdul5gKb0ImQJ6zBgB5Tw7x8,4198
773
+ omlish-0.0.0.dev260.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
774
+ omlish-0.0.0.dev260.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
775
+ omlish-0.0.0.dev260.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
776
+ omlish-0.0.0.dev260.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (77.0.1)
2
+ Generator: setuptools (77.0.3)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5