omlish 0.0.0.dev196__py3-none-any.whl → 0.0.0.dev198__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
omlish/__about__.py CHANGED
@@ -1,5 +1,5 @@
1
- __version__ = '0.0.0.dev196'
2
- __revision__ = 'c5eb72314e32c8694da771f815a207214d553c90'
1
+ __version__ = '0.0.0.dev198'
2
+ __revision__ = '83b207af0d6565ce4a694c6219f9c156206d6716'
3
3
 
4
4
 
5
5
  #
@@ -1,7 +1,6 @@
1
1
  # ruff: noqa: I001
2
2
  from .asyncio import ( # noqa
3
3
  asyncio_once,
4
- get_real_current_loop,
5
4
  drain_tasks,
6
5
  draining_asyncio_tasks,
7
6
  )
@@ -20,13 +20,9 @@ def asyncio_once(fn: CallableT) -> CallableT:
20
20
  return ta.cast(CallableT, inner)
21
21
 
22
22
 
23
- def get_real_current_loop() -> asyncio.AbstractEventLoop | None:
24
- return asyncio.get_event_loop_policy()._local._loop # type: ignore # noqa
25
-
26
-
27
23
  def drain_tasks(loop=None):
28
24
  if loop is None:
29
- loop = get_real_current_loop()
25
+ loop = asyncio.get_running_loop()
30
26
 
31
27
  while loop._ready or loop._scheduled: # noqa
32
28
  loop._run_once() # noqa
@@ -34,7 +30,7 @@ def drain_tasks(loop=None):
34
30
 
35
31
  @contextlib.contextmanager
36
32
  def draining_asyncio_tasks() -> ta.Iterator[None]:
37
- loop = get_real_current_loop()
33
+ loop = asyncio.get_running_loop()
38
34
  try:
39
35
  yield
40
36
  finally:
omlish/asyncs/bridge.py CHANGED
@@ -86,7 +86,7 @@ class BridgeAwaitRequiredError(Exception):
86
86
  pass
87
87
 
88
88
 
89
- class MissingBridgeGreenletError(Exception):
89
+ class MissingBridgeThreadletError(Exception):
90
90
  pass
91
91
 
92
92
 
@@ -224,7 +224,7 @@ def s_to_a_await(awaitable: ta.Awaitable[T]) -> T:
224
224
 
225
225
  if not getattr(g.underlying, _BRIDGE_THREADLET_ATTR, False):
226
226
  _safe_cancel_awaitable(awaitable)
227
- raise MissingBridgeGreenletError
227
+ raise MissingBridgeThreadletError
228
228
 
229
229
  return check.not_none(g.parent).switch(awaitable)
230
230
 
@@ -2,10 +2,6 @@ from .helpers import ( # noqa
2
2
  assert_raises_star,
3
3
  )
4
4
 
5
- from .marks import ( # noqa
6
- drain_asyncio,
7
- )
8
-
9
5
  from . import skip # noqa
10
6
 
11
7
  # Imported for convenience in things that import this but not lang.
@@ -17,22 +17,8 @@ class ManagerMark(lang.Abstract):
17
17
  raise NotImplementedError
18
18
 
19
19
 
20
- def _deep_subclasses(cls):
21
- ret = set()
22
-
23
- def rec(cur):
24
- for nxt in cur.__subclasses__():
25
- if nxt not in ret:
26
- ret.add(nxt)
27
- rec(nxt)
28
-
29
- rec(cls)
30
- return ret
31
-
32
-
33
20
  @register
34
21
  class ManagerMarksPlugin:
35
-
36
22
  @lang.cached_function
37
23
  def mark_classes(self) -> ta.Mapping[str, type[ManagerMark]]:
