omlish 0.0.0.dev0__tar.gz → 0.0.0.dev1__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 (200) hide show
  1. omlish-0.0.0.dev1/MANIFEST.in +1 -0
  2. {omlish-0.0.0.dev0/omlish.egg-info → omlish-0.0.0.dev1}/PKG-INFO +3 -3
  3. omlish-0.0.0.dev1/omlish/__about__.py +7 -0
  4. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/asyncs/__init__.py +10 -5
  5. omlish-0.0.0.dev1/omlish/asyncs/anyio.py +23 -0
  6. omlish-0.0.0.dev1/omlish/asyncs/asyncs.py +76 -0
  7. omlish-0.0.0.dev0/omlish/asyncs/asyncs.py → omlish-0.0.0.dev1/omlish/asyncs/futures.py +50 -96
  8. omlish-0.0.0.dev1/omlish/asyncs/trio.py +11 -0
  9. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/main.py +1 -1
  10. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/replace.py +8 -0
  11. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/simple.py +0 -6
  12. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/http/consts.py +6 -5
  13. omlish-0.0.0.dev1/omlish/http/wsgi.py +34 -0
  14. omlish-0.0.0.dev1/omlish/libc.py +532 -0
  15. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/replserver/server.py +9 -1
  16. omlish-0.0.0.dev1/omlish/stats.py +342 -0
  17. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pydevd.py +39 -0
  18. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1/omlish.egg-info}/PKG-INFO +3 -3
  19. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish.egg-info/SOURCES.txt +5 -5
  20. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/pyproject.toml +32 -9
  21. omlish-0.0.0.dev0/MANIFEST.in +0 -3
  22. omlish-0.0.0.dev0/omlish/__about__.py +0 -23
  23. omlish-0.0.0.dev0/omlish/asyncs/anyio.py +0 -13
  24. omlish-0.0.0.dev0/omlish/conftest.py +0 -6
  25. omlish-0.0.0.dev0/omlish/dataclasses/LICENSE +0 -279
  26. omlish-0.0.0.dev0/omlish/http/types.py +0 -42
  27. omlish-0.0.0.dev0/omlish/inject/.DS_Store +0 -0
  28. omlish-0.0.0.dev0/setup.py +0 -49
  29. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/LICENSE +0 -0
  30. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/README.md +0 -0
  31. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/__init__.py +0 -0
  32. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/argparse.py +0 -0
  33. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/asyncs/asyncio.py +0 -0
  34. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/c3.py +0 -0
  35. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/cached.py +0 -0
  36. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/check.py +0 -0
  37. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/__init__.py +0 -0
  38. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/_abc.py +0 -0
  39. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/_io_abc.py +0 -0
  40. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/cache/__init__.py +0 -0
  41. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/cache/descriptor.py +0 -0
  42. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/cache/impl.py +0 -0
  43. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/cache/types.py +0 -0
  44. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/coerce.py +0 -0
  45. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/frozen.py +0 -0
  46. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/identity.py +0 -0
  47. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/indexed.py +0 -0
  48. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/mappings.py +0 -0
  49. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/ordered.py +0 -0
  50. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/persistent.py +0 -0
  51. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/skiplist.py +0 -0
  52. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/sorted.py +0 -0
  53. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/treap.py +0 -0
  54. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/treapmap.py +0 -0
  55. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/unmodifiable.py +0 -0
  56. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/collections/utils.py +0 -0
  57. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/configs/__init__.py +0 -0
  58. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/configs/flattening.py +0 -0
  59. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/configs/props.py +0 -0
  60. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/__init__.py +0 -0
  61. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/__init__.py +0 -0
  62. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/api.py +0 -0
  63. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/as_.py +0 -0
  64. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/exceptions.py +0 -0
  65. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/fields.py +0 -0
  66. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/frozen.py +0 -0
  67. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/hashing.py +0 -0
  68. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/init.py +0 -0
  69. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/internals.py +0 -0
  70. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/metaclass.py +0 -0
  71. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/metadata.py +0 -0
  72. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/order.py +0 -0
  73. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/params.py +0 -0
  74. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/processing.py +0 -0
  75. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/reflect.py +0 -0
  76. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/repr.py +0 -0
  77. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/slots.py +0 -0
  78. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dataclasses/impl/utils.py +0 -0
  79. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/defs.py +0 -0
  80. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dispatch/__init__.py +0 -0
  81. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dispatch/dispatch.py +0 -0
  82. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dispatch/functions.py +0 -0
  83. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dispatch/methods.py +0 -0
  84. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/docker.py +0 -0
  85. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/dynamic.py +0 -0
  86. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/graphs/__init__.py +0 -0
  87. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/graphs/dot/__init__.py +0 -0
  88. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/graphs/dot/items.py +0 -0
  89. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/graphs/dot/rendering.py +0 -0
  90. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/graphs/dot/utils.py +0 -0
  91. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/graphs/trees.py +0 -0
  92. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/http/__init__.py +0 -0
  93. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/__init__.py +0 -0
  94. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/binder.py +0 -0
  95. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/bindings.py +0 -0
  96. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/eagers.py +0 -0
  97. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/elements.py +0 -0
  98. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/exceptions.py +0 -0
  99. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/impl/__init__.py +0 -0
  100. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/impl/bindings.py +0 -0
  101. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/impl/elements.py +0 -0
  102. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/impl/injector.py +0 -0
  103. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/impl/inspect.py +0 -0
  104. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/impl/private.py +0 -0
  105. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/impl/providers.py +0 -0
  106. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/impl/scopes.py +0 -0
  107. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/injector.py +0 -0
  108. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/inspect.py +0 -0
  109. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/keys.py +0 -0
  110. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/managed.py +0 -0
  111. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/overrides.py +0 -0
  112. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/private.py +0 -0
  113. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/providers.py +0 -0
  114. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/proxy.py +0 -0
  115. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/scopes.py +0 -0
  116. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/inject/types.py +0 -0
  117. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/iterators.py +0 -0
  118. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/json.py +0 -0
  119. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/__init__.py +0 -0
  120. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/cached.py +0 -0
  121. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/classes/__init__.py +0 -0
  122. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/classes/abstract.py +0 -0
  123. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/classes/restrict.py +0 -0
  124. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/classes/simple.py +0 -0
  125. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/classes/test/__init__.py +0 -0
  126. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/classes/test/test_abstract.py +0 -0
  127. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/classes/test/test_restrict.py +0 -0
  128. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/classes/test/test_simple.py +0 -0
  129. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/classes/test/test_virtual.py +0 -0
  130. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/classes/virtual.py +0 -0
  131. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/clsdct.py +0 -0
  132. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/cmp.py +0 -0
  133. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/contextmanagers.py +0 -0
  134. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/datetimes.py +0 -0
  135. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/descriptors.py +0 -0
  136. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/functions.py +0 -0
  137. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/imports.py +0 -0
  138. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/iterables.py +0 -0
  139. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/maybes.py +0 -0
  140. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/objects.py +0 -0
  141. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/resolving.py +0 -0
  142. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/strings.py +0 -0
  143. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/lang/typing.py +0 -0
  144. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/logs/__init__.py +0 -0
  145. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/logs/_abc.py +0 -0
  146. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/logs/configs.py +0 -0
  147. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/logs/filters.py +0 -0
  148. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/logs/formatters.py +0 -0
  149. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/logs/utils.py +0 -0
  150. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/__init__.py +0 -0
  151. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/any.py +0 -0
  152. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/base.py +0 -0
  153. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/base64.py +0 -0
  154. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/dataclasses.py +0 -0
  155. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/datetimes.py +0 -0
  156. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/enums.py +0 -0
  157. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/exceptions.py +0 -0
  158. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/factories.py +0 -0
  159. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/global_.py +0 -0
  160. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/iterables.py +0 -0
  161. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/mappings.py +0 -0
  162. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/naming.py +0 -0
  163. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/objects.py +0 -0
  164. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/optionals.py +0 -0
  165. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/polymorphism.py +0 -0
  166. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/primitives.py +0 -0
  167. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/registries.py +0 -0
  168. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/standard.py +0 -0
  169. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/utils.py +0 -0
  170. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/uuids.py +0 -0
  171. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/marshal/values.py +0 -0
  172. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/math.py +0 -0
  173. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/os.py +0 -0
  174. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/reflect.py +0 -0
  175. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/replserver/__init__.py +0 -0
  176. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/replserver/__main__.py +0 -0
  177. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/replserver/console.py +0 -0
  178. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/runmodule.py +0 -0
  179. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/term.py +0 -0
  180. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/__init__.py +0 -0
  181. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pytest/__init__.py +0 -0
  182. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pytest/helpers.py +0 -0
  183. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pytest/inject/__init__.py +0 -0
  184. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pytest/inject/harness.py +0 -0
  185. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pytest/plugins/__init__.py +0 -0
  186. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pytest/plugins/_registry.py +0 -0
  187. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pytest/plugins/logging.py +0 -0
  188. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pytest/plugins/pycharm.py +0 -0
  189. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pytest/plugins/repeat.py +0 -0
  190. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pytest/plugins/skips.py +0 -0
  191. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pytest/plugins/spacing.py +0 -0
  192. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/pytest/plugins/switches.py +0 -0
  193. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/testing/testing.py +0 -0
  194. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/text/__init__.py +0 -0
  195. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/text/delimit.py +0 -0
  196. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/text/indent.py +0 -0
  197. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish/text/parts.py +0 -0
  198. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish.egg-info/dependency_links.txt +0 -0
  199. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/omlish.egg-info/top_level.txt +0 -0
  200. {omlish-0.0.0.dev0 → omlish-0.0.0.dev1}/setup.cfg +0 -0
