omlish 0.0.0.dev381__py3-none-any.whl → 0.0.0.dev383__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.

Potentially problematic release.


This version of omlish might be problematic. Click here for more details.

omlish/__about__.py CHANGED
@@ -1,5 +1,5 @@
1
- __version__ = '0.0.0.dev381'
2
- __revision__ = 'f73e0ce8b22e02761d8deafb17e4cead2919af33'
1
+ __version__ = '0.0.0.dev383'
2
+ __revision__ = '30ecc2e778f892f6705283104b83b95626c3c24d'
3
3
 
4
4
 
5
5
  #
@@ -9,18 +9,22 @@ class ProjectBase:
9
9
  name: str | None = None
10
10
  authors = [{'name': 'wrmsr'}]
11
11
  urls = {'source': 'https://github.com/wrmsr/omlish'}
12
- license = {'text': 'BSD-3-Clause'}
12
+ license = 'BSD-3-Clause'
13
+ readme = 'README.md'
13
14
  requires_python = '>=3.13'
14
15
 
15
16
  version = __version__
16
17
 
17
18
  classifiers = [
18
- 'License :: OSI Approved :: BSD License',
19
19
  'Development Status :: 2 - Pre-Alpha',
20
+
20
21
  'Intended Audience :: Developers',
21
22
 
22
23
  'Operating System :: OS Independent',
23
24
  'Operating System :: POSIX',
25
+
26
+ 'Programming Language :: Python :: 3',
27
+ 'Programming Language :: Python :: 3.13',
24
28
  ]
25
29
 
26
30
 
omlish/inject/__init__.py CHANGED
@@ -4,6 +4,8 @@
4
4
  from .binder import ( # noqa
5
5
  bind,
6
6
  bind_as_fn,
7
+ bind_map_entry_const,
8
+ bind_set_entry_const,
7
9
  )
8
10
 