38
24
  return {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omlish
3
- Version: 0.0.0.dev196
3
+ Version: 0.0.0.dev198
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -1,5 +1,5 @@
1
1
  omlish/.manifests.json,sha256=dyIpveH7Z8OnQp2pTn6NVv7LCDXVrozJWAzbk8PBavg,7950
2
- omlish/__about__.py,sha256=nxbjDnaovkyE-nMQ2f3nKoT_fTMcghr_b2v84nrqD6U,3409
2
+ omlish/__about__.py,sha256=2l-ZMOw9Ow1ATtnEq25MKztlw3j8x4D9r2OdqjJH9WQ,3409
3
3
  omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
4
4
  omlish/c3.py,sha256=ubu7lHwss5V4UznbejAI0qXhXahrU01MysuHOZI9C4U,8116
5
5
  omlish/cached.py,sha256=UI-XTFBwA6YXWJJJeBn-WkwBkfzDjLBBaZf4nIJA9y0,510
@@ -88,13 +88,13 @@ omlish/asyncs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
88
  omlish/asyncs/all.py,sha256=uUz9ziKh4_QrgmdhKFMgq6j7mFbiZd3LiogguDCQsGI,587
89
89
  omlish/asyncs/anyio.py,sha256=gfpx-D8QGmUfhnQxHEaHXcAP8zSMQjcGw4COFTGNnHI,8021
90
90
  omlish/asyncs/asyncs.py,sha256=Tf7ZodTGepkM7HAuFcDNh9lLzzrMw6rELWvopGmFkh4,2035
91
- omlish/asyncs/bridge.py,sha256=GJOjXVwZJvpq2q9rCwRI2u7Tg-KLUx-SY92b873-M4c,9738
91
+ omlish/asyncs/bridge.py,sha256=zVAhbFVDvw3qJjcvOKKY2mI8AwrmcmddKsW9KIzPdLI,9740
92
92
  omlish/asyncs/flavors.py,sha256=1mNxGNRVmjUHzA13K5ht8vdJv4CLEmzYTQ6BZXr1520,4866
93
93
  omlish/asyncs/trio.py,sha256=fmZ5b_lKdVV8NQ3euCUutWgnkqTFzSnOjvJSA_jvmrE,367
94
94
  omlish/asyncs/trio_asyncio.py,sha256=oqdOHy0slj9PjVxaDf3gJkq9AAgg7wYZbB469jOftVw,1327
95
95
  omlish/asyncs/asyncio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
- omlish/asyncs/asyncio/all.py,sha256=cyfe1tOXxQYmgfyF9X1dwx0LPQ0Gsub3tFFZGjWGMr8,142
97
- omlish/asyncs/asyncio/asyncio.py,sha256=JfM59QgB3asgEbrps0zoVbNjWD4kL2XdsEkRMEIoFos,971
96
+ omlish/asyncs/asyncio/all.py,sha256=eZDtL8atzHqIdGCAAcQYWVmNvgRYerJB9Sy0reh-09k,115
97
+ omlish/asyncs/asyncio/asyncio.py,sha256=fvIc3M01Bo_qZTFz3Z2X7NrXC_9DnS0vtZKizGiV034,830
98
98
  omlish/asyncs/asyncio/channels.py,sha256=ZbmsEmdK1fV96liHdcVpRqA2dAMkXJt4Q3rFAg3YOIw,1074
99
99
  omlish/asyncs/asyncio/streams.py,sha256=Uc9PCWSfBqrK2kdVtfjjQU1eaYTWYmZm8QISDj2xiuw,1004
100
100
  omlish/asyncs/asyncio/subprocesses.py,sha256=XlIWwSxpVB7sMVc75-f7dI6r08JkdipNFRWXUKS8zAw,6960
@@ -573,9 +573,8 @@ omlish/term/vt100/states.py,sha256=OxPUxfFTcfz56MhtDgIigEApChOtN6XO1g6R2H08mu4,8
573
573
  omlish/term/vt100/terminal.py,sha256=KUlg331ele7P6SHsBKdbpdQFDKsxSply1Ds27NkppTs,9359
574
574
  omlish/testing/__init__.py,sha256=M_BQrcCHkoL-ZvE-UpQ8XxXNYRRawhjUz4rCJnAqM2A,152
575
575
  omlish/testing/testing.py,sha256=TT2wwSzPZ_KhIvKxpM1qc1yHKD-LHDNgGrcr_h8vs7c,2895
576
- omlish/testing/pytest/__init__.py,sha256=B2nyJrjIoNcEopbg0IZ5UUDs4OHmQ8qqElFJfGcDdas,257
576
+ omlish/testing/pytest/__init__.py,sha256=rOpQYgp7jYjEIMjInzl-a_uIMqmOtVwGzDgJyCDpvxg,206
577
577
  omlish/testing/pytest/helpers.py,sha256=TJpD60mBtLi9FtxX4TThfuXvg5FIRPSiZk1aeRwe-D4,197
578
- omlish/testing/pytest/marks.py,sha256=4-3WgunN_fcmhkmQ6mtX_AFo5QRDwflNSH7NoyoXui4,432
579
578
  omlish/testing/pytest/skip.py,sha256=NxTkAQiS3HKZR3sfFdxOR2LCFwtCveY6Ap-qtexiZbw,839
580
579
  omlish/testing/pytest/inject/__init__.py,sha256=pdRKv1HcDmJ_yArKJbYITPXXZthRSGgBJWqITr0Er38,117
581
580
  omlish/testing/pytest/inject/harness.py,sha256=_Qf7lLcYc_dpauYOE68u_a65jPCFWmQUYv9m_OOdNqs,5724
@@ -583,7 +582,7 @@ omlish/testing/pytest/plugins/__init__.py,sha256=ys1zXrYrNm7Uo6YOIVJ6Bd3dQo6kv38
583
582
  omlish/testing/pytest/plugins/_registry.py,sha256=IK04KlBgiOJxKAyCCgjpX2R-9tE-btalYJkgjLc8Te8,77
584
583
  omlish/testing/pytest/plugins/depskip.py,sha256=xithY-OMtjwhv8mcRNkv-WI_PSQtHldQ8H1s60MIXkk,2673
585
584
  omlish/testing/pytest/plugins/logging.py,sha256=Y1I_3DiiuDSynObkm8bNPZxdvljUWXbqD6YUM5uI34o,391
586
- omlish/testing/pytest/plugins/managermarks.py,sha256=AP3ty-QB-8O5DkulwUOudBlUOvXMHhBfNyY-0yCmejk,1520
585
+ omlish/testing/pytest/plugins/managermarks.py,sha256=IzkspjT8-ToPIlHZs9cHt6RYbm51poJLjYVvkFPbJhE,1300
587
586
  omlish/testing/pytest/plugins/pydevd.py,sha256=AXtN83M39ZKJ4VH3MJEhvPnAmYzD5u1r8ehz-0om50Q,842
588
587
  omlish/testing/pytest/plugins/repeat.py,sha256=flSQzE9GFOWksVKz-mUGnpxJpv3yRqn1G4K8pW7JHs0,498
589
588
  omlish/testing/pytest/plugins/skips.py,sha256=EoZDg1uWccgbAegmzqI85c7RliycD1e2J4Y7vfDRhwM,1041
@@ -608,9 +607,9 @@ omlish/text/indent.py,sha256=YjtJEBYWuk8--b9JU_T6q4yxV85_TR7VEVr5ViRCFwk,1336
608
607
  omlish/text/minja.py,sha256=jZC-fp3Xuhx48ppqsf2Sf1pHbC0t8XBB7UpUUoOk2Qw,5751
609
608
  omlish/text/parts.py,sha256=7vPF1aTZdvLVYJ4EwBZVzRSy8XB3YqPd7JwEnNGGAOo,6495
610
609
  omlish/text/random.py,sha256=jNWpqiaKjKyTdMXC-pWAsSC10AAP-cmRRPVhm59ZWLk,194
611
- omlish-0.0.0.dev196.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
612
- omlish-0.0.0.dev196.dist-info/METADATA,sha256=UQWrSXv_IXEoC7OUH5wA3bWZ3z8s6N1WYqTRzRmpXyg,4264
613
- omlish-0.0.0.dev196.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
614
- omlish-0.0.0.dev196.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
615
- omlish-0.0.0.dev196.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
616
- omlish-0.0.0.dev196.dist-info/RECORD,,
610
+ omlish-0.0.0.dev198.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
611
+ omlish-0.0.0.dev198.dist-info/METADATA,sha256=DdG84lagt0fqcKUx-5Y5WBbViQubCiig7xFSBZNQu_o,4264
612
+ omlish-0.0.0.dev198.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
613
+ omlish-0.0.0.dev198.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
614
+ omlish-0.0.0.dev198.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
615
+ omlish-0.0.0.dev198.dist-info/RECORD,,
@@ -1,18 +0,0 @@
1
- import typing as ta
2
-
3
- import pytest
4
-
5
- from ... import lang # noqa
6
- from .plugins.managermarks import ManagerMark # noqa
7
-
8
-
9
- if ta.TYPE_CHECKING:
10
- from ...asyncs.asyncio import all as aiu
11
- else:
12
- aiu = lang.proxy_import('...asyncs.asyncio.all', __package__)
13
-
14
-
15
- class drain_asyncio(ManagerMark): # noqa
16
- def __call__(self, item: pytest.Function) -> ta.Iterator[None]:
17
- with aiu.draining_asyncio_tasks():
18
- yield