@@ -0,0 +1 @@
1
+ global-exclude **/conftest.py
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omlish
3
- Version: 0.0.0.dev0
3
+ Version: 0.0.0.dev1
4
4
  Summary: omlish
5
- Home-page: https://github.com/wrmsr/omlish
6
5
  Author: wrmsr
7
- License: BSD
6
+ License: BSD-3-Clause
7
+ Project-URL: source, https://github.com/wrmsr/omlish
8
8
  Classifier: License :: OSI Approved :: BSD License
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: Programming Language :: Python :: 3
@@ -0,0 +1,7 @@
1
+ __name__ = 'omlish'
2
+ __author__ = 'wrmsr'
3
+ __url__ = 'https://github.com/wrmsr/omlish'
4
+ __license__ = 'BSD-3-Clause'
5
+ __requires_python__ = '>=3.11'
6
+
7
+ __version__ = '0.0.0.dev1'
@@ -1,12 +1,17 @@
1
1
  from .asyncs import ( # noqa
2
- AsyncTimeoutException,
3
- FutureException,
4
- ImmediateExecutor,
5
2
  SyncableIterable,
6
3
  async_list,
7
- await_dependent_futures,
8
- await_futures,
9
4
  sync_await,
10
5
  sync_list,
11
6
  syncable_iterable,
12
7
  )