9
11
  from .bindings import ( # noqa
@@ -112,6 +114,10 @@ from .scopes import ( # noqa
112
114
  enter_seeded_scope,
113
115
  )
114
116
 
117
+ from .tags import ( # noqa
118
+ Id,
119
+ )
120
+
115
121
  from .types import ( # noqa
116
122
  Scope,
117
123
  Tag,
@@ -120,5 +126,4 @@ from .types import ( # noqa
120
126
 
121
127
  from .utils import ( # noqa
122
128
  ConstFn,
123
- Id,
124
129
  )
omlish/inject/binder.py CHANGED
@@ -11,8 +11,13 @@ from .bindings import Binding
11
11
  from .eagers import Eager
12
12
  from .elements import Element
13
13
  from .elements import Elements
14
+ from .elements import as_elements
14
15
  from .keys import Key
15
16
  from .keys import as_key
17
+ from .multis import MapBinding
18
+ from .multis import SetBinding
19
+ from .multis import is_map_multi_key
20
+ from .multis import is_set_multi_key
16
21
  from .privates import Expose
17
22
  from .providers import ConstProvider
18
23
  from .providers import CtorProvider
@@ -21,6 +26,7 @@ from .providers import LinkProvider
21
26
  from .providers import Provider
22
27
  from .scopes import SCOPE_ALIASES
23
28
  from .scopes import Singleton
29
+ from .tags import Id
24
30
  from .types import Scope
25
31
  from .types import Unscoped
26
32
 
@@ -180,3 +186,45 @@ def bind(
180
186
  return elements[0]
181
187
  else:
182
188
  return Elements(frozenset(elements))
189
+
190
+
191
+ ##
192
+
193
+
194
+ def bind_set_entry_const(
195
+ multi_key: ta.Any,
196
+ obj: ta.Any,
197
+ *,
198
+ tag: ta.Any | None = None,
199
+ ) -> Elements:
200
+ multi_key = as_key(multi_key)
201
+ check.arg(is_set_multi_key(multi_key))
202
+
203
+ if tag is None:
204
+ tag = Id(id(obj), tag=multi_key.tag)
205
+ obj_key: Key = Key(type(obj), tag=tag)
206
+
207
+ return as_elements(
208
+ bind(obj_key, to_const=obj),
209
+ SetBinding(multi_key, obj_key),
210
+ )
211
+
212
+
213
+ def bind_map_entry_const(
214
+ multi_key: ta.Any,
215
+ map_key: ta.Any,
216
+ obj: ta.Any,
217
+ *,
218
+ tag: ta.Any | None = None,
219
+ ) -> Elements:
220
+ multi_key = as_key(multi_key)
221
+ check.arg(is_map_multi_key(multi_key))
222
+
223
+ if tag is None:
224
+ tag = Id(id(obj), tag=multi_key.tag)
225
+ obj_key: Key = Key(type(obj), tag=tag)
226
+
227
+ return as_elements(
228
+ bind(obj_key, to_const=obj),
229
+ MapBinding(multi_key, map_key, obj_key),
230
+ )
omlish/inject/keys.py CHANGED
@@ -14,7 +14,7 @@ T = ta.TypeVar('T')
14
14
 
15
15
 
16
16
  @dc.dataclass(frozen=True)
17
- @dc.extra_class_params(cache_hash=True)
17
+ @dc.extra_class_params(cache_hash=True, terse_repr=True)
18
18
  class Key(lang.Final, ta.Generic[T]):
19
19
  ty: rfl.Type = dc.xfield(coerce=rfl.type_)
20
20
 
omlish/inject/multis.py CHANGED
@@ -25,34 +25,34 @@ V = ta.TypeVar('V')
25
25
  ##
26
26
 
27
27
 
28
- def _check_set_multi_key(mk: Key) -> bool:
28
+ def is_set_multi_key(mk: Key) -> bool:
29
29
  return rfl.get_concrete_type(mk.ty) is collections.abc.Set
30
30
 
31
31
 
32
32
  @dc.dataclass(frozen=True)
33
33
  @dc.extra_class_params(cache_hash=True)
34
34
  class SetBinding(Element, lang.Final):
35
- multi_key: Key = dc.xfield(validate=_check_set_multi_key)
35
+ multi_key: Key = dc.xfield(validate=is_set_multi_key)
36
36
  dst: Key = dc.xfield(coerce=check.of_isinstance(Key))
37
37
 
38
38
 
39
39
  @dc.dataclass(frozen=True)
40
40
  @dc.extra_class_params(cache_hash=True)
41
41
  class SetProvider(Provider):
42
- multi_key: Key = dc.xfield(validate=_check_set_multi_key)
42
+ multi_key: Key = dc.xfield(validate=is_set_multi_key)
43
43
 
44
44
 
45
- ##
45
+ #
46
46
 
47
47
 
48
- def _check_map_multi_key(mk: Key) -> bool:
48
+ def is_map_multi_key(mk: Key) -> bool:
49
49
  return rfl.get_concrete_type(mk.ty) is collections.abc.Mapping
50
50
 
51
51
 
52
52
  @dc.dataclass(frozen=True)
53
53
  @dc.extra_class_params(cache_hash=True)
54
54
  class MapBinding(Element, lang.Final):
55
- multi_key: Key = dc.xfield(validate=_check_map_multi_key)
55
+ multi_key: Key = dc.xfield(validate=is_map_multi_key)
56
56
  map_key: ta.Any = dc.xfield()
57
57
  dst: Key = dc.xfield(coerce=check.of_isinstance(Key))
58
58
 
@@ -60,7 +60,7 @@ class MapBinding(Element, lang.Final):
60
60
  @dc.dataclass(frozen=True)
61
61
  @dc.extra_class_params(cache_hash=True)
62
62
  class MapProvider(Provider):
63
- multi_key: Key = dc.xfield(validate=_check_map_multi_key)
63
+ multi_key: Key = dc.xfield(validate=is_map_multi_key)
64
64
 
65
65
 
66
66
  ##
@@ -94,6 +94,9 @@ class SetBinder(ElementGenerator, ta.Generic[T]):
94
94
  yield from self._sbs
95
95
 
96
96
 
97
+ #
98
+
99
+
97
100
  class MapBinder(ElementGenerator, ta.Generic[K, V]):
98
101
  def __init__(self, *, tag: ta.Any = None) -> None:
99
102
  super().__init__()
omlish/inject/tags.py ADDED
@@ -0,0 +1,22 @@
1
+ import typing as ta
2
+
3
+ from .. import dataclasses as dc
4
+ from .types import Tag
5
+
6
+
7
+ ##
8
+
9
+
10
+ @dc.dataclass(frozen=True)
11
+ @dc.extra_class_params(cache_hash=True, terse_repr=True)
12
+ class Id:
13
+ """A utility dataclass intended to be used as a key tag for disambiguation."""
14
+
15
+ v: int
16
+
17
+ tag: ta.Any = dc.xfield(
18
+ default=None,
19
+ kw_only=True,
20
+ validate=lambda o: not isinstance(o, Tag),
21
+ repr_fn=dc.opt_repr,
22
+ )
omlish/inject/utils.py CHANGED
@@ -19,14 +19,3 @@ class ConstFn(HasOriginsImpl, lang.Final, ta.Generic[T]):
19
19
 
20
20
  def __call__(self) -> T:
21
21
  return self.v
22
-
23
-
24
- ##
25
-
26
-
27
- @dc.dataclass(frozen=True)
28
- @dc.extra_class_params(terse_repr=True)
29
- class Id:
30
- """A utility dataclass intended to be used as a key tag for disambiguation."""
31
-
32
- v: int
omlish/manifests/load.py CHANGED
@@ -130,6 +130,7 @@ class ManifestLoader:
130
130
  spec is not None and
131
131
  isinstance(spec.loader, importlib.machinery.SourceFileLoader) and
132
132
  spec.origin is not None and
133
+ len(spec.submodule_search_locations or []) == 1 and
133
134
  os.path.basename(spec.origin) == '__init__.py' and
134
135
  os.path.isfile(spec.origin)
135
136
  ):
@@ -0,0 +1,302 @@
1
+ Metadata-Version: 2.4
2
+ Name: omlish
3
+ Version: 0.0.0.dev383
4
+ Summary: omlish
5
+ Author: wrmsr
6
+ License-Expression: BSD-3-Clause
7
+ Project-URL: source, https://github.com/wrmsr/omlish
8
+ Classifier: Development Status :: 2 - Pre-Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Operating System :: POSIX
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Requires-Python: >=3.13
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Provides-Extra: all
18
+ Requires-Dist: anyio~=4.10; extra == "all"
19
+ Requires-Dist: sniffio~=1.3; extra == "all"
20
+ Requires-Dist: greenlet~=3.2; extra == "all"
21
+ Requires-Dist: trio~=0.30; extra == "all"
22
+ Requires-Dist: trio-asyncio~=0.15; extra == "all"
23
+ Requires-Dist: lz4~=4.4; extra == "all"
24
+ Requires-Dist: python-snappy~=0.7; extra == "all"
25
+ Requires-Dist: zstandard~=0.23; extra == "all"
26
+ Requires-Dist: brotli~=1.1; extra == "all"
27
+ Requires-Dist: asttokens~=3.0; extra == "all"
28
+ Requires-Dist: executing~=2.2; extra == "all"
29
+ Requires-Dist: psutil~=7.0; extra == "all"
30
+ Requires-Dist: orjson~=3.11; extra == "all"
31
+ Requires-Dist: ujson~=5.10; extra == "all"
32
+ Requires-Dist: pyyaml~=6.0; extra == "all"
33
+ Requires-Dist: cbor2~=5.6; extra == "all"
34
+ Requires-Dist: cloudpickle~=3.1; extra == "all"
35
+ Requires-Dist: httpx[http2]~=0.28; extra == "all"
36
+ Requires-Dist: wrapt~=1.17; extra == "all"
37
+ Requires-Dist: cryptography~=45.0; extra == "all"
38
+ Requires-Dist: sqlalchemy[asyncio]~=2.0; extra == "all"
39
+ Requires-Dist: pg8000~=1.31; extra == "all"
40
+ Requires-Dist: pymysql~=1.1; extra == "all"
41
+ Requires-Dist: aiomysql~=0.2; extra == "all"
42
+ Requires-Dist: aiosqlite~=0.21; extra == "all"
43
+ Requires-Dist: asyncpg~=0.30; extra == "all"
44
+ Requires-Dist: apsw~=3.50; extra == "all"
45
+ Requires-Dist: sqlean.py~=3.49; extra == "all"
46
+ Requires-Dist: duckdb~=1.3; extra == "all"
47
+ Requires-Dist: markupsafe~=3.0; extra == "all"
48
+ Requires-Dist: jinja2~=3.1; extra == "all"
49
+ Requires-Dist: pytest~=8.4; extra == "all"
50
+ Requires-Dist: anyio~=4.10; extra == "all"
51
+ Requires-Dist: sniffio~=1.3; extra == "all"
52
+ Requires-Dist: asttokens~=3.0; extra == "all"
53
+ Requires-Dist: executing~=2.2; extra == "all"
54
+ Requires-Dist: orjson~=3.11; extra == "all"
55
+ Requires-Dist: pyyaml~=6.0; extra == "all"
56
+ Requires-Dist: wrapt~=1.17; extra == "all"
57
+ Provides-Extra: async
58
+ Requires-Dist: anyio~=4.10; extra == "async"
59
+ Requires-Dist: sniffio~=1.3; extra == "async"
60
+ Requires-Dist: greenlet~=3.2; extra == "async"
61
+ Requires-Dist: trio~=0.30; extra == "async"
62
+ Requires-Dist: trio-asyncio~=0.15; extra == "async"
63
+ Provides-Extra: compress
64
+ Requires-Dist: lz4~=4.4; extra == "compress"
65
+ Requires-Dist: python-snappy~=0.7; extra == "compress"
66
+ Requires-Dist: zstandard~=0.23; extra == "compress"
67
+ Requires-Dist: brotli~=1.1; extra == "compress"
68
+ Provides-Extra: diag
69
+ Requires-Dist: asttokens~=3.0; extra == "diag"
70
+ Requires-Dist: executing~=2.2; extra == "diag"
71
+ Requires-Dist: psutil~=7.0; extra == "diag"
72
+ Provides-Extra: formats
73
+ Requires-Dist: orjson~=3.11; extra == "formats"
74
+ Requires-Dist: ujson~=5.10; extra == "formats"
75
+ Requires-Dist: pyyaml~=6.0; extra == "formats"
76
+ Requires-Dist: cbor2~=5.6; extra == "formats"
77
+ Requires-Dist: cloudpickle~=3.1; extra == "formats"
78
+ Provides-Extra: http
79
+ Requires-Dist: httpx[http2]~=0.28; extra == "http"
80
+ Provides-Extra: misc
81
+ Requires-Dist: wrapt~=1.17; extra == "misc"
82
+ Provides-Extra: secrets
83
+ Requires-Dist: cryptography~=45.0; extra == "secrets"
84
+ Provides-Extra: sqlalchemy
85
+ Requires-Dist: sqlalchemy[asyncio]~=2.0; extra == "sqlalchemy"
86
+ Provides-Extra: sqldrivers
87
+ Requires-Dist: pg8000~=1.31; extra == "sqldrivers"
88
+ Requires-Dist: pymysql~=1.1; extra == "sqldrivers"
89
+ Requires-Dist: aiomysql~=0.2; extra == "sqldrivers"
90
+ Requires-Dist: aiosqlite~=0.21; extra == "sqldrivers"
91
+ Requires-Dist: asyncpg~=0.30; extra == "sqldrivers"
92
+ Requires-Dist: apsw~=3.50; extra == "sqldrivers"
93
+ Requires-Dist: sqlean.py~=3.49; extra == "sqldrivers"
94
+ Requires-Dist: duckdb~=1.3; extra == "sqldrivers"
95
+ Provides-Extra: templates
96
+ Requires-Dist: markupsafe~=3.0; extra == "templates"
97
+ Requires-Dist: jinja2~=3.1; extra == "templates"
98
+ Provides-Extra: testing
99
+ Requires-Dist: pytest~=8.4; extra == "testing"
100
+ Provides-Extra: plus
101
+ Requires-Dist: anyio~=4.10; extra == "plus"
102
+ Requires-Dist: sniffio~=1.3; extra == "plus"
103
+ Requires-Dist: asttokens~=3.0; extra == "plus"
104
+ Requires-Dist: executing~=2.2; extra == "plus"
105
+ Requires-Dist: orjson~=3.11; extra == "plus"
106
+ Requires-Dist: pyyaml~=6.0; extra == "plus"
107
+ Requires-Dist: wrapt~=1.17; extra == "plus"
108
+ Dynamic: license-file
109
+
110
+ # Overview
111
+
112
+ Core utilities and foundational code. It's relatively large but completely self-contained.
113
+
114
+ # Notable packages
115
+
116
+ - **[lang](https://github.com/wrmsr/omlish/blob/master/omlish/lang)** - The standard library of this standard library.
117
+ Usually imported as a whole (`from omlish import lang`), it contains an array of general purpose utilities used
118
+ practically everywhere. It is kept relatively lightweight: its heaviest import is stdlib dataclasses and its
119
+ transitives. Some of its contents include:
120
+
121
+ - **[cached](https://github.com/wrmsr/omlish/blob/master/omlish/lang/cached)** - The standard `cached_function` /
122
+ `cached_property` tools, which are more capable than
123
+ [`functools.lru_cache`](https://docs.python.org/3/library/functools.html#functools.lru_cache).
124
+ - **[imports](https://github.com/wrmsr/omlish/blob/master/omlish/lang/imports.py)** - Import tools like `proxy_import`
125
+ for late-loaded imports and `proxy_init` for late-loaded module globals.
126
+ - **[classes](https://github.com/wrmsr/omlish/blob/master/omlish/lang/classes)** - Class tools and bases, such as
127
+ `Abstract` (which checks at subclass definition not instantiation), `Sealed` / `PackageSealed`, and `Final`.
128
+ - **[maybes](https://github.com/wrmsr/omlish/blob/master/omlish/lite/maybes.py)** - A simple, nestable formalization
129
+ of the presence or absence of an object, as in [many](https://en.cppreference.com/w/cpp/utility/optional)
130
+ [other](https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html)
131
+ [languages](https://doc.rust-lang.org/std/option/).
132
+
133
+ - **[bootstrap](https://github.com/wrmsr/omlish/blob/master/omlish/bootstrap)** - A centralized, configurable,
134
+ all-in-one collection of various process-initialization minutiae like resource limiting, profiling, remote debugging,
135
+ log configuration, environment variables, et cetera. Usable as a context manager or via its
136
+ [cli](https://github.com/wrmsr/omlish/blob/master/omlish/bootstrap/main.py).
137
+
138
+ - **[collections](https://github.com/wrmsr/omlish/blob/master/omlish/collections)** - A handful of collection utilities
139
+ and simple implementations, including:
140
+
141
+ - **[cache](https://github.com/wrmsr/omlish/blob/master/omlish/collections/cache)** - A configurable LRU / LFU cache
142
+ with options like ttl and max size / weight.
143
+ - **[hasheq](https://github.com/wrmsr/omlish/blob/master/omlish/collections/hasheq.py)** - A dict taking an external
144
+ `__hash__` / `__eq__` implementation.
145
+ - **[identity](https://github.com/wrmsr/omlish/blob/master/omlish/collections/identity.py)** - Identity-keyed
146
+ collections.
147
+ - **[sorted](https://github.com/wrmsr/omlish/blob/master/omlish/collections/sorted)** - Interfaces for value-sorted
148
+ collections and key-sorted mappings, and a simple but - correct skiplist-backed implementation.
149
+ - **[persistent](https://github.com/wrmsr/omlish/blob/master/omlish/collections/persistent)** - Interfaces for
150
+ [persistent](https://en.wikipedia.org/wiki/Persistent_data_structure) maps, and a simple but correct treap-backed
151
+ implementation.
152
+
153
+ - **[dataclasses](https://github.com/wrmsr/omlish/blob/master/omlish/dataclasses)** - A fully-compatible
154
+ reimplementation of stdlib [dataclasses](https://docs.python.org/3/library/dataclasses.html) with numerous
155
+ enhancements and additional features. The
156
+ [full stdlib test suite](https://github.com/wrmsr/omlish/blob/master/omlish/dataclasses/tests/cpython) is run against
157
+ it ensuring compatibility - they *are* dataclasses. Current enhancements include:
158
+
159
+ - Simple field coercion and validation.
160
+ - Any number of `@dc.init` or `@dc.validate` methods, not just a central `__post_init__`.
161
+ - Optional generic type parameter substitution in generated `__init__` methods, enabling accurate reflection.
162
+ - An optional [metaclass](https://github.com/wrmsr/omlish/blob/master/omlish/dataclasses/metaclass) which removes the
163
+ need for re-decorating subclasses (with support for inheritance of dataclass parameters like `frozen`), and some
164
+ basic [base classes](https://github.com/wrmsr/omlish/blob/master/omlish/dataclasses/metaclass/bases.py).
165
+ - (Nearly finished) support for ahead-of-time / build-time code generation, greatly reducing import times.
166
+
167
+ The stdlib-equivalent api is exported in such a way as to appear to be direct aliases for the stdlib api itself,
168
+ simplifying tool support.
169
+
170
+ - **[dispatch](https://github.com/wrmsr/omlish/blob/master/omlish/dispatch)** - A beefed-up version of
171
+ [functools.singledispatch](https://docs.python.org/3/library/functools.html#functools.singledispatch), most notably
172
+ supporting MRO-honoring method impl dispatch.
173
+
174
+ - **[formats](https://github.com/wrmsr/omlish/blob/master/omlish/formats)** - Tools for various data formats, including:
175
+
176
+ - **[json](https://github.com/wrmsr/omlish/blob/master/omlish/formats/json)** - Tools for json, including abstraction
177
+ over various backends and a self-contained streaming / incremental parser.
178
+ - **[json5](https://github.com/wrmsr/omlish/blob/master/omlish/formats/json5)** - A self-contained and tested
179
+ [Json5](https://json5.org/) parser.
180
+ - **[toml](https://github.com/wrmsr/omlish/blob/master/omlish/formats/toml)** - Toml tools, including a
181
+ [lite](#lite-code) version of the stdlib parser (for use in older pythons).
182
+
183
+ - **[http](https://github.com/wrmsr/omlish/blob/master/omlish/http)** - HTTP code, including:
184
+
185
+ - **[clients](https://github.com/wrmsr/omlish/blob/master/omlish/http/clients)** - An abstraction over HTTP clients,
186
+ with urllib and httpx implementations.
187
+ - **[coro](https://github.com/wrmsr/omlish/blob/master/omlish/http/coro)** - Coroutine /
188
+ [sans-io](https://sans-io.readthedocs.io/) style reformulation of some stdlib http machinery - namely `http.server`
189
+ (and soon `http.client`). This style of code can run the same in sync, async, or
190
+ [any](https://docs.python.org/3/library/selectors.html)
191
+ [other](https://github.com/wrmsr/omlish/blob/master/omlish/asyncs/bluelet) context.
192
+
193
+ - **[inject](https://github.com/wrmsr/omlish/blob/master/omlish/inject)** - A
194
+ [guice](https://github.com/google/guice)-style dependency injector.
195
+
196
+ - **[io](https://github.com/wrmsr/omlish/blob/master/omlish/io)** - IO tools, including:
197
+
198
+ - **[compress](https://github.com/wrmsr/omlish/blob/master/omlish/io/compress)** - Abstraction over various
199
+ compression schemes, with particular attention to incremental operation. For example it includes
200
+ [an incremental reformulation of stdlib's gzip](https://github.com/wrmsr/omlish/blob/master/omlish/io/compress/gzip.py).
201
+ - **[coro](https://github.com/wrmsr/omlish/blob/master/omlish/io/coro)** - Utilities for coroutine / sans-io style
202
+ code.
203
+ - **[fdio](https://github.com/wrmsr/omlish/blob/master/omlish/io/fdio)** - An implementation of classic
204
+ [selector](https://docs.python.org/3/library/selectors.html)-style IO dispatch, akin to the deprecated
205
+ [asyncore](https://docs.python.org/3.11/library/asyncore.html). While more modern asyncio style code is generally
206
+ preferred, it nearly always involves
207
+ [background threads](https://github.com/python/cpython/blob/95d9dea1c4ed1b1de80074b74301cee0b38d5541/Lib/asyncio/unix_events.py#L1349)
208
+ making it [unsuitable for forking processes](https://rachelbythebay.com/w/2011/06/07/forked/) like
209
+ [process supervisors](https://github.com/wrmsr/omlish/blob/master/ominfra/supervisor).
210
+
211
+ - **[jmespath](https://github.com/wrmsr/omlish/blob/master/omlish/specs/jmespath)** - A vendoring of
212
+ [jmespath community edition](https://github.com/jmespath-community/python-jmespath), modernized and adapted to this
213
+ codebase.
214
+
215
+ - **[marshal](https://github.com/wrmsr/omlish/blob/master/omlish/marshal)** - A
216
+ [jackson](https://github.com/FasterXML/jackson)-style serde system.
217
+
218
+ - **[manifests](https://github.com/wrmsr/omlish/blob/master/omlish/manifests)** - A system for sharing lightweight
219
+ metadata within / across codebases.
220
+
221
+ - **[reflect](https://github.com/wrmsr/omlish/blob/master/omlish/reflect)** - Reflection utilities, including primarily
222
+ a formalization of stdlib type annotations for use at runtime, decoupled from stdlib impl detail. Keeping this working
223
+ is notoriously difficult across python versions (one of the primary reasons for only supporting 3.13+).
224
+
225
+ - **[sql](https://github.com/wrmsr/omlish/blob/master/omlish/sql)** - A collection of SQL utilities, including:
226
+
227
+ - **[alchemy](https://github.com/wrmsr/omlish/blob/master/omlish/sql/alchemy)** - SQLAlchemy utilities. The codebase
228
+ is moving away from SQLAlchemy however in favor of its own internal SQL api.
229
+ - **[api](https://github.com/wrmsr/omlish/blob/master/omlish/sql/api)** - An abstracted api for SQL interaction, with
230
+ support for dbapi compatible drivers (and a SQLAlchemy adapter).
231
+ - **[queries](https://github.com/wrmsr/omlish/blob/master/omlish/sql/queries)** - A SQL query builder with a fluent
232
+ interface.
233
+
234
+ - **[testing](https://github.com/wrmsr/omlish/blob/master/omlish/testing)** - Test - primarily pytest - helpers,
235
+ including:
236
+
237
+ - **['harness'](https://github.com/wrmsr/omlish/blob/master/omlish/testing/pytest/inject/harness.py)** - An all-in-one
238
+ fixture marrying it to the codebase's dependency injector.
239
+ - **[plugins/async](https://github.com/wrmsr/omlish/blob/master/omlish/testing/pytest/plugins/asyncs)** - An in-house
240
+ async-backend abstraction plugin, capable of handling all of asyncio / trio / trio-asyncio /
241
+ *any-future-event-loop-impl* without having multiple fighting plugins (*[I know, I know](https://xkcd.com/927/)*).
242
+ - **[plugins](https://github.com/wrmsr/omlish/blob/master/omlish/testing/pytest/plugins)** - Various other plugins.
243
+
244
+ - **[lite](https://github.com/wrmsr/omlish/blob/master/omlish/lite)** - The standard library of 'lite' code. This is the
245
+ only package beneath `lang`, and parts of it are re-exported by it for deduplication. On top of miscellaneous
246
+ utilities it contains a handful of independent, self-contained, significantly simplified 'lite' equivalents of some
247
+ major core packages:
248
+
249
+ - **[lite/inject.py](https://github.com/wrmsr/omlish/blob/master/omlish/lite/inject.py)** - The lite injector, which
250
+ is more conservative with features and reflection than the core injector. The codebase's
251
+ [MiniGuice](https://github.com/google/guice/commit/70248eafa90cd70a68b293763e53f6aec656e73c).
252
+ - **[lite/marshal.py](https://github.com/wrmsr/omlish/blob/master/omlish/lite/marshal.py)** - The lite marshalling
253
+ system, which is a classic canned setup of simple type-specific 2-method classes and limited generic handling.
254
+
255
+ # Lite code
256
+
257
+ A subset of this codebase is written in a 'lite' style (non-'lite' code is referred to as *standard* code). While
258
+ standard code is written for python 3.13+, 'lite' code is written for 3.8+, and is written in a style conducive to
259
+ [amalgamation](https://github.com/wrmsr/omlish/blob/master/omdev#amalgamation) in which multiple python source files are
260
+ stitched together into one single self-contained python script.
261
+
262
+ Code written in this style has notable differences from standard code, including (but not limited to):
263
+
264
+ - No name mangling is done in amalgamation, which means (among other things) that code must be written expecting to be
265
+ all dumped into the same giant namespace. Where a standard class might be
266
+ [`omlish.inject.keys.Key`](https://github.com/wrmsr/omlish/blob/master/omlish/inject/keys.py), a lite equivalent might
267
+ be [`omlish.lite.inject.InjectorKey`](https://github.com/wrmsr/omlish/blob/master/omlish/lite/inject.py).
268
+ - All internal imports `import` each individual item out of modules rather than importing the modules and referencing
269
+ their contents. Where standard code would `from .. import x; x.y`, lite code would `from ..x import y; y`. As a result
270
+ there are frequently 'api' non-instantiated namespace classes serving the purpose of modules - just handy bags of
271
+ stuff with shortened names.
272
+ - As lite code is tested in 3.8+ but core code requires 3.13+, packages containing lite code can't import anything
273
+ standard in their (and their ancestors') `__init__.py`'s. Furthermore, `__init__.py` files are omitted outright in
274
+ amalgamation, so they effectively must be empty in any package containing any lite code. As a result there are
275
+ frequently [`all.py`](https://github.com/wrmsr/omlish/blob/master/omlish/configs/all.py) files in mixed-lite packages
276
+ which serve the purpose of `__init__.py` for standard usage - where importing standard packages from standard code
277
+ would be done via `from .. import lang`, importing mixed-lite packages from standard code would be done via
278
+ `from ..configs import all as cfgs`.
279
+
280
+ # Dependencies
281
+
282
+ This library has no required dependencies of any kind, but there are numerous optional integrations - see
283
+ [`__about__.py`](https://github.com/wrmsr/omlish/blob/master/omlish/__about__.py) for a full list, but some specific
284
+ examples are:
285
+
286
+ - **anyio** - While lite code must use only asyncio, non-trivial async standard code prefers to be written to anyio.
287
+ - **pytest** - What is used for all standard testing - as lite code has no dependencies of any kind its testing uses
288
+ stdlib's [unittest](https://docs.python.org/3/library/unittest.html).
289
+ - **asttokens / executing** - For getting runtime source representations of function call arguments, an optional
290
+ capability of [check](https://github.com/wrmsr/omlish/blob/master/omlish/check.py).
291
+ - **wrapt** - For (optionally-enabled) injector circular proxies.
292
+ - **greenlet** - For some gnarly stuff like the
293
+ [sync<->async bridge](https://github.com/wrmsr/omlish/blob/master/omlish/asyncs/bridge.py) and the
294
+ [io trampoline](https://github.com/wrmsr/omlish/blob/master/omlish/io/trampoline.py).
295
+ - **sqlalchemy** - Parts of the codebase use SQLAlchemy for db stuff, but it is being migrated away from in favor of the
296
+ internal api. It will however likely still remain as an optional dep for the api adapter.
297
+
298
+ Additionally, some catchall dep categories include:
299
+
300
+ - **compression** - Various preferred compression backends like lz4, python-snappy, zstandard, and brotli.
301
+ - **formats** - Various preferred data format backends like orjson/ujson, pyyaml, cbor2, and cloudpickle.
302
+ - **sql drivers** - Various preferred and tested sql drivers.
@@ -1,5 +1,5 @@
1
1
  omlish/.manifests.json,sha256=aT8yZ-Zh-9wfHl5Ym5ouiWC1i0cy7Q7RlhzavB6VLPI,8587
2
- omlish/__about__.py,sha256=-DbjDvgqe02JsxIgL09pN_yzW3I3ZTmjXb0au6bPnpc,3479
2
+ omlish/__about__.py,sha256=Yil-QN8yQQLqT5l8X5v9Sl63EhaDi8gETS8Kj8YbX8o,3543
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
@@ -355,25 +355,26 @@ omlish/http/coro/server/fdio.py,sha256=qZE4g5y4XESsTObSKyVggI-yzig57gSGJb4Z0rcHv
355
355
  omlish/http/coro/server/server.py,sha256=5gvueSCUzqBqQRf0GJ6wGroD9DiWxQNi6N17MlEtBLU,18660
356
356
  omlish/http/coro/server/simple.py,sha256=j1RZ3niKrgGM2qFnjdYWn_eniZzay5j49Ca4L3u8vO4,3296
357
357
  omlish/http/coro/server/sockets.py,sha256=24gU6wpIZuzYWKQD8UsHyYfTZlbcUFvkqXq5KVgWpQo,2261
358
- omlish/inject/__init__.py,sha256=pY-A8Q4v08-Xa4a-XdZ3lSFC3OwCO2T9HhesB67Q4tQ,1895
359
- omlish/inject/binder.py,sha256=3-6KMOcSgFE5bvthy3YUrRzCX5w7YSGmdJ3Tv2yXZGw,4022
358
+ omlish/inject/__init__.py,sha256=Ou6_wAovmxOpbdhGKsV8GbYRH0_S_h0XQSBDPeYpP0g,1978
359
+ omlish/inject/binder.py,sha256=woOK7I5fk4K4kDF684Ia003jE_lviGQXacNKAmXqx5M,5114
360
360
  omlish/inject/bindings.py,sha256=PlvOnUREjvc6F8nOJdzl1k9SAf80icRB4qWFqDop87M,536
361
361
  omlish/inject/eagers.py,sha256=JBY7PcjXt-Rg9scQ1ol9xpcoTLXkXC_Ie9uwTWdzUkA,340
362
362
  omlish/inject/elements.py,sha256=y4luEO_-eOlVnLcUDiNGSyMXee4pusl46ZGr0JFhbcY,1405
363
363
  omlish/inject/errors.py,sha256=_wkN2tF55gQzmMOMKJC_9jYHBZzaBiCDcyqI9Sf2UZs,626
364
364
  omlish/inject/injector.py,sha256=fyvaRoJXo_oibx1_IiGkncP9oXnZSKtDm7-ULNKRXHE,1071
365
365
  omlish/inject/inspect.py,sha256=Uq4KMloGWF_YS2mgZbrx-JXhZQnYHHKJSr68i9yoBVc,597
366
- omlish/inject/keys.py,sha256=bkpaE_hXFZ1pX8xPU_Km4jPJh8rkk07fs5aA_8bpC5M,665
366
+ omlish/inject/keys.py,sha256=7jnI2cw7cvLlzZAfe5SC50O3oPOpOB6iGZGTigyfQvs,682
367
367
  omlish/inject/listeners.py,sha256=wyPsAJsl45fZHmrFwsVBxaCiT7r_Riw1I8Eowwg5NHE,592
368
368
  omlish/inject/managed.py,sha256=-9aBm1vRPOjNz4kgOmpt8S2T55s727t9RiggFBH8maU,2096
369
- omlish/inject/multis.py,sha256=JzHTBr9LTy7hRTSax9GOo0Lxw7fk401uRgeHm8Mv4d8,3357
369
+ omlish/inject/multis.py,sha256=Dn63jE8P5ahSKc1IDBdzzx6ByBCgVOth5t4frG9m4UA,3336
370
370
  omlish/inject/origins.py,sha256=-qXa18rIIkNwBdTrvASRDjgPYnoY6n6OPC222jJDrXg,551
371
371
  omlish/inject/overrides.py,sha256=ybEcq9cDf6kvqu5mqnwi6Evj0MFjKNeE3r0oUlGw5E4,546
372
372
  omlish/inject/privates.py,sha256=CyE-hvQ-F_uyCzcwfdiYVtfm9IF1WZvMDOYilFyZmWk,658
373
373
  omlish/inject/providers.py,sha256=GDjSEN6iLsc-Tdu_OCPvFHWu4yP0Vn0pAyH_xjw1DPg,783
374
374
  omlish/inject/scopes.py,sha256=MqGus6vCogQVRJlZUnoXFwEeHuGMSYv2NF23_OFxWHE,1995
375
+ omlish/inject/tags.py,sha256=gRDLa-WdZc9DC7KwwmoIPAi8g_qdGpRWuMT7HCd7CL0,433
375
376
  omlish/inject/types.py,sha256=Z-ZEdgtCpHBNrbxxKaMVvfeD7hYXdL4rC7A9_VGxZ6g,256
376
- omlish/inject/utils.py,sha256=5Xm6LEelY7QujhMK7oD5vqEtY7Ymg_oG1Y-ZdEGD3bc,592
377
+ omlish/inject/utils.py,sha256=Gc2qq45KgkyqDt03WSvOEZBCiuqQ6ESwplx5ZRBcY5M,413
377
378
  omlish/inject/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
378
379
  omlish/inject/impl/bindings.py,sha256=xSvUcoDz8NH-aNHPwBPEZsFg73K2WcF_A63npVbGt_k,420
379
380
  omlish/inject/impl/elements.py,sha256=PM_055moROskSTQqmohEa6I0tt1OQ-VRNArXCMG6vyk,5947
@@ -504,7 +505,7 @@ omlish/logs/timing.py,sha256=qsQ3DB6swts1pxrFlmLWQzhH-3nzDrq1MUu7PxjjUyU,1519
504
505
  omlish/logs/utils.py,sha256=OkFWf1exmWImmT7BaSiIC7c0Fk9tAis-PRqo8H4ny3c,398
505
506
  omlish/manifests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
506
507
  omlish/manifests/base.py,sha256=5CmayiuzdXXv9hB5tDnWqfAosAoEQ26YG0B-emkiTXU,941
507
- omlish/manifests/load.py,sha256=NLpD8eBz078MNjQ9bEafhbpPBPfM_cVQVnkdmtQv7Gk,7666
508
+ omlish/manifests/load.py,sha256=baPBZJRSmFVH9lWlWXAredmJFFYc3X0W2C6Z8a4M05E,7734
508
509
  omlish/manifests/static.py,sha256=7YwOVh_Ek9_aTrWsWNO8kWS10_j4K7yv3TpXZSHsvDY,501
509
510
  omlish/manifests/types.py,sha256=5hQuY-WZ9VMqHZXr-9Dayg380JsnX2vJzXyw6vC6UDs,317
510
511
  omlish/marshal/__init__.py,sha256=QeWqXKb6_Jk8vpX9Z-apWlM3nUbJY3uCPOm0k8Lw8b8,3584
@@ -890,9 +891,9 @@ omlish/typedvalues/marshal.py,sha256=AtBz7Jq-BfW8vwM7HSxSpR85JAXmxK2T0xDblmm1HI0
890
891
  omlish/typedvalues/of_.py,sha256=UXkxSj504WI2UrFlqdZJbu2hyDwBhL7XVrc2qdR02GQ,1309
891
892
  omlish/typedvalues/reflect.py,sha256=PAvKW6T4cW7u--iX80w3HWwZUS3SmIZ2_lQjT65uAyk,1026
892
893
  omlish/typedvalues/values.py,sha256=ym46I-q2QJ_6l4UlERqv3yj87R-kp8nCKMRph0xQ3UA,1307
893
- omlish-0.0.0.dev381.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
894
- omlish-0.0.0.dev381.dist-info/METADATA,sha256=1yVdXIDoTT1W06OUpeqhGjLyUOCOT_GEDMOTVjI78jU,4420
895
- omlish-0.0.0.dev381.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
896
- omlish-0.0.0.dev381.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
897
- omlish-0.0.0.dev381.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
898
- omlish-0.0.0.dev381.dist-info/RECORD,,
894
+ omlish-0.0.0.dev383.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
895
+ omlish-0.0.0.dev383.dist-info/METADATA,sha256=fYxhjZpQl76w3-2r6HEE2Bqwpv02nDe9vtEA664UhRA,18825
896
+ omlish-0.0.0.dev383.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
897
+ omlish-0.0.0.dev383.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
898
+ omlish-0.0.0.dev383.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
899
+ omlish-0.0.0.dev383.dist-info/RECORD,,
@@ -1,106 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: omlish
3
- Version: 0.0.0.dev381
4
- Summary: omlish
5
- Author: wrmsr
6
- License: BSD-3-Clause
7
- Project-URL: source, https://github.com/wrmsr/omlish
8
- Classifier: License :: OSI Approved :: BSD License
9
- Classifier: Development Status :: 2 - Pre-Alpha
10
- Classifier: Intended Audience :: Developers
11
- Classifier: Operating System :: OS Independent
12
- Classifier: Operating System :: POSIX
13
- Requires-Python: >=3.13
14
- License-File: LICENSE
15
- Provides-Extra: all
16
- Requires-Dist: anyio~=4.10; extra == "all"
17
- Requires-Dist: sniffio~=1.3; extra == "all"
18
- Requires-Dist: greenlet~=3.2; extra == "all"
19
- Requires-Dist: trio~=0.30; extra == "all"
20
- Requires-Dist: trio-asyncio~=0.15; extra == "all"
21
- Requires-Dist: lz4~=4.4; extra == "all"
22
- Requires-Dist: python-snappy~=0.7; extra == "all"
23
- Requires-Dist: zstandard~=0.23; extra == "all"
24
- Requires-Dist: brotli~=1.1; extra == "all"
25
- Requires-Dist: asttokens~=3.0; extra == "all"
26
- Requires-Dist: executing~=2.2; extra == "all"
27
- Requires-Dist: psutil~=7.0; extra == "all"
28
- Requires-Dist: orjson~=3.11; extra == "all"
29
- Requires-Dist: ujson~=5.10; extra == "all"
30
- Requires-Dist: pyyaml~=6.0; extra == "all"
31
- Requires-Dist: cbor2~=5.6; extra == "all"
32
- Requires-Dist: cloudpickle~=3.1; extra == "all"
33
- Requires-Dist: httpx[http2]~=0.28; extra == "all"
34
- Requires-Dist: wrapt~=1.17; extra == "all"
35
- Requires-Dist: cryptography~=45.0; extra == "all"
36
- Requires-Dist: sqlalchemy[asyncio]~=2.0; extra == "all"
37
- Requires-Dist: pg8000~=1.31; extra == "all"
38
- Requires-Dist: pymysql~=1.1; extra == "all"
39
- Requires-Dist: aiomysql~=0.2; extra == "all"
40
- Requires-Dist: aiosqlite~=0.21; extra == "all"
41
- Requires-Dist: asyncpg~=0.30; extra == "all"
42
- Requires-Dist: apsw~=3.50; extra == "all"
43
- Requires-Dist: sqlean.py~=3.49; extra == "all"
44
- Requires-Dist: duckdb~=1.3; extra == "all"
45
- Requires-Dist: markupsafe~=3.0; extra == "all"
46
- Requires-Dist: jinja2~=3.1; extra == "all"
47
- Requires-Dist: pytest~=8.4; extra == "all"
48
- Requires-Dist: anyio~=4.10; extra == "all"
49
- Requires-Dist: sniffio~=1.3; extra == "all"
50
- Requires-Dist: asttokens~=3.0; extra == "all"
51
- Requires-Dist: executing~=2.2; extra == "all"
52
- Requires-Dist: orjson~=3.11; extra == "all"
53
- Requires-Dist: pyyaml~=6.0; extra == "all"
54
- Requires-Dist: wrapt~=1.17; extra == "all"
55
- Provides-Extra: async
56
- Requires-Dist: anyio~=4.10; extra == "async"
57
- Requires-Dist: sniffio~=1.3; extra == "async"
58
- Requires-Dist: greenlet~=3.2; extra == "async"
59
- Requires-Dist: trio~=0.30; extra == "async"
60
- Requires-Dist: trio-asyncio~=0.15; extra == "async"
61
- Provides-Extra: compress
62
- Requires-Dist: lz4~=4.4; extra == "compress"
63
- Requires-Dist: python-snappy~=0.7; extra == "compress"
64
- Requires-Dist: zstandard~=0.23; extra == "compress"
65
- Requires-Dist: brotli~=1.1; extra == "compress"
66
- Provides-Extra: diag
67
- Requires-Dist: asttokens~=3.0; extra == "diag"
68
- Requires-Dist: executing~=2.2; extra == "diag"
69
- Requires-Dist: psutil~=7.0; extra == "diag"
70
- Provides-Extra: formats
71
- Requires-Dist: orjson~=3.11; extra == "formats"
72
- Requires-Dist: ujson~=5.10; extra == "formats"
73
- Requires-Dist: pyyaml~=6.0; extra == "formats"
74
- Requires-Dist: cbor2~=5.6; extra == "formats"
75
- Requires-Dist: cloudpickle~=3.1; extra == "formats"
76
- Provides-Extra: http
77
- Requires-Dist: httpx[http2]~=0.28; extra == "http"
78
- Provides-Extra: misc
79
- Requires-Dist: wrapt~=1.17; extra == "misc"
80
- Provides-Extra: secrets
81
- Requires-Dist: cryptography~=45.0; extra == "secrets"
82
- Provides-Extra: sqlalchemy
83
- Requires-Dist: sqlalchemy[asyncio]~=2.0; extra == "sqlalchemy"
84
- Provides-Extra: sqldrivers
85
- Requires-Dist: pg8000~=1.31; extra == "sqldrivers"
86
- Requires-Dist: pymysql~=1.1; extra == "sqldrivers"
87
- Requires-Dist: aiomysql~=0.2; extra == "sqldrivers"
88
- Requires-Dist: aiosqlite~=0.21; extra == "sqldrivers"
89
- Requires-Dist: asyncpg~=0.30; extra == "sqldrivers"
90
- Requires-Dist: apsw~=3.50; extra == "sqldrivers"
91
- Requires-Dist: sqlean.py~=3.49; extra == "sqldrivers"
92
- Requires-Dist: duckdb~=1.3; extra == "sqldrivers"
93
- Provides-Extra: templates
94
- Requires-Dist: markupsafe~=3.0; extra == "templates"
95
- Requires-Dist: jinja2~=3.1; extra == "templates"
96
- Provides-Extra: testing
97
- Requires-Dist: pytest~=8.4; extra == "testing"
98
- Provides-Extra: plus
99
- Requires-Dist: anyio~=4.10; extra == "plus"
100
- Requires-Dist: sniffio~=1.3; extra == "plus"
101
- Requires-Dist: asttokens~=3.0; extra == "plus"
102
- Requires-Dist: executing~=2.2; extra == "plus"
103
- Requires-Dist: orjson~=3.11; extra == "plus"
104
- Requires-Dist: pyyaml~=6.0; extra == "plus"
105
- Requires-Dist: wrapt~=1.17; extra == "plus"
106
- Dynamic: license-file