omlish 0.0.0.dev378__py3-none-any.whl → 0.0.0.dev380__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.dev378'
2
- __revision__ = '68656a20484255b8c2b94a33e964ad007247d478'
1
+ __version__ = '0.0.0.dev380'
2
+ __revision__ = 'fe5206dcbab0b2a4d8d6a57a98453564165502cf'
3
3
 
4
4
 
5
5
  #
@@ -32,7 +32,7 @@ class Project(ProjectBase):
32
32
 
33
33
  optional_dependencies = {
34
34
  'async': [
35
- 'anyio ~= 4.9',
35
+ 'anyio ~= 4.10',
36
36
  'sniffio ~= 1.3',
37
37
 
38
38
  'greenlet ~= 3.2',
@@ -53,7 +53,7 @@ def get_current_task() -> anyio.TaskInfo | None:
53
53
  ##
54
54
 
55
55
 
56
- async def call_with_task_group(
56
+ async def call_with_task_group( # type: ignore[return] # ????
57
57
  fn: ta.Callable[ta.Concatenate[anyio.abc.TaskGroup, P], ta.Awaitable[T]],
58
58
  *args: ta.Any,
59
59
  **kwargs: ta.Any,
omlish/configs/classes.py CHANGED
@@ -11,7 +11,7 @@ ConfigurableConfigT = ta.TypeVar('ConfigurableConfigT', bound='Configurable.Conf
11
11
  ##
12
12
 
13
13
 
14
- class Configurable(ta.Generic[ConfigurableConfigT], lang.Abstract):
14
+ class Configurable(lang.Abstract, ta.Generic[ConfigurableConfigT]):
15
15
  @dc.dataclass(frozen=True, kw_only=True)
16
16
  class Config:
17
17
  """Does not use any dc metaclasses to preserve typechecking."""
@@ -95,6 +95,23 @@ from .reflection import ( # noqa
95
95
  reflect,
96
96
  )
97
97
 
98
+ from .specs import ( # noqa
99
+ CoerceFn,
100
+ ValidateFn,
101
+ ReprFn,
102
+
103
+ InitFn,
104
+ ClassValidateFn,
105
+
106
+ DefaultFactory,
107
+
108
+ FieldType,
109
+
110
+ FieldSpec,
111
+
112
+ ClassSpec,
113
+ )
114
+
98
115
  from .tools.as_ import ( # noqa
99
116
  shallow_asdict,
100
117
  shallow_astuple,
@@ -13,6 +13,8 @@ T = ta.TypeVar('T')
13
13
 
14
14
 
15
15
  class Dispatcher(ta.Generic[T]):
16
+ """Shared dispatching system for functions and methods. Logic directly mimics `functools.singledispatch`."""
17
+
16
18
  def __init__(self, find_impl: ta.Callable[[type, ta.Mapping[type, T]], T | None] | None = None) -> None:
17
19
  super().__init__()
18
20
 
@@ -24,6 +24,21 @@ P = ta.ParamSpec('P')
24
24
 
25
25
 
26
26
  class Method(ta.Generic[P, R]):
27
+ """
28
+ MRO-honoring instancemethod singledispatch. There are many ways to do this, and this one is attr name based: a class
29
+ is considered to have method implementations that have been registered to a given method based on whether or not
30
+ they are accessible by a non-shadowed, MRO-resolved named attribute on that class.
31
+
32
+ Care must be taken when overriding registered implementations from superclasses in subclasses - shadowing the name
33
+ of the superclass method will not automatically register the new method with the same name to the dispatch method -
34
+ it must be explicitly `@register`'ed itself. This is a feature, allowing for selective de-registration of
35
+ implementations in subclasses via name shadowing.
36
+
37
+ Methods have ability to choose to allow external installation of implementations outside of direct subclasses. This
38
+ is to be used *extremely* rarely - basically only in the rare case of externally extensible type hierarchies with
39
+ visitors.
40
+ """
41
+
27
42
  def __init__(
28
43
  self,
29
44
  func: ta.Callable,
omlish/funcs/pairs.py CHANGED
@@ -19,7 +19,7 @@ T = ta.TypeVar('T')
19
19
  U = ta.TypeVar('U')
20
20
 
21
21
 
22
- class FnPair(ta.Generic[F, T], abc.ABC):
22
+ class FnPair(abc.ABC, ta.Generic[F, T]):
23
23
  @abc.abstractmethod
24
24
  def forward(self, f: F) -> T:
25
25
  raise NotImplementedError
@@ -16,7 +16,7 @@ SetMap: ta.TypeAlias = ta.Mapping[MK, ta.AbstractSet[MV]]
16
16
  ##
17
17
 
18
18
 
19
- class DirectedGraph(ta.Generic[V], lang.Abstract):
19
+ class DirectedGraph(lang.Abstract, ta.Generic[V]):
20
20
  @abc.abstractmethod
21
21
  def get_successors(self, vertex: V) -> ta.Collection[V]:
22
22
  raise NotImplementedError
omlish/graphs/trees.py CHANGED
@@ -23,7 +23,7 @@ NodeGenerator: ta.TypeAlias = ta.Generator[NodeT]
23
23
  ##
24
24
 
25
25
 
26
- class NodeError(ta.Generic[NodeT], Exception):
26
+ class NodeError(Exception, ta.Generic[NodeT]):
27
27
  def __init__(self, node: NodeT, msg: str, *args, **kwargs) -> None:
28
28
  super().__init__(msg, *args, **kwargs) # noqa
29
29
  self._node = node
@@ -158,7 +158,7 @@ class _CachedException(ta.NamedTuple):
158
158
  ex: BaseException
159
159
 
160
160
 
161
- class _CachedFunction(ta.Generic[T], Abstract):
161
+ class _CachedFunction(Abstract, ta.Generic[T]):
162
162
  @dc.dataclass(frozen=True, kw_only=True)
163
163
  class Opts:
164
164
  map_maker: ta.Callable[[], ta.MutableMapping] = dict
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omlish
3
- Version: 0.0.0.dev378
3
+ Version: 0.0.0.dev380
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -13,7 +13,7 @@ Classifier: Operating System :: POSIX
13
13
  Requires-Python: >=3.13
14
14
  License-File: LICENSE
15
15
  Provides-Extra: all
16
- Requires-Dist: anyio~=4.9; extra == "all"
16
+ Requires-Dist: anyio~=4.10; extra == "all"
17
17
  Requires-Dist: sniffio~=1.3; extra == "all"
18
18
  Requires-Dist: greenlet~=3.2; extra == "all"
19
19
  Requires-Dist: trio~=0.30; extra == "all"
@@ -45,7 +45,7 @@ Requires-Dist: duckdb~=1.3; extra == "all"
45
45
  Requires-Dist: markupsafe~=3.0; extra == "all"
46
46
  Requires-Dist: jinja2~=3.1; extra == "all"
47
47
  Requires-Dist: pytest~=8.4; extra == "all"
48
- Requires-Dist: anyio~=4.9; extra == "all"
48
+ Requires-Dist: anyio~=4.10; extra == "all"
49
49
  Requires-Dist: sniffio~=1.3; extra == "all"
50
50
  Requires-Dist: asttokens~=3.0; extra == "all"
51
51
  Requires-Dist: executing~=2.2; extra == "all"
@@ -53,7 +53,7 @@ Requires-Dist: orjson~=3.11; extra == "all"
53
53
  Requires-Dist: pyyaml~=6.0; extra == "all"
54
54
  Requires-Dist: wrapt~=1.17; extra == "all"
55
55
  Provides-Extra: async
56
- Requires-Dist: anyio~=4.9; extra == "async"
56
+ Requires-Dist: anyio~=4.10; extra == "async"
57
57
  Requires-Dist: sniffio~=1.3; extra == "async"
58
58
  Requires-Dist: greenlet~=3.2; extra == "async"
59
59
  Requires-Dist: trio~=0.30; extra == "async"
@@ -96,7 +96,7 @@ Requires-Dist: jinja2~=3.1; extra == "templates"
96
96
  Provides-Extra: testing
97
97
  Requires-Dist: pytest~=8.4; extra == "testing"
98
98
  Provides-Extra: plus
99
- Requires-Dist: anyio~=4.9; extra == "plus"
99
+ Requires-Dist: anyio~=4.10; extra == "plus"
100
100
  Requires-Dist: sniffio~=1.3; extra == "plus"
101
101
  Requires-Dist: asttokens~=3.0; extra == "plus"
102
102
  Requires-Dist: executing~=2.2; extra == "plus"
@@ -1,5 +1,5 @@
1
1
  omlish/.manifests.json,sha256=aT8yZ-Zh-9wfHl5Ym5ouiWC1i0cy7Q7RlhzavB6VLPI,8587
2
- omlish/__about__.py,sha256=7ZYuXmE8RfkmO7Z1KJIMIJKPRO9hoWBwulwAyFfWcac,3478
2
+ omlish/__about__.py,sha256=0vizk5M27FNgI3z_3kik1Ul02saG-iMv7BPdZJ1cGsg,3479
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
@@ -36,7 +36,7 @@ omlish/asyncs/anyio/signals.py,sha256=ySSut5prdnoy0-5Ws5V1M4cC2ON_vY550vU10d2NHk
36
36
  omlish/asyncs/anyio/streams.py,sha256=Zum2qd1t3EiH6yzGWFwxFw79m-IH2VY5sTUTiluFfIY,2164
37
37
  omlish/asyncs/anyio/subprocesses.py,sha256=nyl1A9z3rymxQMvIekWHU3IAiKBu1CcEqm-Ag1cGRPY,3018
38
38
  omlish/asyncs/anyio/sync.py,sha256=ZmSNhSsEkPwlXThrpefhtVTxw4GJ9F0P-yKyo5vbbSk,1574
39
- omlish/asyncs/anyio/utils.py,sha256=X2Rz1DGrCJ0zkt1O5cHoMRaYKTPndBj6dzLhb09mVtE,1672
39
+ omlish/asyncs/anyio/utils.py,sha256=-mveSB20De6znphfMlIuEd_rwITkcSjFNO07isshDjk,1704
40
40
  omlish/asyncs/asyncio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  omlish/asyncs/asyncio/all.py,sha256=u2JpMEs-0AJ0Vd8yU10HvWD8rfKxdFfMiwBu2oDeuuQ,313
42
42
  omlish/asyncs/asyncio/channels.py,sha256=oniTpmw_eeKK70APyEZLhRUChwLwebE4N0_uZiwSKgQ,1085
@@ -113,7 +113,7 @@ omlish/concurrent/futures.py,sha256=870tx8ELI8THvMnTrQoYIlEFKO9hM4KUrlehckJqKBU,
113
113
  omlish/concurrent/threadlets.py,sha256=JfirbTDJgy9Ouokz_VmHeAAPS7cih8qMUJrN-owwXD4,2423
114
114
  omlish/configs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
115
  omlish/configs/all.py,sha256=xTfR7NySnlIeqhk0GlUOncPnWZ97cLhCtRDlN_Ny8og,1107
116
- omlish/configs/classes.py,sha256=bRQ3NiYWpHNXspu7P52_9d-00P9YQz_cV8zWXTY2BZE,1173
116
+ omlish/configs/classes.py,sha256=sWBL1K90Ix5E-N_A6Uz7s-djpkS2rKEzOLFYB8pHk9k,1173
117
117
  omlish/configs/formats.py,sha256=DlaI_0mxrYmPl9pUWZFQ6xvqXz997uQOGtt9EKt6V9o,5307
118
118
  omlish/configs/nginx.py,sha256=b4fMI8dIZBUgOjmveRINrmmwSt8DO3y7nfvd-__YxDo,2062
119
119
  omlish/configs/shadow.py,sha256=rc-loE5ex2GFwvdQJXqJsnSQa-MNF6Mizh4FlirSYUo,2234
@@ -135,7 +135,7 @@ omlish/daemons/services.py,sha256=laoUeJU7eVHuWl1062FBjPSD7jchOjhpYDc5FT2B3dM,34
135
135
  omlish/daemons/spawning.py,sha256=psR73zOYjMKTqNpx1bMib8uU9wAZz62tw5TaWHrTdyY,5337
136
136
  omlish/daemons/targets.py,sha256=00KmtlknMhQ5PyyVAhWl3rpeTMPym0GxvHHq6mYPZ7c,3051
137
137
  omlish/daemons/waiting.py,sha256=RfgD1L33QQVbD2431dkKZGE4w6DUcGvYeRXXi8puAP4,1676
138
- omlish/dataclasses/__init__.py,sha256=-sQ9PO1ZIJosNQxKz9--eZFG3DDONp2yUCsTp_c3aC0,1970
138
+ omlish/dataclasses/__init__.py,sha256=2qPNbUAgg973l0n458ZEov6FvihpDztVU6HRalntysk,2147
139
139
  omlish/dataclasses/debug.py,sha256=giBiv6aXvX0IagwNCW64qBzNjfOFr3-VmgDy_KYlb-k,29
140
140
  omlish/dataclasses/errors.py,sha256=tyv3WR6az66uGGiq9FIuCHvy1Ef-G7zeMY7mMG6hy2Y,2527
141
141
  omlish/dataclasses/inspect.py,sha256=BlpPghVCU3w_YDnONEqqE99YHzJM2q3eoqe39YX25Ko,4596
@@ -223,10 +223,10 @@ omlish/diag/replserver/server.py,sha256=ukjk7yyceSG4LAJwxE-Een8b4tQ_2VJHArfKeTqK
223
223
  omlish/dispatch/__init__.py,sha256=UwVT6SSk5HKk9xF9vc_UJD8BDSIQWSw98Ldx-G-6PC0,166
224
224
  omlish/dispatch/_dispatch2.py,sha256=70k1tKKvuhxtAu6v4skECfHKIKVWrmlt7G_JKLUsKEs,1966
225
225
  omlish/dispatch/_dispatch3.py,sha256=9Zjd7bINAC3keiaBdssc4v5dY0-8OI6XooV2DR9U7Z0,2818
226
- omlish/dispatch/dispatch.py,sha256=KA5l49AiGLRjp4J7RDJW9RiDp9WUD1ewR1AOPEF8g38,3062
226
+ omlish/dispatch/dispatch.py,sha256=TzWihCt9Zr8wfIwVpKHVOOrYFVKpDXRevxYomtEfqYc,3176
227
227
  omlish/dispatch/functions.py,sha256=cwNzGIg2ZIalEgn9I03cnJVbMTHjWloyDTaowlO3UPs,1524
228
228
  omlish/dispatch/impls.py,sha256=K_okKvpZml4NkTHJmTVyMQSrIaIJcqTEgkreGwukaOw,1895
229
- omlish/dispatch/methods.py,sha256=GdVsC-Zo3N-OorE0mr3lFI70dATkD2aWqZ8TvExiR5k,9297
229
+ omlish/dispatch/methods.py,sha256=nqLvpuktVO9sE3np79QuKqmPyTX8tluFzPr4MNBkljc,10296
230
230
  omlish/docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
231
231
  omlish/docker/all.py,sha256=t5jBNZAzqCoB05-nwCuSZ6C3PBEBD6T3wsIJvIXJaRg,576
232
232
  omlish/docker/cli.py,sha256=ws3ypayxdnp3nWeLww45jHG0Vwr5e4bUbLTqkpejAhc,2570
@@ -307,12 +307,12 @@ omlish/funcs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
307
307
  omlish/funcs/builders.py,sha256=mJkgvJxM98x5pbMQzRY95tRUsbAfy_ivHtt4fDKfzsM,3984
308
308
  omlish/funcs/genmachine.py,sha256=D9dChaliNBIjYE6lJP5ctcVQUCffNBhceyaaLvBJ7ns,2578
309
309
  omlish/funcs/match.py,sha256=EPeKojvecnJuDEWaXEYuef0Sx1J6Y0uTL01h4Z8ldxc,6199
310
- omlish/funcs/pairs.py,sha256=VCkZjDmJGtR76BsejsHNfb4TcpHCtkkmak-zWDFchAo,3904
310
+ omlish/funcs/pairs.py,sha256=m570hXCaW6tCJq2QITJ_CKFFzXDDOogKvskX7N7oICs,3904
311
311
  omlish/funcs/pipes.py,sha256=E7Sz8Aj8ke_vCs5AMNwg1I36kRdHVGTnzxVQaDyn43U,2490
312
312
  omlish/graphs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
313
313
  omlish/graphs/dags.py,sha256=GsTVDehSGxIpjuZ3qe29dldhVydqWexZD9mpqZErhnI,4400
314
- omlish/graphs/domination.py,sha256=iwQa4QUXitLU2X4cdPxJ1ltRRUTuXnz0lI8j4GtuBsw,7591
315
- omlish/graphs/trees.py,sha256=phO2YNboo1uUJcY2qrD7CJ0bx4Ir8tbFkPK8RtHNm5k,8197
314
+ omlish/graphs/domination.py,sha256=w6QrVAdX2oiJ0k5OAedXrUwnCTS2XFzp2zC_JZq1Qfo,7591
315
+ omlish/graphs/trees.py,sha256=xo5p5vKWU1BpLSqetqcxMYrlway3l4xWT76O00SS1hM,8197
316
316
  omlish/graphs/dot/__init__.py,sha256=Y1MZRQBZkcYyG1Tn7K2FhL8aYbm4v4tk6f5g9AqEkUw,359
317
317
  omlish/graphs/dot/items.py,sha256=GIzUqLHJPR4AVtF141uA8JnyybkRZx6mFYsNJHu_JVg,4087
318
318
  omlish/graphs/dot/make.py,sha256=e-M1IEdh4kHEjJmBxpaEUPxvFLrm5uIXdGxjQZr2HRo,365
@@ -445,7 +445,7 @@ omlish/lang/strings.py,sha256=TY-v0iGu6BxEKb99YS-VmIJqc-sTAqMv7mCDJQALMnI,4550
445
445
  omlish/lang/sys.py,sha256=KPe1UOXk1VxlOYt_aLmhN0KqsA4wnP-4nm4WEwO49pw,411
446
446
  omlish/lang/typing.py,sha256=eWI3RKhVi-_SV2rN4SGq8IbFo5XbGapbiWeduF97uG8,3846
447
447
  omlish/lang/cached/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
448
- omlish/lang/cached/function.py,sha256=su9QxYECK9NK-UfMFKbgx4lqH2WoGBiYshnEfaGvfhw,11522
448
+ omlish/lang/cached/function.py,sha256=prLS_Zi581YCkJ-6sjurzZxSUng4Ls_2_ODdYo-oQq4,11522
449
449
  omlish/lang/cached/property.py,sha256=WHYyg4-6EA86TcNMfbXTjVhjEZPc0kngt9hfY3WN5w8,2768
450
450
  omlish/lang/classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
451
451
  omlish/lang/classes/abstract.py,sha256=5G3TXelpy5PRWa2x8G_Im4SPymGKrOBK6sELRyOG9eg,3796
@@ -890,9 +890,9 @@ omlish/typedvalues/marshal.py,sha256=AtBz7Jq-BfW8vwM7HSxSpR85JAXmxK2T0xDblmm1HI0
890
890
  omlish/typedvalues/of_.py,sha256=UXkxSj504WI2UrFlqdZJbu2hyDwBhL7XVrc2qdR02GQ,1309
891
891
  omlish/typedvalues/reflect.py,sha256=PAvKW6T4cW7u--iX80w3HWwZUS3SmIZ2_lQjT65uAyk,1026
892
892
  omlish/typedvalues/values.py,sha256=ym46I-q2QJ_6l4UlERqv3yj87R-kp8nCKMRph0xQ3UA,1307
893
- omlish-0.0.0.dev378.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
894
- omlish-0.0.0.dev378.dist-info/METADATA,sha256=n0FMZEirHsCNdkJmSNQkc38ytAoJc1nuFeI9BIFtBXQ,4416
895
- omlish-0.0.0.dev378.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
896
- omlish-0.0.0.dev378.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
897
- omlish-0.0.0.dev378.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
898
- omlish-0.0.0.dev378.dist-info/RECORD,,
893
+ omlish-0.0.0.dev380.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
894
+ omlish-0.0.0.dev380.dist-info/METADATA,sha256=4jcS5ILYiW2fXG8iILxtgzG-5KH-X_tHO0QUM9yiKAk,4420
895
+ omlish-0.0.0.dev380.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
896
+ omlish-0.0.0.dev380.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
897
+ omlish-0.0.0.dev380.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
898
+ omlish-0.0.0.dev380.dist-info/RECORD,,