8
+
9
+
10
+ from .futures import ( # noqa
11
+ FutureException,
12
+ FutureTimeoutException,
13
+ ImmediateExecutor,
14
+ new_thread_or_immediate_executor,
15
+ wait_dependent_futures,
16
+ wait_futures,
17
+ )
@@ -0,0 +1,23 @@
1
+ """
2
+ lookit:
3
+ - https://github.com/davidbrochart/sqlite-anyio/blob/a3ba4c6ef0535b14a5a60071fcd6ed565a514963/sqlite_anyio/sqlite.py
4
+ - https://github.com/rafalkrupinski/ratelimit-anyio/blob/2910a8a3d6fa54ed17ee6ba457686c9f7a4c4beb/src/ratelimit_anyio/__init__.py
5
+ - https://github.com/nekitdev/async-extensions/tree/main/async_extensions
6
+ - https://github.com/kinnay/anynet/tree/master/anynet
7
+ - https://github.com/M-o-a-T/asyncscope
8
+ - https://github.com/M-o-a-T/aevent
9
+ - https://github.com/florimondmanca/aiometer
10
+ """ # noqa
11
+ import typing as ta
12
+
13
+ import anyio
14
+
15
+
16
+ T = ta.TypeVar('T')
17
+
18
+
19
+ async def anyio_eof_to_empty(fn: ta.Callable[..., ta.Awaitable[T]], *args: ta.Any, **kwargs: ta.Any) -> T | bytes:
20
+ try:
21
+ return await fn(*args, **kwargs)
22
+ except anyio.EndOfStream:
23
+ return b''
@@ -0,0 +1,76 @@
1
+ """
2
+ TODO:
3
+ - async<->sync greeenlet bridge
4
+ In [5]: %timeit greenlet.greenlet(f).switch()
5
+ 517 ns ± 13.2 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
6
+ - injected io provider - sync vs greenlet aio trampolined
7
+ - push/pull bridge?
8
+
9
+ https://github.com/sqlalchemy/sqlalchemy/blob/1e75c189da721395bc8c2d899c722a5b9a170404/lib/sqlalchemy/util/_concurrency_py3k.py#L83
10
+ """
11
+ import contextlib
12
+ import functools
13
+ import typing as ta
14
+
15
+
16
+ T = ta.TypeVar('T')
17
+
18
+
19
+ def sync_await(fn: ta.Callable[..., T], *args, **kwargs) -> T:
20
+ ret: ta.Any
21
+ ret = missing = object()
22
+
23
+ async def gate():
24
+ nonlocal ret
25
+ ret = await fn(*args, **kwargs) # type: ignore
26
+
27
+ cr = gate()
28
+ with contextlib.closing(cr):
29
+ try:
30
+ cr.send(None)
31
+ except StopIteration:
32
+ pass
33
+ if ret is missing or cr.cr_await is not None or cr.cr_running:
34
+ raise TypeError('Not terminated')
35
+
36
+ return ta.cast(T, ret)
37
+
38
+
39
+ def sync_list(fn: ta.Callable[..., ta.AsyncIterator[T]], *args, **kwargs) -> list[T]:
40
+ lst = None
41
+
42
+ async def inner():
43
+ nonlocal lst
44
+ lst = [v async for v in fn(*args, **kwargs)]
45
+
46
+ sync_await(inner)
47
+ if not isinstance(lst, list):
48
+ raise TypeError(lst)
49
+ return lst
50
+
51
+
52
+ async def async_list(fn: ta.Callable[..., ta.AsyncIterator[T]], *args, **kwargs) -> list[T]:
53
+ return [v async for v in fn(*args, **kwargs)]
54
+
55
+
56
+ class SyncableIterable(ta.Generic[T]):
57
+
58
+ def __init__(self, obj) -> None:
59
+ super().__init__()
60
+ self._obj = obj
61
+
62
+ def __iter__(self) -> ta.Iterator[T]:
63
+ async def inner():
64
+ async for i in self._obj:
65
+ yield i
66
+ return iter(sync_list(inner))
67
+
68
+ def __aiter__(self) -> ta.AsyncIterator[T]:
69
+ return self._obj.__aiter__()
70
+
71
+
72
+ def syncable_iterable(fn: ta.Callable[..., ta.AsyncIterator[T]]) -> ta.Callable[..., SyncableIterable[T]]:
73
+ @functools.wraps(fn)
74
+ def inner(*args, **kwargs):
75
+ return SyncableIterable(fn(*args, **kwargs))
76
+ return inner
@@ -1,104 +1,13 @@
1
- """
2
- TODO:
3
- - async<->sync greeenlet bridge
4
- In [5]: %timeit greenlet.greenlet(f).switch()
5
- 517 ns ± 13.2 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
6
- - injected io provider - sync vs greenlet aio trampolined
7
- - push/pull bridge?
8
-
9
- https://github.com/sqlalchemy/sqlalchemy/blob/1e75c189da721395bc8c2d899c722a5b9a170404/lib/sqlalchemy/util/_concurrency_py3k.py#L83
10
- """
11
1
  import concurrent.futures as cf
