omlish 0.0.0.dev4__tar.gz → 0.0.0.dev5__tar.gz

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.

Files changed (223) hide show
  1. {omlish-0.0.0.dev4/omlish.egg-info → omlish-0.0.0.dev5}/PKG-INFO +1 -1
  2. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/__about__.py +1 -1
  3. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/__init__.py +1 -1
  4. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/asyncs/__init__.py +1 -4
  5. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/asyncs/anyio.py +66 -0
  6. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/asyncs/flavors.py +27 -1
  7. omlish-0.0.0.dev5/omlish/asyncs/trio_asyncio.py +47 -0
  8. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/c3.py +1 -1
  9. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/cached.py +1 -2
  10. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/__init__.py +4 -1
  11. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/cache/impl.py +1 -1
  12. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/utils.py +38 -6
  13. omlish-0.0.0.dev5/omlish/configs/__init__.py +5 -0
  14. omlish-0.0.0.dev5/omlish/configs/classes.py +53 -0
  15. omlish-0.0.0.dev5/omlish/configs/dotenv.py +586 -0
  16. omlish-0.0.0.dev5/omlish/configs/props.py +604 -0
  17. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/api.py +1 -1
  18. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/fields.py +1 -0
  19. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/main.py +1 -0
  20. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/metaclass.py +6 -1
  21. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/reflect.py +15 -2
  22. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/defs.py +1 -1
  23. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/diag/procfs.py +29 -1
  24. omlish-0.0.0.dev5/omlish/diag/procstats.py +32 -0
  25. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/diag/replserver/console.py +3 -3
  26. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/diag/replserver/server.py +6 -5
  27. omlish-0.0.0.dev5/omlish/diag/threads.py +86 -0
  28. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/docker.py +19 -0
  29. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/fnpairs.py +26 -18
  30. omlish-0.0.0.dev5/omlish/graphs/dags.py +113 -0
  31. omlish-0.0.0.dev5/omlish/graphs/domination.py +268 -0
  32. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/graphs/trees.py +2 -2
  33. omlish-0.0.0.dev5/omlish/http/__init__.py +25 -0
  34. omlish-0.0.0.dev5/omlish/http/asgi.py +131 -0
  35. omlish-0.0.0.dev5/omlish/http/consts.py +47 -0
  36. omlish-0.0.0.dev5/omlish/http/cookies.py +194 -0
  37. omlish-0.0.0.dev5/omlish/http/dates.py +70 -0
  38. omlish-0.0.0.dev5/omlish/http/encodings.py +6 -0
  39. omlish-0.0.0.dev5/omlish/http/json.py +273 -0
  40. omlish-0.0.0.dev5/omlish/http/sessions.py +197 -0
  41. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/__init__.py +8 -2
  42. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/bindings.py +3 -3
  43. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/exceptions.py +3 -3
  44. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/impl/elements.py +33 -24
  45. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/impl/injector.py +1 -0
  46. omlish-0.0.0.dev5/omlish/inject/impl/multis.py +74 -0
  47. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/impl/providers.py +19 -39
  48. {omlish-0.0.0.dev4/omlish/inject → omlish-0.0.0.dev5/omlish/inject/impl}/proxy.py +2 -2
  49. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/impl/scopes.py +1 -0
  50. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/injector.py +1 -0
  51. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/keys.py +3 -9
  52. omlish-0.0.0.dev5/omlish/inject/multis.py +70 -0
  53. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/providers.py +23 -23
  54. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/scopes.py +7 -3
  55. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/types.py +0 -8
  56. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/iterators.py +13 -0
  57. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/json.py +2 -1
  58. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/__init__.py +4 -0
  59. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/classes/restrict.py +1 -1
  60. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/classes/virtual.py +2 -2
  61. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/contextmanagers.py +64 -0
  62. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/datetimes.py +6 -5
  63. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/functions.py +10 -0
  64. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/imports.py +11 -2
  65. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/typing.py +1 -0
  66. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/logs/utils.py +1 -1
  67. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/datetimes.py +1 -1
  68. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/reflect.py +8 -2
  69. omlish-0.0.0.dev5/omlish/sync.py +70 -0
  70. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/term.py +6 -1
  71. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/pytest/__init__.py +5 -0
  72. omlish-0.0.0.dev5/omlish/testing/pytest/helpers.py +11 -0
  73. omlish-0.0.0.dev4/omlish/testing/pytest/helpers.py → omlish-0.0.0.dev5/omlish/testing/pytest/marks.py +22 -9
  74. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/pytest/plugins/__init__.py +2 -0
  75. omlish-0.0.0.dev5/omlish/testing/pytest/plugins/managermarks.py +60 -0
  76. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/testing.py +10 -0
  77. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/text/delimit.py +4 -0
  78. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5/omlish.egg-info}/PKG-INFO +1 -1
  79. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish.egg-info/SOURCES.txt +18 -1
  80. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/pyproject.toml +24 -14
  81. omlish-0.0.0.dev4/omlish/asyncs/trio_asyncio.py +0 -41
  82. omlish-0.0.0.dev4/omlish/configs/props.py +0 -64
  83. omlish-0.0.0.dev4/omlish/http/consts.py +0 -20
  84. omlish-0.0.0.dev4/omlish/inject/impl/__init__.py +0 -0
  85. omlish-0.0.0.dev4/omlish/text/__init__.py +0 -0
  86. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/LICENSE +0 -0
  87. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/MANIFEST.in +0 -0
  88. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/README.md +0 -0
  89. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/argparse.py +0 -0
  90. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/asyncs/asyncio.py +0 -0
  91. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/asyncs/asyncs.py +0 -0
  92. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/asyncs/futures.py +0 -0
  93. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/asyncs/trio.py +0 -0
  94. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/check.py +0 -0
  95. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/_abc.py +0 -0
  96. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/_io_abc.py +0 -0
  97. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/cache/__init__.py +0 -0
  98. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/cache/descriptor.py +0 -0
  99. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/cache/types.py +0 -0
  100. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/coerce.py +0 -0
  101. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/frozen.py +0 -0
  102. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/identity.py +0 -0
  103. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/indexed.py +1 -1
  104. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/mappings.py +0 -0
  105. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/ordered.py +0 -0
  106. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/persistent.py +0 -0
  107. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/skiplist.py +0 -0
  108. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/sorted.py +0 -0
  109. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/treap.py +0 -0
  110. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/treapmap.py +0 -0
  111. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/collections/unmodifiable.py +0 -0
  112. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/configs/flattening.py +0 -0
  113. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/__init__.py +0 -0
  114. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/__init__.py +0 -0
  115. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/as_.py +1 -1
  116. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/exceptions.py +0 -0
  117. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/frozen.py +0 -0
  118. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/hashing.py +0 -0
  119. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/init.py +1 -1
  120. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/internals.py +0 -0
  121. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/metadata.py +0 -0
  122. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/order.py +1 -1
  123. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/params.py +0 -0
  124. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/processing.py +0 -0
  125. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/replace.py +0 -0
  126. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/repr.py +0 -0
  127. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/simple.py +0 -0
  128. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/slots.py +0 -0
  129. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dataclasses/impl/utils.py +0 -0
  130. {omlish-0.0.0.dev4/omlish/configs → omlish-0.0.0.dev5/omlish/diag}/__init__.py +0 -0
  131. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/diag/ps.py +0 -0
  132. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/diag/replserver/__init__.py +0 -0
  133. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/diag/replserver/__main__.py +0 -0
  134. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dispatch/__init__.py +0 -0
  135. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dispatch/dispatch.py +0 -0
  136. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dispatch/functions.py +0 -0
  137. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dispatch/methods.py +0 -0
  138. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/dynamic.py +0 -0
  139. {omlish-0.0.0.dev4/omlish/diag → omlish-0.0.0.dev5/omlish/graphs}/__init__.py +0 -0
  140. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/graphs/dot/__init__.py +0 -0
  141. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/graphs/dot/items.py +0 -0
  142. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/graphs/dot/rendering.py +0 -0
  143. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/graphs/dot/utils.py +0 -0
  144. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/http/wsgi.py +0 -0
  145. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/binder.py +0 -0
  146. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/eagers.py +0 -0
  147. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/elements.py +0 -0
  148. {omlish-0.0.0.dev4/omlish/graphs → omlish-0.0.0.dev5/omlish/inject/impl}/__init__.py +0 -0
  149. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/impl/bindings.py +0 -0
  150. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/impl/inspect.py +0 -0
  151. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/impl/private.py +0 -0
  152. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/inspect.py +0 -0
  153. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/managed.py +0 -0
  154. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/overrides.py +0 -0
  155. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/inject/private.py +0 -0
  156. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/cached.py +0 -0
  157. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/classes/__init__.py +0 -0
  158. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/classes/abstract.py +0 -0
  159. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/classes/simple.py +0 -0
  160. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/clsdct.py +0 -0
  161. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/cmp.py +0 -0
  162. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/descriptors.py +0 -0
  163. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/exceptions.py +0 -0
  164. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/iterables.py +0 -0
  165. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/maybes.py +0 -0
  166. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/objects.py +0 -0
  167. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/resolving.py +0 -0
  168. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/strings.py +0 -0
  169. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/sys.py +0 -0
  170. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/lang/timeouts.py +0 -0
  171. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/libc.py +0 -0
  172. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/logs/__init__.py +0 -0
  173. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/logs/_abc.py +0 -0
  174. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/logs/configs.py +0 -0
  175. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/logs/filters.py +0 -0
  176. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/logs/formatters.py +0 -0
  177. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/__init__.py +0 -0
  178. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/any.py +0 -0
  179. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/base.py +0 -0
  180. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/base64.py +0 -0
  181. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/dataclasses.py +0 -0
  182. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/enums.py +0 -0
  183. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/exceptions.py +0 -0
  184. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/factories.py +0 -0
  185. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/global_.py +0 -0
  186. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/iterables.py +0 -0
  187. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/mappings.py +0 -0
  188. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/naming.py +0 -0
  189. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/objects.py +0 -0
  190. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/optionals.py +0 -0
  191. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/polymorphism.py +0 -0
  192. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/primitives.py +0 -0
  193. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/registries.py +0 -0
  194. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/standard.py +0 -0
  195. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/utils.py +0 -0
  196. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/uuids.py +0 -0
  197. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/marshal/values.py +0 -0
  198. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/math.py +0 -0
  199. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/os.py +0 -0
  200. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/runmodule.py +0 -0
  201. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/sql/__init__.py +0 -0
  202. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/sql/_abc.py +0 -0
  203. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/sql/asyncs.py +0 -0
  204. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/sql/dbs.py +0 -0
  205. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/stats.py +0 -0
  206. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/__init__.py +0 -0
  207. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/pydevd.py +0 -0
  208. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/pytest/inject/__init__.py +0 -0
  209. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/pytest/inject/harness.py +1 -1
  210. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/pytest/plugins/_registry.py +0 -0
  211. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/pytest/plugins/logging.py +0 -0
  212. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/pytest/plugins/pydevd.py +0 -0
  213. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/pytest/plugins/repeat.py +0 -0
  214. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/pytest/plugins/skips.py +0 -0
  215. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/pytest/plugins/spacing.py +0 -0
  216. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/testing/pytest/plugins/switches.py +0 -0
  217. {omlish-0.0.0.dev4/omlish/http → omlish-0.0.0.dev5/omlish/text}/__init__.py +0 -0
  218. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/text/indent.py +0 -0
  219. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish/text/parts.py +0 -0
  220. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish.egg-info/dependency_links.txt +0 -0
  221. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish.egg-info/requires.txt +0 -0
  222. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/omlish.egg-info/top_level.txt +0 -0
  223. {omlish-0.0.0.dev4 → omlish-0.0.0.dev5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omlish
3
- Version: 0.0.0.dev4
3
+ Version: 0.0.0.dev5
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -3,4 +3,4 @@ __url__ = 'https://github.com/wrmsr/omlish'
3
3
  __license__ = 'BSD-3-Clause'
4
4
  __requires_python__ = '>=3.12'
5
5
 
6
- __version__ = '0.0.0.dev4'
6
+ __version__ = '0.0.0.dev5'
@@ -5,4 +5,4 @@ REQUIRED_PYTHON_VERSION = (3, 12)
5
5
 
6
6
 
7
7
  if _sys.version_info < REQUIRED_PYTHON_VERSION:
8
- raise EnvironmentError(f'Python version {_sys.version_info=} < {REQUIRED_PYTHON_VERSION}')
8
+ raise RuntimeError(f'Python version {_sys.version_info=} < {REQUIRED_PYTHON_VERSION}')
@@ -22,6 +22,7 @@ from .flavors import ( # noqa
22
22
  mark_asyncio,
23
23
  mark_flavor,
24
24
  mark_trio,
25
+ with_adapter_loop,
25
26
  )
26
27
 
27
28
  from .futures import ( # noqa
@@ -32,7 +33,3 @@ from .futures import ( # noqa
32
33
  wait_dependent_futures,
33
34
  wait_futures,
34
35
  )
35
-
36
- from .trio_asyncio import ( # noqa
37
- with_trio_asyncio_loop,
38
- )
@@ -1,4 +1,9 @@
1
1
  """
2
+ TODO:
3
+ - bane
4
+ - owned lock
5
+ - async once
6
+
2
7
  lookit:
3
8
  - https://github.com/davidbrochart/sqlite-anyio/blob/a3ba4c6ef0535b14a5a60071fcd6ed565a514963/sqlite_anyio/sqlite.py
4
9
  - https://github.com/rafalkrupinski/ratelimit-anyio/blob/2910a8a3d6fa54ed17ee6ba457686c9f7a4c4beb/src/ratelimit_anyio/__init__.py
@@ -84,3 +89,64 @@ async def gather(*fns: ta.Callable[..., ta.Awaitable[T]], take_first: bool = Fal
84
89
 
85
90
  async def first(*fns: ta.Callable[..., ta.Awaitable[T]], **kwargs: ta.Any) -> list[lang.Maybe[T]]:
86
91
  return await gather(*fns, take_first=True, **kwargs)
92
+
93
+
94
+ ##
95
+
96
+
97
+ class Once:
98
+ def __init__(self) -> None:
99
+ super().__init__()
100
+ self._done = False
101
+ self._lock = anyio.Lock()
102
+
103
+ async def do(self, fn: ta.Callable[[], ta.Awaitable[None]]) -> bool:
104
+ if self._done:
105
+ return False
106
+ async with self._lock:
107
+ if self._done:
108
+ return False # type: ignore
109
+ try:
110
+ await fn()
111
+ finally:
112
+ self._done = True
113
+ return True
114
+
115
+
116
+ class Lazy(ta.Generic[T]):
117
+ def __init__(self) -> None:
118
+ super().__init__()
119
+ self._once = Once()
120
+ self._v: lang.Maybe[T] = lang.empty()
121
+
122
+ def peek(self) -> lang.Maybe[T]:
123
+ return self._v
124
+
125
+ def set(self, v: T) -> None:
126
+ self._v = lang.just(v)
127
+
128
+ async def get(self, fn: ta.Callable[[], ta.Awaitable[T]]) -> T:
129
+ async def do():
130
+ self._v = lang.just(await fn())
131
+ await self._once.do(do)
132
+ return self._v.must()
133
+
134
+
135
+ class LazyFn(ta.Generic[T]):
136
+ def __init__(self, fn: ta.Callable[[], ta.Awaitable[T]]) -> None:
137
+ super().__init__()
138
+ self._fn = fn
139
+ self._once = Once()
140
+ self._v: lang.Maybe[T] = lang.empty()
141
+
142
+ def peek(self) -> lang.Maybe[T]:
143
+ return self._v
144
+
145
+ def set(self, v: T) -> None:
146
+ self._v = lang.just(v)
147
+
148
+ async def get(self) -> T:
149
+ async def do():
150
+ self._v = lang.just(await self._fn())
151
+ await self._once.do(do)
152
+ return self._v.must()
@@ -7,10 +7,13 @@ TODO:
7
7
  import abc
8
8
  import dataclasses as dc
9
9
  import enum
10
+ import functools
10
11
  import typing as ta
11
12
 
12
13
  from .. import lang
13
14
  from .trio_asyncio import check_trio_asyncio
15
+ from .trio_asyncio import with_trio_asyncio_loop
16
+
14
17
 
15
18
  if ta.TYPE_CHECKING:
16
19
  import sniffio
@@ -79,7 +82,7 @@ def _get_module_flavor(p: str) -> Flavor | None:
79
82
  return pf
80
83
 
81
84
 
82
- def get_flavor(obj: ta.Any, default: ta.Union[Flavor, type[_MISSING], None] = _MISSING) -> Flavor:
85
+ def get_flavor(obj: ta.Any, default: Flavor | type[_MISSING] | None = _MISSING) -> Flavor:
83
86
  u = lang.unwrap_func(obj)
84
87
 
85
88
  try:
@@ -100,6 +103,29 @@ def get_flavor(obj: ta.Any, default: ta.Union[Flavor, type[_MISSING], None] = _M
100
103
  ##
101
104
 
102
105
 
106
+ def with_adapter_loop(*, wait=False):
107
+ def outer(fn):
108
+ @functools.wraps(fn)
109
+ async def inner(*args, **kwargs):
110
+ cur_lib = sniffio.current_async_library()
111
+
112
+ if cur_lib == 'asyncio':
113
+ await fn(*args, **kwargs)
114
+
115
+ elif cur_lib == 'trio':
116
+ await with_trio_asyncio_loop(wait=wait)(fn)(*args, **kwargs)
117
+
118
+ else:
119
+ raise RuntimeError(f'Unknown async library: {cur_lib}')
120
+
121
+ return inner
122
+
123
+ return outer
124
+
125
+
126
+ ##
127
+
128
+
103
129
  class Adapter(lang.Abstract):
104
130
  _FROM_METHODS_BY_FLAVOR: ta.ClassVar[ta.Mapping[Flavor, str]] = {
105
131
  Flavor.ANYIO: 'from_anyio',
@@ -0,0 +1,47 @@
1
+ import functools
2
+ import typing as ta
3
+
4
+ from .. import lang
5
+
6
+
7
+ if ta.TYPE_CHECKING:
8
+ import asyncio
9
+
10
+ import sniffio
11
+ import trio_asyncio
12
+ else:
13
+ asyncio = lang.proxy_import('asyncio')
14
+
15
+ sniffio = lang.proxy_import('sniffio')
16
+ trio_asyncio = lang.proxy_import('trio_asyncio')
17
+
18
+
19
+ def check_trio_asyncio() -> None:
20
+ if trio_asyncio.current_loop.get() is None:
21
+ raise RuntimeError('trio_asyncio loop not running')
22
+
23
+
24
+ def with_trio_asyncio_loop(*, wait=False):
25
+ def outer(fn):
26
+ @functools.wraps(fn)
27
+ async def inner(*args, **kwargs):
28
+ if trio_asyncio.current_loop.get() is not None:
29
+ await fn(*args, **kwargs)
30
+ return
31
+
32
+ if sniffio.current_async_library() != 'trio':
33
+ raise RuntimeError('trio loop not running')
34
+
35
+ loop: asyncio.BaseEventLoop
36
+ async with trio_asyncio.open_loop() as loop:
37
+ try:
38
+ await fn(*args, **kwargs)
39
+ finally:
40
+ if wait:
41
+ # FIXME: lol
42
+ while asyncio.all_tasks(loop):
43
+ await asyncio.sleep(.2)
44
+
45
+ return inner
46
+
47
+ return outer
@@ -144,7 +144,7 @@ def compose_mro(
144
144
 
145
145
  # Remove entries which are strict bases of other entries (they will end up in the MRO anyway.
146
146
  def is_strict_base(typ):
147
- for other in types:
147
+ for other in types: # noqa
148
148
  if typ != other and typ in (get_mro(other) or []):
149
149
  return True
150
150
  return False
@@ -1,6 +1,5 @@
1
- from .lang.cached import cached_function
2
1
  from .lang.cached import _CachedProperty # noqa
3
-
2
+ from .lang.cached import cached_function
4
3
 
5
4
  function = cached_function
6
5
 
@@ -90,9 +90,12 @@ from .utils import ( # noqa
90
90
  all_not_equal,
91
91
  indexes,
92
92
  key_cmp,
93
+ multi_map,
94
+ multi_map_by,
93
95
  mut_toposort,
94
96
  partition,
95
97
  toposort,
96
98
  unique,
97
- unique_dict,
99
+ unique_map,
100
+ unique_map_by,
98
101
  )
@@ -55,7 +55,7 @@ class CacheImpl(Cache[K, V]):
55
55
  if not ta.TYPE_CHECKING:
56
56
  from ..._ext.cy.collections.cache import CacheLink as Link
57
57
  else:
58
- raise ImportError
58
+ raise ImportError # noqa
59
59
 
60
60
  except ImportError:
61
61
  class Link:
@@ -12,6 +12,9 @@ K = ta.TypeVar('K')
12
12
  V = ta.TypeVar('V')
13
13
 
14
14
 
15
+ ##
16
+
17
+
15
18
  def mut_toposort(data: dict[T, set[T]]) -> ta.Iterator[set[T]]:
16
19
  for k, v in data.items():
17
20
  v.discard(k)
@@ -31,6 +34,9 @@ def toposort(data: ta.Mapping[T, ta.AbstractSet[T]]) -> ta.Iterator[set[T]]:
31
34
  return mut_toposort({k: set(v) for k, v in data.items()})
32
35
 
33
36
 
37
+ ##
38
+
39
+
34
40
  def partition(items: ta.Iterable[T], pred: ta.Callable[[T], bool]) -> tuple[list[T], list[T]]:
35
41
  t: list[T] = []
36
42
  f: list[T] = []
@@ -54,13 +60,36 @@ def unique(it: ta.Iterable[T], *, identity: bool = False) -> list[T]:
54
60
  return ret
55
61
 
56
62
 
57
- def unique_dict(items: ta.Iterable[tuple[K, V]], *, identity: bool = False) -> ta.MutableMapping[K, V]:
58
- dct: ta.MutableMapping[K, V] = IdentityKeyDict() if identity else {}
59
- for k, v in items:
60
- if k in dct:
63
+ def unique_map(kvs: ta.Iterable[tuple[K, V]], *, identity: bool = False) -> ta.MutableMapping[K, V]:
64
+ d: ta.MutableMapping[K, V] = IdentityKeyDict() if identity else {}
65
+ for k, v in kvs:
66
+ if k in d:
61
67
  raise KeyError(k)
62
- dct[k] = v
63
- return dct
68
+ d[k] = v
69
+ return d
70
+
71
+
72
+ def unique_map_by(fn: ta.Callable[[V], K], vs: ta.Iterable[V], *, identity: bool = False) -> ta.MutableMapping[K, V]:
73
+ return unique_map(((fn(v), v) for v in vs), identity=identity)
74
+
75
+
76
+ def multi_map(kvs: ta.Iterable[tuple[K, V]], *, identity: bool = False) -> ta.MutableMapping[K, list[V]]:
77
+ d: ta.MutableMapping[K, list[V]] = IdentityKeyDict() if identity else {}
78
+ l: list[V]
79
+ for k, v in kvs:
80
+ try:
81
+ l = d[k]
82
+ except KeyError:
83
+ l = d[k] = []
84
+ l.append(v)
85
+ return d
86
+
87
+
88
+ def multi_map_by(fn: ta.Callable[[V], K], vs: ta.Iterable[V], *, identity: bool = False) -> ta.MutableMapping[K, list[V]]: # noqa
89
+ return multi_map(((fn(v), v) for v in vs), identity=identity)
90
+
91
+
92
+ ##
64
93
 
65
94
 
66
95
  def all_equal(it: ta.Iterable[T]) -> bool:
@@ -81,6 +110,9 @@ def all_not_equal(it: ta.Iterable[T]) -> bool:
81
110
  return True
82
111
 
83
112
 
113
+ ##
114
+
115
+
84
116
  def key_cmp(fn: ta.Callable[[K, K], int]) -> ta.Callable[[tuple[K, V], tuple[K, V]], int]:
85
117
  return lambda t0, t1: fn(t0[0], t1[0])
86
118
 
@@ -0,0 +1,5 @@
1
+ from .classes import ( # noqa
2
+ Config,
3
+ Configurable,
4
+ get_impl,
5
+ )
@@ -0,0 +1,53 @@
1
+ import typing as ta
2
+ import weakref
3
+
4
+ from .. import check
5
+ from .. import dataclasses as dc
6
+ from .. import lang
7
+
8
+
9
+ class Config(
10
+ dc.Data,
11
+ lang.Abstract,
12
+ frozen=True,
13
+ reorder=True,
14
+ confer=frozenset([
15
+ 'frozen',
16
+ 'reorder',
17
+ 'confer',
18
+ ]),
19
+ ):
20
+ pass
21
+
22
+
23
+ ConfigT = ta.TypeVar('ConfigT', bound='Config')
24
+
25
+ _CONFIG_CLS_MAP: ta.MutableMapping[type[Config], type['Configurable']] = weakref.WeakValueDictionary()
26
+
27
+
28
+ class Configurable(ta.Generic[ConfigT], lang.Abstract):
29
+
30
+ # FIXME: https://github.com/python/mypy/issues/5144
31
+ Config: ta.ClassVar[type[ConfigT]] # type: ignore # noqa
32
+
33
+ def __init_subclass__(cls, **kwargs: ta.Any) -> None:
34
+ super().__init_subclass__(**kwargs)
35
+
36
+ cfg_cls = check.issubclass(cls.__dict__['Config'], Config)
37
+ check.not_in(cfg_cls, _CONFIG_CLS_MAP)
38
+ _CONFIG_CLS_MAP[cfg_cls] = cls
39
+
40
+ def __init__(self, config: ConfigT) -> None:
41
+ super().__init__()
42
+
43
+ self._config: ConfigT = check.isinstance(config, self.Config)
44
+
45
+
46
+ def get_impl(cfg: type[Config] | Config) -> type[Configurable]:
47
+ if isinstance(cfg, type):
48
+ cfg_cls = check.issubclass(cfg, Config) # noqa
49
+ elif isinstance(cfg, Config):
50
+ cfg_cls = type(cfg)
51
+ else:
52
+ raise TypeError(cfg)
53
+ return _CONFIG_CLS_MAP[cfg_cls]