12
2
  import contextlib
13
- import functools
14
3
  import time
15
4
  import typing as ta
16
5
 
17
6
 
18
7
  T = ta.TypeVar('T')
19
- CallableT = ta.TypeVar('CallableT', bound=ta.Callable)
20
8
 
21
9
 
22
- def sync_await(fn: ta.Callable[..., T], *args, **kwargs) -> T:
23
- ret: ta.Any
24
- ret = missing = object()
25
-
26
- async def gate():
27
- nonlocal ret
28
- ret = await fn(*args, **kwargs) # type: ignore
29
-
30
- cr = gate()
31
- with contextlib.closing(cr):
32
- try:
33
- cr.send(None)
34
- except StopIteration:
35
- pass
36
- if ret is missing or cr.cr_await is not None or cr.cr_running:
37
- raise TypeError('Not terminated')
38
-
39
- return ta.cast(T, ret)
40
-
41
-
42
- def sync_list(fn: ta.Callable[..., ta.AsyncIterator[T]], *args, **kwargs) -> list[T]:
43
- lst = None
44
-
45
- async def inner():
46
- nonlocal lst
47
- lst = [v async for v in fn(*args, **kwargs)]
48
-
49
- sync_await(inner)
50
- if not isinstance(lst, list):
51
- raise TypeError(lst)
52
- return lst
53
-
54
-
55
- async def async_list(fn: ta.Callable[..., ta.AsyncIterator[T]], *args, **kwargs) -> list[T]:
56
- return [v async for v in fn(*args, **kwargs)]
57
-
58
-
59
- class SyncableIterable(ta.Generic[T]):
60
-
61
- def __init__(self, obj) -> None:
62
- super().__init__()
63
- self._obj = obj
64
-
65
- def __iter__(self) -> ta.Iterator[T]:
66
- async def inner():
67
- async for i in self._obj:
68
- yield i
69
- return iter(sync_list(inner))
70
-
71
- def __aiter__(self) -> ta.AsyncIterator[T]:
72
- return self._obj.__aiter__()
73
-
74
-
75
- def syncable_iterable(fn: ta.Callable[..., ta.AsyncIterator[T]]) -> ta.Callable[..., SyncableIterable[T]]:
76
- @functools.wraps(fn)
77
- def inner(*args, **kwargs):
78
- return SyncableIterable(fn(*args, **kwargs))
79
- return inner
80
-
81
-
82
- class ImmediateExecutor(cf.Executor):
83
-
84
- def __init__(self, *, immediate_exceptions: bool = False) -> None:
85
- super().__init__()
86
- self._immediate_exceptions = immediate_exceptions
87
-
88
- def submit(self, fn, *args, **kwargs):
89
- future: ta.Any = cf.Future()
90
- try:
91
- result = fn(*args, **kwargs)
92
- future.set_result(result)
93
- except Exception as e:
94
- if self._immediate_exceptions:
95
- raise
96
- future.set_exception(e)
97
- return future
98
-
99
-
100
- class AsyncTimeoutException(Exception):
101
- pass
10
+ ##
102
11
 
103
12
 
104
13
  class FutureException(Exception, ta.Generic[T]):
@@ -128,7 +37,11 @@ class FutureException(Exception, ta.Generic[T]):
128
37
  __str__ = __repr__
129
38
 
130
39
 
131
- def await_futures(
40
+ class FutureTimeoutException(Exception):
41
+ pass
42
+
43
+
44
+ def wait_futures(
132
45
  futures: ta.Sequence[cf.Future],
133
46
  *,
134
47
  timeout_s: ta.Union[int, float] = 60,
@@ -155,13 +68,13 @@ def await_futures(
155
68
  return True
156
69
 
157
70
  if time.time() >= (start + timeout_s):
158
- raise AsyncTimeoutException
71
+ raise FutureTimeoutException
159
72
  time.sleep(tick_interval_s)
160
73
 
161
74
  return False
162
75
 
163
76
 
164
- def await_dependent_futures(
77
+ def wait_dependent_futures(
165
78
  executor: cf.Executor,
166
79
  dependency_sets_by_fn: ta.Mapping[ta.Callable, ta.AbstractSet[ta.Callable]],
167
80
  *,
@@ -215,7 +128,7 @@ def await_dependent_futures(
215
128
 
216
129
  if time.time() >= (start + timeout_s):
217
130
  cancel()
218
- raise AsyncTimeoutException
131
+ raise FutureTimeoutException
219
132
 
220
133
  remaining_fns = {fn: deps for fn, deps in remaining_dep_sets_by_fn.items() if deps}
221
134
  if remaining_fns:
@@ -223,3 +136,44 @@ def await_dependent_futures(
223
136
 
224
137
  futs_by_fn = {fn: fut for fut, fn in fns_by_fut.items()}
225
138
  return futs_by_fn
139
+
140
+
141
+ ##
142
+
143
+
144
+ class ImmediateExecutor(cf.Executor):
145
+
146
+ def __init__(self, *, immediate_exceptions: bool = False) -> None:
147
+ super().__init__()
148
+ self._immediate_exceptions = immediate_exceptions
149
+
150
+ def submit(self, fn, *args, **kwargs):
151
+ future: ta.Any = cf.Future()
152
+ try:
153
+ result = fn(*args, **kwargs)
154
+ future.set_result(result)
155
+ except Exception as e:
156
+ if self._immediate_exceptions:
157
+ raise
158
+ future.set_exception(e)
159
+ return future
160
+
161
+
162
+ @contextlib.contextmanager
163
+ def new_thread_or_immediate_executor(
164
+ max_workers: int | None = None,
165
+ *,
166
+ immediate_exceptions: bool = False,
167
+ thread_name_prefix: str = '',
168
+ **kwargs: ta.Any,
169
+ ) -> ta.Generator[cf.Executor, None, None]:
170
+ if max_workers == 0:
171
+ yield ImmediateExecutor(
172
+ immediate_exceptions=immediate_exceptions,
173
+ )
174
+ else:
175
+ with cf.ThreadPoolExecutor(
176
+ thread_name_prefix=thread_name_prefix,
177
+ **kwargs,
178
+ ) as exe:
179
+ yield exe
@@ -0,0 +1,11 @@
1
+ """
2
+ lookit:
3
+ - https://github.com/oremanj/trio-monitor
4
+ - https://github.com/python-trio/trio-monitor/tree/master
5
+ - https://github.com/python-trio/triopg
6
+ - https://github.com/python-trio/trio-mysql
7
+ - https://github.com/goodboy/tractor
8
+ - https://github.com/groove-x/trio-util
9
+ - https://github.com/oremanj/tricycle/tree/master
10
+ - https://github.com/linkdd/triotp
11
+ """
@@ -16,12 +16,12 @@ from .order import OrderProcessor
16
16
  from .params import ParamsExtras
17
17
  from .processing import Processor
18
18
  from .reflect import ClassInfo
19
+ from .replace import ReplaceProcessor
19
20
  from .repr import ReprProcessor
20
21
  from .simple import DocProcessor
21
22
  from .simple import EqProcessor
22
23
  from .simple import MatchArgsProcessor
23
24
  from .simple import OverridesProcessor
24
- from .simple import ReplaceProcessor
25
25
  from .slots import add_slots
26
26
 
27
27
  if ta.TYPE_CHECKING:
@@ -4,6 +4,9 @@ from .fields import field_type
4
4
  from .internals import FIELDS_ATTR
5
5
  from .internals import FieldType
6
6
  from .internals import is_dataclass_instance
7
+ from .processing import Processor
8
+ from .utils import set_new_attribute
9
+
7
10
 
8
11
  MISSING = dc.MISSING
9
12
 
@@ -30,3 +33,8 @@ def _replace(obj, /, **changes):
30
33
  changes[f.name] = getattr(obj, f.name)
31
34
 
32
35
  return obj.__class__(**changes)
36
+
37
+
38
+ class ReplaceProcessor(Processor):
39
+ def _process(self) -> None:
40
+ set_new_attribute(self._cls, '__replace__', _replace)
@@ -5,7 +5,6 @@ from .fields import field_assign
5
5
  from .init import get_init_fields
6
6
  from .params import get_field_extras
7
7
  from .processing import Processor
8
- from .replace import _replace
9
8
  from .utils import create_fn
10
9
  from .utils import set_new_attribute
11
10
 
@@ -91,8 +90,3 @@ class MatchArgsProcessor(Processor):
91
90
 
92
91
  ifs = get_init_fields(self._info.fields.values())
93
92
  set_new_attribute(self._cls, '__match_args__', tuple(f.name for f in ifs.std))
94
-
95
-
96
- class ReplaceProcessor(Processor):
97
- def _process(self) -> None:
98
- set_new_attribute(self._cls, '__replace__', _replace)
@@ -12,8 +12,9 @@ STATUS_NOT_FOUND = format_status(http.HTTPStatus.NOT_FOUND)
12
12
  STATUS_METHOD_NOT_ALLOWED = format_status(http.HTTPStatus.METHOD_NOT_ALLOWED)
13
13
 
14
14
 
15
- CONTENT_TYPE = 'Content-Type'
16
- CONTENT_TEXT = 'text/plain'
17
- CONTENT_JSON = 'application/json'
18
- CONTENT_ICON = 'image/x-icon'
19
- CONTENT_BYTES = 'application/octet-stream'
15
+ HEADER_CONTENT_TYPE = b'Content-Type'
16
+ CONTENT_TYPE_TEXT = b'text/plain'
17
+ CONTENT_TYPE_TEXT_UTF8 = CONTENT_TYPE_TEXT + b'; charset=utf-8'
18
+ CONTENT_TYPE_JSON = b'application/json'
19
+ CONTENT_TYPE_ICON = b'image/x-icon'
20
+ CONTENT_TYPE_BYTES = b'application/octet-stream'
@@ -0,0 +1,34 @@
1
+ import typing as ta
2
+
3
+ from .. import lang
4
+
5
+
6
+ Environ = ta.Mapping[str, ta.Any]
7
+ StartResponse = ta.Callable[[str, ta.Iterable[tuple[str | bytes, str | bytes]]], ta.Callable[[lang.BytesLike], None]]
8
+ App = ta.Callable[[Environ, StartResponse], ta.Iterable[lang.BytesLike]]
9
+
10
+
11
+ # class App(lang.Abstract):
12
+ #
13
+ # def __enter__(self: AppT) -> AppT:
14
+ # return self
15
+ #
16
+ # def __exit__(self, exc_type, exc_val, exc_tb) -> None:
17
+ # return None
18
+ #
19
+ # @abc.abstractmethod
20
+ # def __call__(self, environ: Environ, start_response: StartResponse) -> ta.Iterable[bytes]:
21
+ # raise NotImplementedError
22
+
23
+
24
+ # class AsyncApp(lang.Abstract):
25
+ #
26
+ # async def __aenter__(self: AppT) -> AppT:
27
+ # return self
28
+ #
29
+ # async def __aexit__(self, exc_type, exc_val, exc_tb) -> None:
30
+ # return None
31
+ #
32
+ # @abc.abstractmethod
33
+ # async def __call__(self, scope, receive, send) -> ta.Iterable[bytes]:
34
+ # raise NotImplementedError