omlish 0.0.0.dev1__py3-none-any.whl → 0.0.0.dev3__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.

Files changed (147) hide show
  1. omlish/__about__.py +2 -3
  2. omlish/argparse.py +8 -8
  3. omlish/asyncs/__init__.py +2 -2
  4. omlish/asyncs/anyio.py +64 -1
  5. omlish/asyncs/asyncs.py +1 -3
  6. omlish/asyncs/futures.py +16 -15
  7. omlish/c3.py +5 -5
  8. omlish/check.py +8 -8
  9. omlish/collections/__init__.py +98 -63
  10. omlish/collections/_abc.py +2 -0
  11. omlish/collections/_io_abc.py +4 -2
  12. omlish/collections/cache/__init__.py +1 -1
  13. omlish/collections/cache/descriptor.py +12 -12
  14. omlish/collections/cache/impl.py +27 -20
  15. omlish/collections/cache/types.py +1 -1
  16. omlish/collections/coerce.py +44 -44
  17. omlish/collections/frozen.py +9 -9
  18. omlish/collections/identity.py +4 -5
  19. omlish/collections/mappings.py +5 -5
  20. omlish/collections/ordered.py +8 -8
  21. omlish/collections/skiplist.py +7 -7
  22. omlish/collections/sorted.py +4 -4
  23. omlish/collections/treap.py +42 -17
  24. omlish/collections/treapmap.py +59 -7
  25. omlish/collections/unmodifiable.py +25 -24
  26. omlish/collections/utils.py +1 -1
  27. omlish/configs/flattening.py +8 -7
  28. omlish/configs/props.py +3 -3
  29. omlish/dataclasses/__init__.py +1 -1
  30. omlish/dataclasses/impl/__init__.py +18 -0
  31. omlish/dataclasses/impl/api.py +15 -24
  32. omlish/dataclasses/impl/as_.py +4 -4
  33. omlish/dataclasses/impl/exceptions.py +1 -1
  34. omlish/dataclasses/impl/fields.py +8 -8
  35. omlish/dataclasses/impl/frozen.py +2 -2
  36. omlish/dataclasses/impl/init.py +6 -6
  37. omlish/dataclasses/impl/internals.py +16 -1
  38. omlish/dataclasses/impl/main.py +4 -4
  39. omlish/dataclasses/impl/metaclass.py +2 -2
  40. omlish/dataclasses/impl/metadata.py +1 -1
  41. omlish/dataclasses/impl/order.py +2 -2
  42. omlish/dataclasses/impl/params.py +4 -38
  43. omlish/dataclasses/impl/reflect.py +1 -7
  44. omlish/dataclasses/impl/replace.py +1 -1
  45. omlish/dataclasses/impl/repr.py +24 -6
  46. omlish/dataclasses/impl/simple.py +2 -2
  47. omlish/dataclasses/impl/slots.py +2 -2
  48. omlish/dataclasses/impl/utils.py +7 -7
  49. omlish/defs.py +13 -17
  50. omlish/diag/procfs.py +334 -0
  51. omlish/diag/ps.py +47 -0
  52. omlish/{replserver → diag/replserver}/console.py +26 -28
  53. omlish/{replserver → diag/replserver}/server.py +12 -12
  54. omlish/dispatch/dispatch.py +14 -16
  55. omlish/dispatch/functions.py +1 -1
  56. omlish/dispatch/methods.py +6 -7
  57. omlish/docker.py +8 -6
  58. omlish/dynamic.py +13 -13
  59. omlish/fnpairs.py +311 -0
  60. omlish/graphs/dot/items.py +1 -1
  61. omlish/graphs/trees.py +25 -31
  62. omlish/inject/__init__.py +7 -7
  63. omlish/inject/elements.py +2 -2
  64. omlish/inject/exceptions.py +8 -8
  65. omlish/inject/impl/elements.py +4 -4
  66. omlish/inject/impl/injector.py +6 -6
  67. omlish/inject/impl/inspect.py +3 -3
  68. omlish/inject/impl/scopes.py +9 -9
  69. omlish/inject/injector.py +1 -1
  70. omlish/inject/providers.py +2 -2
  71. omlish/inject/proxy.py +5 -5
  72. omlish/iterators.py +62 -26
  73. omlish/json.py +7 -6
  74. omlish/lang/__init__.py +172 -112
  75. omlish/lang/cached.py +15 -10
  76. omlish/lang/classes/__init__.py +35 -24
  77. omlish/lang/classes/abstract.py +3 -3
  78. omlish/lang/classes/restrict.py +14 -14
  79. omlish/lang/classes/simple.py +2 -2
  80. omlish/lang/classes/virtual.py +5 -5
  81. omlish/lang/clsdct.py +2 -2
  82. omlish/lang/cmp.py +2 -2
  83. omlish/lang/contextmanagers.py +31 -25
  84. omlish/lang/datetimes.py +1 -1
  85. omlish/lang/descriptors.py +51 -6
  86. omlish/lang/exceptions.py +2 -0
  87. omlish/lang/functions.py +101 -35
  88. omlish/lang/imports.py +25 -30
  89. omlish/lang/iterables.py +2 -2
  90. omlish/lang/maybes.py +2 -1
  91. omlish/lang/objects.py +17 -11
  92. omlish/lang/resolving.py +1 -1
  93. omlish/lang/strings.py +1 -1
  94. omlish/lang/timeouts.py +53 -0
  95. omlish/lang/typing.py +5 -5
  96. omlish/libc.py +15 -11
  97. omlish/logs/_abc.py +5 -1
  98. omlish/logs/filters.py +2 -0
  99. omlish/logs/formatters.py +6 -2
  100. omlish/logs/utils.py +1 -1
  101. omlish/marshal/base.py +9 -9
  102. omlish/marshal/dataclasses.py +2 -2
  103. omlish/marshal/enums.py +2 -2
  104. omlish/marshal/exceptions.py +1 -1
  105. omlish/marshal/factories.py +10 -10
  106. omlish/marshal/global_.py +10 -4
  107. omlish/marshal/iterables.py +2 -2
  108. omlish/marshal/mappings.py +2 -2
  109. omlish/marshal/objects.py +1 -2
  110. omlish/marshal/optionals.py +4 -4
  111. omlish/marshal/polymorphism.py +4 -4
  112. omlish/marshal/registries.py +3 -3
  113. omlish/marshal/standard.py +6 -6
  114. omlish/marshal/utils.py +3 -3
  115. omlish/marshal/values.py +1 -1
  116. omlish/math.py +9 -9
  117. omlish/os.py +13 -4
  118. omlish/reflect.py +5 -15
  119. omlish/sql/__init__.py +0 -0
  120. omlish/sql/_abc.py +65 -0
  121. omlish/sql/dbs.py +90 -0
  122. omlish/stats.py +7 -8
  123. omlish/term.py +1 -1
  124. omlish/testing/pydevd.py +30 -12
  125. omlish/testing/pytest/inject/__init__.py +7 -0
  126. omlish/testing/pytest/inject/harness.py +24 -2
  127. omlish/testing/pytest/plugins/__init__.py +1 -1
  128. omlish/testing/pytest/plugins/pydevd.py +12 -0
  129. omlish/testing/pytest/plugins/switches.py +3 -3
  130. omlish/testing/testing.py +5 -5
  131. omlish/text/delimit.py +3 -6
  132. omlish/text/parts.py +3 -3
  133. omlish-0.0.0.dev3.dist-info/METADATA +31 -0
  134. omlish-0.0.0.dev3.dist-info/RECORD +191 -0
  135. {omlish-0.0.0.dev1.dist-info → omlish-0.0.0.dev3.dist-info}/WHEEL +1 -1
  136. omlish/lang/classes/test/test_abstract.py +0 -89
  137. omlish/lang/classes/test/test_restrict.py +0 -71
  138. omlish/lang/classes/test/test_simple.py +0 -58
  139. omlish/lang/classes/test/test_virtual.py +0 -72
  140. omlish/testing/pytest/plugins/pycharm.py +0 -54
  141. omlish-0.0.0.dev1.dist-info/METADATA +0 -17
  142. omlish-0.0.0.dev1.dist-info/RECORD +0 -187
  143. /omlish/{lang/classes/test → diag}/__init__.py +0 -0
  144. /omlish/{replserver → diag/replserver}/__init__.py +0 -0
  145. /omlish/{replserver → diag/replserver}/__main__.py +0 -0
  146. {omlish-0.0.0.dev1.dist-info → omlish-0.0.0.dev3.dist-info}/LICENSE +0 -0
  147. {omlish-0.0.0.dev1.dist-info → omlish-0.0.0.dev3.dist-info}/top_level.txt +0 -0
omlish/testing/testing.py CHANGED
@@ -14,7 +14,7 @@ T = ta.TypeVar('T')
14
14
 
15
15
  def call_many_with_timeout(
16
16
  fns: ta.Iterable[ta.Callable[[], T]],
17
- timeout_s: int | float | None = None,
17
+ timeout_s: float | None = None,
18
18
  timeout_exception: Exception = TimeoutError('Thread timeout'),
19
19
  ) -> list[T]:
20
20
  if timeout_s is None:
@@ -23,7 +23,7 @@ def call_many_with_timeout(
23
23
  fns = list(fns)
24
24
  missing = object()
25
25
  rets: list[ta.Any] = [missing] * len(fns)
26
- thread_exception: ta.Optional[Exception] = None
26
+ thread_exception: Exception | None = None
27
27
 
28
28
  def inner(fn, idx):
29
29
  try:
@@ -54,7 +54,7 @@ def call_many_with_timeout(
54
54
 
55
55
  def run_with_timeout(
56
56
  *fns: ta.Callable[[], None],
57
- timeout_s: int | float | None = None,
57
+ timeout_s: float | None = None,
58
58
  timeout_exception: Exception = TimeoutError('Thread timeout'),
59
59
  ) -> None:
60
60
  call_many_with_timeout(fns, timeout_s, timeout_exception)
@@ -62,8 +62,8 @@ def run_with_timeout(
62
62
 
63
63
  def waitpid_with_timeout(
64
64
  pid: int,
65
- timeout_s: int | float | None = None,
66
- timeout_exception: Exception = TimeoutError('waitpid timeout')
65
+ timeout_s: float | None = None,
66
+ timeout_exception: Exception = TimeoutError('waitpid timeout'),
67
67
  ) -> int:
68
68
  if timeout_s is None:
69
69
  timeout_s = DEFAULT_TIMEOUT_S
omlish/text/delimit.py CHANGED
@@ -46,7 +46,7 @@ class DelimitedEscaping:
46
46
  def is_control_char(self, c: str) -> bool:
47
47
  if not len(c) == 1:
48
48
  raise TypeError(c)
49
- return c == self._delimit_char or c == self._quote_char or c == self._escape_char
49
+ return c == self._delimit_char or c == self._quote_char or c == self._escape_char # noqa
50
50
 
51
51
  def contains_escaped_char(self, s: str) -> bool:
52
52
  return any(c in self._all_escaped_chars for c in s)
@@ -94,11 +94,9 @@ class DelimitedEscaping:
94
94
  if isinstance(strs, str):
95
95
  raise TypeError(strs)
96
96
  buf = io.StringIO()
97
- count = 0
98
- for s in strs:
97
+ for count, s in enumerate(strs):
99
98
  if count:
100
99
  buf.write(self._delimit_char)
101
- count += 1
102
100
  if self.contains_escaped_char(s):
103
101
  buf.write(self.quote(s))
104
102
  else:
@@ -137,8 +135,7 @@ class DelimitedEscaping:
137
135
  if c == self._delimit_char:
138
136
  if not quoted:
139
137
  break
140
- else:
141
- buf.write(c)
138
+ buf.write(c)
142
139
  elif c == self._quote_char:
143
140
  if not quoted:
144
141
  raise ValueError(s)
omlish/text/parts.py CHANGED
@@ -30,7 +30,7 @@ def _check_part(o: PartT) -> PartT:
30
30
  return o
31
31
 
32
32
 
33
- def _check_optional_part(o: ta.Optional[PartT]) -> ta.Optional[PartT]:
33
+ def _check_optional_part(o: PartT | None) -> PartT | None:
34
34
  if o is None:
35
35
  return None
36
36
  return _check_part(o)
@@ -49,7 +49,7 @@ class Wrap(DataPart, lang.Final):
49
49
 
50
50
 
51
51
  class List(DataPart, lang.Final):
52
- parts: ta.Sequence[ta.Optional[Part]] = dc.xfield(coerce=col.seq_of(_check_optional_part))
52
+ parts: ta.Sequence[Part | None] = dc.xfield(coerce=col.seq_of(_check_optional_part))
53
53
  delimiter: str = dc.field(default=',') # FIXME: , check_type=str)
54
54
  trailer: bool = dc.field(default=False) # FIXME: , check_type=bool)
55
55
 
@@ -252,7 +252,7 @@ class PartRenderer:
252
252
  self._indents -= 1
253
253
 
254
254
 
255
- def render_part(part: Part, buf: ta.Optional[io.StringIO] = None) -> io.StringIO:
255
+ def render_part(part: Part, buf: io.StringIO | None = None) -> io.StringIO:
256
256
  if buf is None:
257
257
  buf = io.StringIO()
258
258
  PartRenderer(buf)(part)
@@ -0,0 +1,31 @@
1
+ Metadata-Version: 2.1
2
+ Name: omlish
3
+ Version: 0.0.0.dev3
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
+ Requires-Python: >=3.12
13
+ License-File: LICENSE
14
+ Provides-Extra: async
15
+ Requires-Dist: anyio ; extra == 'async'
16
+ Provides-Extra: http
17
+ Requires-Dist: httpx ; extra == 'http'
18
+ Provides-Extra: server
19
+ Requires-Dist: h11 ; extra == 'server'
20
+ Requires-Dist: h2 ; extra == 'server'
21
+ Requires-Dist: priority ; extra == 'server'
22
+ Requires-Dist: wsproto ; extra == 'server'
23
+ Provides-Extra: sql
24
+ Requires-Dist: sqlalchemy ; extra == 'sql'
25
+ Provides-Extra: test
26
+ Requires-Dist: pytest ; extra == 'test'
27
+ Provides-Extra: wrapt
28
+ Requires-Dist: wrapt ; extra == 'wrapt'
29
+ Provides-Extra: yaml
30
+ Requires-Dist: pyyaml ; extra == 'yaml'
31
+
@@ -0,0 +1,191 @@
1
+ omlish/__about__.py,sha256=PDr-dayjZF7uNCY78Cmj-DplO_IRgBlaOdS27ftVXMk,153
2
+ omlish/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ omlish/argparse.py,sha256=QRQmX9G0-L_nATkFtGHvpd4qrpYzKATdjuFLbBqzJPM,6224
4
+ omlish/c3.py,sha256=yhescciIJWoJ9nIWJSrUOtyqIu4uLyPjRHk8RbAJ3f4,8039
5
+ omlish/cached.py,sha256=i7uWLRrUrE5N1ofzUf9D3OIsxf-dXkgu4OxCep0CCBk,197
6
+ omlish/check.py,sha256=h66jWSwaiuaaIKPI6_pIfolWYYK3WTR43X1CBO5-PQA,5538
7
+ omlish/defs.py,sha256=IvUL5i-iyBh5HUhf-gY6sonw3tIozL8066QL71CnoiY,4729
8
+ omlish/docker.py,sha256=oLyJQg4Mu-k_WfDVP7PU9yK1cI-JCdcrTVjrQg2sQsE,4140
9
+ omlish/dynamic.py,sha256=9LHfKegKnMFoczFfqIZuGpkR8xGxMxq_lAvNJTDJjWs,6541
10
+ omlish/fnpairs.py,sha256=DgXK-AbcIFq7a-HI0a-7ctvKvoSAou4wW5B0fcorMIc,7252
11
+ omlish/iterators.py,sha256=YJUTyfqY_calFFOU40TEuptYBqKeavi6L6kc2gXn9s4,5524
12
+ omlish/json.py,sha256=P2T8yigNNGDVdYpgKfaA7gtYdJC2EQJ10XaS89MROoQ,4549
13
+ omlish/libc.py,sha256=u0481imCiTFqP_e-v9g0pD-0WD249j5vYzhtn-fnNkY,15308
14
+ omlish/math.py,sha256=AVqp5Y8yxKA-wO0BgrzaxA0Ga3PZiCXnYcwivMneC-0,3804
15
+ omlish/os.py,sha256=T77P7_U7jShPXsm_byvXwPoumcmtA0a7KPRvE2GAOhw,950
16
+ omlish/reflect.py,sha256=3dJ9ZGrBan5RRW_Q0OTbl9--oi3B05-ZV4uu0VH-m1c,9891
17
+ omlish/runmodule.py,sha256=PWvuAaJ9wQQn6bx9ftEL3_d04DyotNn8dR_twm2pgw0,700
18
+ omlish/stats.py,sha256=uqjN-focDVssFZMagj22HqmyJ1TBO4Wt-XnHp8-EtVw,9927
19
+ omlish/term.py,sha256=OmD3QXntycYHNDCZ-ZV5x2Rz9tw49CoYEn-rld7x_r8,5963
20
+ omlish/asyncs/__init__.py,sha256=FIoKl3m_gSxEXL_JJU_dc4OAIKVqq9fLqom_byH3PGY,307
21
+ omlish/asyncs/anyio.py,sha256=oYU7FGxMlzPhj5Aa1p7XSdKeD6icoyTPxZRWDc9-YGc,3226
22
+ omlish/asyncs/asyncio.py,sha256=pSldCmtE9AgVATXb_Vnhjhhz0v2LtqgVXxe7-OFjH0g,414
23
+ omlish/asyncs/asyncs.py,sha256=MmIz8Gw4PbZd0LUIro_u5kUjobR8i2qGCo6l2hb4U74,2014
24
+ omlish/asyncs/futures.py,sha256=3KkTj5TOPmvNOcuK9LtOQwmkuLzoEYQfcuaHTXSQ0Ts,5424
25
+ omlish/asyncs/trio.py,sha256=GKG3wgelFr7gIKKHZhcflvMyCvxXHNZe862KB0Xw2uA,370
26
+ omlish/collections/__init__.py,sha256=H1_J6VNBqdmdMb8vjc7LBJ8ULoiawxoz-1cR41twB2k,1526
27
+ omlish/collections/_abc.py,sha256=sP7BpTVhx6s6C59mTFeosBi4rHOWC6tbFBYbxdZmvh0,2365
28
+ omlish/collections/_io_abc.py,sha256=Cxs8KB1B_69rxpUYxI-MTsilAmNooJJn3w07DKqYKkE,1255
29
+ omlish/collections/coerce.py,sha256=o11AMrUiyoadd8WkdqeKPIpXf2xd0LyylzNCyJivCLU,7036
30
+ omlish/collections/frozen.py,sha256=DGxemj_pVID85tSBm-Wns_x4ov0wOEIT6X5bVgJtmkA,4152
31
+ omlish/collections/identity.py,sha256=3X4J-LqdzM-9QA1bJ_FIxqxsei_ESS3oJHFlD1VX7KQ,2550
32
+ omlish/collections/indexed.py,sha256=lbMBqMjwy8VRZhEsh0o_PIkP9mk4LP3MHQZxa18Hlzg,2143
33
+ omlish/collections/mappings.py,sha256=5D7xZabUY6n1nB-BrZlcrPy_AdzLZ6IyihuLeDL48pA,3188
34
+ omlish/collections/ordered.py,sha256=RzEC3fHvrDeJQSWThVDNYQKke263Vje1II5YwtDwT1Q,2335
35
+ omlish/collections/persistent.py,sha256=KG471s0bhhReQrjlmX0xaN9HeAIcrtT264ddZCxsExo,875
36
+ omlish/collections/skiplist.py,sha256=xjuKZtSScp1VnOi9lpf7I090vGp1DnjA5ELjFhMeGps,5987
37
+ omlish/collections/sorted.py,sha256=E5ZOdNn7Jju1EcQ7CX2Ltk9StIXsBOzqvh7EsT3ZA2U,3354
38
+ omlish/collections/treap.py,sha256=wq9L5hvxq4QgPvIpHmueZMF8t7UrvX5vmlNN4BOqY4g,7720
39
+ omlish/collections/treapmap.py,sha256=TxOM-ZRF5PK2xe5wRIhESNt7DGh9b_MeZfE7HLkCOs4,5804
40
+ omlish/collections/unmodifiable.py,sha256=QmUEi9IBXqiM_KGgH2rqg15VmkHJo1MZ6kwq2twEMho,4750
41
+ omlish/collections/utils.py,sha256=2mqczC8lnIfpuYxdBJACqRqXup5YGcVNhwgw2r5MVy4,3022
42
+ omlish/collections/cache/__init__.py,sha256=Cv8RX-Ehit3um0QLDq7uRDqJUCcdqTKoAB9T0pM_5hg,392
43
+ omlish/collections/cache/descriptor.py,sha256=t-1Gh4DTABDuNmeDJlpoW4LV3gi_uSlBd9ZfBINfYCM,5023
44
+ omlish/collections/cache/impl.py,sha256=WDmF_WSGpVsFRbUAB7GMAA-z5-nr7rGNB7TiKfK53dY,15129
45
+ omlish/collections/cache/types.py,sha256=yNjwd6CGyTJQdxN2CQxFqqBAlcs1Z7vvNV-aU1K7p8E,685
46
+ omlish/configs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
+ omlish/configs/flattening.py,sha256=AOlRpBHm449MxwMp3CiIRGunStOC1DUNs1f3CLou0wc,4731
48
+ omlish/configs/props.py,sha256=nwbg4uzFMbiNnTxOhRQ67AREbrLB8lMoiGMjmjjdVBE,1693
49
+ omlish/dataclasses/__init__.py,sha256=xx4l1C6bgo75DMcZZwhIJr9UZpo8LranMqa_1hOkiMk,972
50
+ omlish/dataclasses/impl/__init__.py,sha256=rQJRcE9fVsGEvRUOZ18r4DE0xiLbSRjspyJRXgbLS3I,348
51
+ omlish/dataclasses/impl/api.py,sha256=7w-SXif9e2Driz_HyR2depJRQL76EwRai3jdNrQAjB0,6243
52
+ omlish/dataclasses/impl/as_.py,sha256=lXSMsRgzsewSaub8SUmNXvxVRsDpeAOhL1xMOK-d4RI,2598
53
+ omlish/dataclasses/impl/exceptions.py,sha256=EDuVPeyjBu8jHYUFIASRNupRL-krpytSeuNIkD4N6Ok,38
54
+ omlish/dataclasses/impl/fields.py,sha256=_ICwU0aCYLQYV5i0gmO3bLJlyMG4OxOa89xemPY_gcQ,4242
55
+ omlish/dataclasses/impl/frozen.py,sha256=5wKtt8WvPYCkHPrwR024mpvbFzqcbPQfgiFvy3orRJo,1692
56
+ omlish/dataclasses/impl/hashing.py,sha256=FKnHuXCg9ylrzK2TLGqO5yfRN4HX3F415CSLlVYXtYE,3190
57
+ omlish/dataclasses/impl/init.py,sha256=O5UAUysLKWPg3e4KiJ5Dsv8CJnrdwJErMWkgQVERXpA,5558
58
+ omlish/dataclasses/impl/internals.py,sha256=LTCqGT8AhyGTWwioGrBpTJzDzPvAtizQKb0NBNKcNs0,2989
59
+ omlish/dataclasses/impl/main.py,sha256=gANq32eOkNXWDLdJ3MgPFKiviE-m0ao8ryjF52Hg1xs,5129
60
+ omlish/dataclasses/impl/metaclass.py,sha256=UaNdJjD-Y6aJ178Et5_1erORsJ9PzO1xfR0K5rGOCjs,2722
61
+ omlish/dataclasses/impl/metadata.py,sha256=HGqAtMcP422X4kPx93btcxE-n4guBFm6-N-S4nobgk4,1407
62
+ omlish/dataclasses/impl/order.py,sha256=8aWqDgf4sPhn04tdAaFwA8tjvuIhf2D8f4mpk5LvPqw,1369
63
+ omlish/dataclasses/impl/params.py,sha256=M-xg9IeFftVy795oqlp7Yw8jE-7wG2K4vaFhXHKmL1k,2538
64
+ omlish/dataclasses/impl/processing.py,sha256=iUvaNwRAt8rQsLIIkvRye5rfk6xhgR35EbcdwZCZec8,366
65
+ omlish/dataclasses/impl/reflect.py,sha256=nw8OkZkVloQEhpIwXkuQAIQKT8XxI_eOmi0ZNAIb_IY,5000
66
+ omlish/dataclasses/impl/replace.py,sha256=wS9GHX4fIwaPv1JBJzIewdBfXyK3X3V7_t55Da87dYo,1217
67
+ omlish/dataclasses/impl/repr.py,sha256=oLXBTxqp88NKmz82HrJeGiTEiwK4l5LlXQT9Q0-tX3c,1605
68
+ omlish/dataclasses/impl/simple.py,sha256=EovA-GpmQYtB_svItO2byTAWqbKGF4njz0MdQts3QBU,3157
69
+ omlish/dataclasses/impl/slots.py,sha256=_sm-x9v1tPnXEHBHNUMTHZocgVyhZaPdvamIPPBUVyk,2635
70
+ omlish/dataclasses/impl/utils.py,sha256=aER2iL3UAtgS1BdLuEvTr9Tr2wC28wk1kiOeO-jIymw,6138
71
+ omlish/diag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
+ omlish/diag/procfs.py,sha256=94o3xDtJn4PWsUUwZjnE7m0aJM80rykDssG_R1OH98w,9274
73
+ omlish/diag/ps.py,sha256=1JWxZen3fVG-20R6ZZ8BtO_gpzw_5bhHZiKdoHkgxoU,1004
74
+ omlish/diag/replserver/__init__.py,sha256=uLo6V2aQ29v9z3IMELlPDSlG3_2iOT4-_X8VniF-EgE,235
75
+ omlish/diag/replserver/__main__.py,sha256=LmU41lQ58bm1h4Mx7S8zhE_uEBSC6kPcp9mn5JRpulA,32
76
+ omlish/diag/replserver/console.py,sha256=hzY3sCpUF_C9Nvlc5QT75OqHbfnPQkUz3keWRMITmjY,7396
77
+ omlish/diag/replserver/server.py,sha256=L8qHxVx4JBPzWs18m2t82fW0Uloi7Kvv7xnUGyN1pAk,4865
78
+ omlish/dispatch/__init__.py,sha256=GsiGJ91NKiQptSROtnCSkrZExBkvfDwYvdoTu5dBqF0,117
79
+ omlish/dispatch/dispatch.py,sha256=8B66wOat30HckcIsCq4pnutBy20iSPwPQOqJ4msHaGU,3739
80
+ omlish/dispatch/functions.py,sha256=S8ElsLi6DKxTdtFGigWaF0vAquwy2sK-3f4iRLaYq70,1522
81
+ omlish/dispatch/methods.py,sha256=utLvLioBgEqa0gR0fpfNEtMDZFGPM4G5p3XHnPt-oIw,5865
82
+ omlish/graphs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
83
+ omlish/graphs/trees.py,sha256=_N8Z-gBVzreY0NWpzzitD4iR3e40ojoFLVXjJlGViTI,8150
84
+ omlish/graphs/dot/__init__.py,sha256=6-LAx7ytHFQvfLrnxVQG1s8xmApgblERJJCTB2knOHk,642
85
+ omlish/graphs/dot/items.py,sha256=OWPf0-hjBgS1uyy2QgAEn4IgFHJcEg7sHVWeTx1ghZc,4083
86
+ omlish/graphs/dot/rendering.py,sha256=hUSJ5HvSvxnTIC9ynSxxP8IJnVH6quEeDbLzNlUnmuk,3626
87
+ omlish/graphs/dot/utils.py,sha256=_FMwn77WfiiAfLsRTOKWm4IYbNv5kQN22YJ5psw6CWg,801
88
+ omlish/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
+ omlish/http/consts.py,sha256=reOpgv7NHAHLqUblYgfT5-hZVngkZfMJfCz9P41JdlU,696
90
+ omlish/http/wsgi.py,sha256=czZsVUX-l2YTlMrUjKN49wRoP4rVpS0qpeBn4O5BoMY,948
91
+ omlish/inject/__init__.py,sha256=kgHhZHYW-A1z99HhBKsk13RrjQXFL1-JjfU3hF3IQ4M,1207
92
+ omlish/inject/binder.py,sha256=hkT2dw_VSOkYTP4Mn1gvEFKeWPb-O_koFeSSsB8eNx4,278
93
+ omlish/inject/bindings.py,sha256=_GeM_w-QdPa_UMeVFluuGPf-9UCzvOqzo1gL0AEfqtc,1129
94
+ omlish/inject/eagers.py,sha256=ITpV2FoIzP2xJs4XtzEKTWP0QktLw1aPSWTxmNVJcPA,372
95
+ omlish/inject/elements.py,sha256=HXG5rt2IMczK3eJCkEhj73wcCIliJnqFzQv3evPwOGI,957
96
+ omlish/inject/exceptions.py,sha256=UCNc8s8O6_2c28VeqvB7oVR2SmnnXb55Vd0MWx-YS20,612
97
+ omlish/inject/injector.py,sha256=ewnyHj50KfanQFJU8Il2MtulpaHQYgXuDZMqWud_IHE,927
98
+ omlish/inject/inspect.py,sha256=PriB5cqqTYSz_FnLxoxIRAOp9fR9CMSILfvh-V26wxA,206
99
+ omlish/inject/keys.py,sha256=ihDlt4b8mPNRyEmg2EOEsTQ7e4NSVh7nVDq2JEC4OVY,759
100
+ omlish/inject/managed.py,sha256=hXVl8eLMrCaEwPv6glB9Dfr5EM_y1fBQwrZ2eu2XxsQ,627
101
+ omlish/inject/overrides.py,sha256=k-WjyslF-pZmsYwzrDDsFNgqcl0Ao3CufHCoN0LDCAU,391
102
+ omlish/inject/private.py,sha256=brBCsI-lZHPoouAij7_Eja44nkT-HxweG6eSVIhtXMA,592
103
+ omlish/inject/providers.py,sha256=VKc2vKiJN4GdWn7Vp1Su3zTBZe2PnH0h256qusrHMnU,1999
104
+ omlish/inject/proxy.py,sha256=4ACSV3iy0lIbMvM3dZUCG6BnmmOTAVqA4mvjRxlcdX8,1634
105
+ omlish/inject/scopes.py,sha256=hecYiZwZ3H31cnTgfP01-duTM8OgllwxtvQKpzyHDSU,2033
106
+ omlish/inject/types.py,sha256=CP3ltWxRtmR2Iqz1Qd7CvaTHQYV4st5FPiNDBN8tmn0,235
107
+ omlish/inject/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
+ omlish/inject/impl/bindings.py,sha256=8H586RCgmvwq53XBL9WMbb-1-Tdw_hh9zxIDCwcHA1c,414
109
+ omlish/inject/impl/elements.py,sha256=MnBtTF9bx07s8KRYQ7xMtbB6WdtkAJ8Si59l-4Yxn_w,4532
110
+ omlish/inject/impl/injector.py,sha256=1jSWr8uvsUPAWRFXEj_HHY6efprMrMBPy0tWvKLUYJw,5528
111
+ omlish/inject/impl/inspect.py,sha256=ZQScAStbjWi_5InA6M52ll3cdyfPRuLwYo6kc4kFsmM,2525
112
+ omlish/inject/impl/private.py,sha256=MiYvs-EiFrla4FQnoqmqGpYx784ij33p0obAS57HOCQ,2611
113
+ omlish/inject/impl/providers.py,sha256=m0c9AAY849P6egYBOsSCkSoSBc8So7Zbmlo6gZwzTIw,3302
114
+ omlish/inject/impl/scopes.py,sha256=Lc2Bw1hK0TrAt0_JrXwSQGCixZdBcqZlEz3_n2Q1bCA,5636
115
+ omlish/lang/__init__.py,sha256=mxCgLE8RAq6kQs75cOjT8POZXLrN_EKji2ZLKTnnJ78,2718
116
+ omlish/lang/cached.py,sha256=MgBHfT83Rrl8tFr98hGBgEeA3ugse077_w6n3S35QYM,7603
117
+ omlish/lang/clsdct.py,sha256=LXwLCULeI_8Np-7-pZkyNAHpUZLcQiBEQiHwKYQ0WRo,1742
118
+ omlish/lang/cmp.py,sha256=5vbzWWbqdzDmNKAGL19z6ZfUKe5Ci49e-Oegf9f4BsE,1346
119
+ omlish/lang/contextmanagers.py,sha256=bbtQM8qK8dXAiGzNHdpXfIqFTyr9i5cgxeI5PoD6x60,6071
120
+ omlish/lang/datetimes.py,sha256=vZ-wZXcQUuYKv59FcWfBD36d5DiHUDG5nIPW8-nhYng,2022
121
+ omlish/lang/descriptors.py,sha256=dJ5wQlKK3H-gyddFnmDO8_IOQ290SR7VxFyF-RdV2FE,2056
122
+ omlish/lang/exceptions.py,sha256=qJBo3NU1mOWWm-NhQUHCY5feYXR3arZVyEHinLsmRH4,47
123
+ omlish/lang/functions.py,sha256=wN21Uyxt4zmT4MH6VWNsKsf8-oBphvVW-cd8KQXwfJs,3858
124
+ omlish/lang/imports.py,sha256=f_Dqv4aMasl_UiEc3CJ-4t-cRaRjkUtFzfofNbDrn7M,4093
125
+ omlish/lang/iterables.py,sha256=_WK-AvXOUUVOk5073uqCKc48vH8uXI_vNV5o5OOgiUU,1034
126
+ omlish/lang/maybes.py,sha256=J2N3IDOnSSeGbrN342ln2adt0TDpz2SkyCIiZ0pVRDQ,3425
127
+ omlish/lang/objects.py,sha256=TAD84PYsD0cGtaQpqo3fQSm99tP4-hckixkQ_K_Iaic,2820
128
+ omlish/lang/resolving.py,sha256=UgrX-vxXtCGGEmnAMUYP4bUZ6-Ok0EcHVEKAZYbAS-o,1597
129
+ omlish/lang/strings.py,sha256=wdLo3m9GkV76ZKak3QqtwiR6rWqUd1XlZ-divZppcek,2372
130
+ omlish/lang/timeouts.py,sha256=vECdWYhc_IZgcal1Ng1Y42wf2FV3KAx-i8As-MgGHIQ,1186
131
+ omlish/lang/typing.py,sha256=pN7Eh8X-1iDqaZ_nZQJaheHBYdkuYTSs0yCN0LcKfDU,2341
132
+ omlish/lang/classes/__init__.py,sha256=j1p0_uuMznKrY2EhMoj20uv6vx4LXljMzp7AaKe0mmU,530
133
+ omlish/lang/classes/abstract.py,sha256=goIV14oY24EOs88eVe6E6NyrSPOOLMOcWTXTMuYKiqc,2304
134
+ omlish/lang/classes/restrict.py,sha256=D3ICBbITr65xJpms3Q-KA-qygkZdb8FsrJAQBJuCzNg,3147
135
+ omlish/lang/classes/simple.py,sha256=p30A4dJxXrtG3ztRF50uBZoBwt84hMqOt_c7cyNx5ec,2672
136
+ omlish/lang/classes/virtual.py,sha256=hEVeosXKwG4sK_9dqBoNjkK2jF2mV9QoZGOtLqg7L_Q,3315
137
+ omlish/logs/__init__.py,sha256=V8jEdb5rj9Dli0b9qtR0ZYstRoIlxWqbU38UmEOXbfY,419
138
+ omlish/logs/_abc.py,sha256=UgrCUQVUi_PvT3p1CEkb3P74CFrFcZq2AFby3GEUv9M,5974
139
+ omlish/logs/configs.py,sha256=vW4QMZKqeEBbtQY0JEi-VKBIt0CuLgcGDgG8aTlgmC0,1762
140
+ omlish/logs/filters.py,sha256=dk-_sRQhp_rCGF48qpPj5viHOBEOu78quXe9pHHs78c,187
141
+ omlish/logs/formatters.py,sha256=sFboMGuDdK-FuLc13KJ0gexvLrPz2nuzlajGiStVRQw,1905
142
+ omlish/logs/utils.py,sha256=xDSt0bMv9VPPsMxHGQNG5mPw53VgmC9u2biBi9ghr34,392
143
+ omlish/marshal/__init__.py,sha256=8kNPJUBApx6pt2-M3wiaC0o3JXF-c9nu8MUZ_h_fg4E,821
144
+ omlish/marshal/any.py,sha256=uWGEeBWaJvh5hjaGKIBL0ogGCg1jKH0Rq_onECYpHVs,821
145
+ omlish/marshal/base.py,sha256=w1zfL-eU5ZvVsoPWOwy_P8qi3VcxgI4I_3NuHNFUeww,5124
146
+ omlish/marshal/base64.py,sha256=kdkkFXjYaKx6iHxMM_7vYfaX-KUM3wXN3vzsOmBbou4,863
147
+ omlish/marshal/dataclasses.py,sha256=uTjpSxRtVJLWJr5-Bmb_PMGpRhr2gJjaL3oR2pToR1I,3522
148
+ omlish/marshal/datetimes.py,sha256=5q1CQEadI5OMDYrToHNrl3NyIuD_0GAohCgKU-HjkEs,2287
149
+ omlish/marshal/enums.py,sha256=xItDDXHoIsCL_wnhRZmTpK1zy6P0dYouOcbfPGFvyxE,1224
150
+ omlish/marshal/exceptions.py,sha256=5ub1eA0Wfd3gs8mT8XbPvPdqMVFUoCJfxvgbIjI5Uo0,142
151
+ omlish/marshal/factories.py,sha256=4Vt5Vr4r_toZQHGt_fTmcmG-gJoaZcpr6GJMU1P2lhA,2932
152
+ omlish/marshal/global_.py,sha256=kbq8gzjsKLlkieboQ-mYibPNrUGdb_kOt4Dzcmk3I4Y,881
153
+ omlish/marshal/iterables.py,sha256=ZHmvT79_i2m4bCahcuEE9aeeOukjtZhYnROCnxP53y8,2168
154
+ omlish/marshal/mappings.py,sha256=4bh1pdbvUh42Xp3mWQQa4J6da7MADmsuO029uqIYk3w,2469
155
+ omlish/marshal/naming.py,sha256=QQtw_w_YuJr4Fg-tihonOaQn_XCNixMdtgMHaRkSq6w,325
156
+ omlish/marshal/objects.py,sha256=wbcZDDzG1j3nRdHEVWb9cZiRosx06IsUnIxH5YF515w,2739
157
+ omlish/marshal/optionals.py,sha256=zZN34AGXkHobJRzM1g4UcW6jw82La8moPH5tmyxy9rc,1508
158
+ omlish/marshal/polymorphism.py,sha256=9sFTwrAjqJ4J7lRAXQZgV1jucSkgeQd7IHs4xJnEDLE,3858
159
+ omlish/marshal/primitives.py,sha256=N7kXrdxz5CIrDnPnsYMdo0xLjEfMnVfKXLMANDu-L6Y,1139
160
+ omlish/marshal/registries.py,sha256=GI2KogcxawMkk02Ky7-TsnijChoe1I7YTOPIbUNwSAI,1665
161
+ omlish/marshal/standard.py,sha256=MPmtJH3B_LqeoSwQsxKjUm65-cq6albBc8z-gxyKAj4,2442
162
+ omlish/marshal/utils.py,sha256=puKJpwPpuDlMOIrKMcLTRLJyMiL6n_Xs-p59AuDEymA,543
163
+ omlish/marshal/uuids.py,sha256=_htkeMt1a6FUNBlstZIy2rrB1-1DiavV5dZrjSQNYVM,952
164
+ omlish/marshal/values.py,sha256=ssHiWdg_L6M17kAn8GiGdPW7UeQOm3RDikWkvwblf5I,263
165
+ omlish/sql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
166
+ omlish/sql/_abc.py,sha256=HLhnnLZ7l0r_N99I-RCqJe6VHth-9iluU7cR-7-5jfs,1519
167
+ omlish/sql/dbs.py,sha256=JxcJm3JIcsb7i-t9L0KU9WhAc26QsKUL6ZL6puy3IXI,1763
168
+ omlish/testing/__init__.py,sha256=l13axR7dyVE9T1e6w1pMYtAkW3vS2J97nBcYQ1FUv18,136
169
+ omlish/testing/pydevd.py,sha256=OV9RsVbzo7fYbA3EkoOdbxQ-VB4ex2Sm9jzG8poJHDk,6270
170
+ omlish/testing/testing.py,sha256=TaLELNrPx42_-EEqJygDYyQOtEdjXP4KqgLGu6juHmU,2470
171
+ omlish/testing/pytest/__init__.py,sha256=diebkOX565JdY7HIDMJVLlj3pcFnlK-spv6YIlD77oA,176
172
+ omlish/testing/pytest/helpers.py,sha256=DKZXQGqKpDiQAh0SuYrzvJ8usJbTnuVQFDpuDmQD_Oc,912
173
+ omlish/testing/pytest/inject/__init__.py,sha256=pdRKv1HcDmJ_yArKJbYITPXXZthRSGgBJWqITr0Er38,117
174
+ omlish/testing/pytest/inject/harness.py,sha256=-zeQIeD9NvpTo9DNbkb_jv_dPMrSCUbj8UDQrZ4cCPs,5042
175
+ omlish/testing/pytest/plugins/__init__.py,sha256=BVXbNpxBMvncdMoyfuVAnnV9DqCdvrICC5zY6bzYVDQ,374
176
+ omlish/testing/pytest/plugins/_registry.py,sha256=IK04KlBgiOJxKAyCCgjpX2R-9tE-btalYJkgjLc8Te8,77
177
+ omlish/testing/pytest/plugins/logging.py,sha256=1zs6Xe54wiaSjabCviaFXwKkoN97CKm3mA5mEoUeJGs,380
178
+ omlish/testing/pytest/plugins/pydevd.py,sha256=xCBAbBmn-WGwSzLCgUZlAXM6c0fWChydoUf2Lr5SERg,314
179
+ omlish/testing/pytest/plugins/repeat.py,sha256=flSQzE9GFOWksVKz-mUGnpxJpv3yRqn1G4K8pW7JHs0,498
180
+ omlish/testing/pytest/plugins/skips.py,sha256=EoZDg1uWccgbAegmzqI85c7RliycD1e2J4Y7vfDRhwM,1041
181
+ omlish/testing/pytest/plugins/spacing.py,sha256=JQQhi9q3c523Ro1a_K_9RGAb7HotiO74N8bYX2VESFE,707
182
+ omlish/testing/pytest/plugins/switches.py,sha256=qeCp3aDtZjnh6-po1FU4JEKCrR97q0MI9nJmIF_LRkg,1809
183
+ omlish/text/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
184
+ omlish/text/delimit.py,sha256=gAdbVES35IT-maH_M084SJEaf1LRoyXG8Z3pIS6OSCI,4878
185
+ omlish/text/indent.py,sha256=6Jj6TFY9unaPa4xPzrnZemJ-fHsV53IamP93XGjSUHs,1274
186
+ omlish/text/parts.py,sha256=KGgo0wHOIMVMZtDso-rhSWKAcAkYAH2IGpg9tULabu8,6505
187
+ omlish-0.0.0.dev3.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
188
+ omlish-0.0.0.dev3.dist-info/METADATA,sha256=OIbDCU-yfhRj6eymUO_GHiLTfG0lhWtjQtRfh9mB2ys,953
189
+ omlish-0.0.0.dev3.dist-info/WHEEL,sha256=rWxmBtp7hEUqVLOnTaDOPpR-cZpCDkzhhcBce-Zyd5k,91
190
+ omlish-0.0.0.dev3.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
191
+ omlish-0.0.0.dev3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.2.0)
2
+ Generator: setuptools (71.0.4)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,89 +0,0 @@
1
- import abc
2
-
3
- import pytest
4
-
5
- from ..abstract import Abstract
6
- from ..abstract import is_abstract
7
-
8
-
9
- def test_abstract():
10
- class C(Abstract):
11
- pass
12
-
13
- class D(C):
14
- pass
15
-
16
- class E(D, Abstract):
17
- pass
18
-
19
- class F(E):
20
- pass
21
-
22
- with pytest.raises(TypeError):
23
- C()
24
- D()
25
- with pytest.raises(TypeError):
26
- E()
27
- F()
28
-
29
-
30
- def test_abstract2():
31
- class O(Abstract):
32
- pass
33
-
34
- assert is_abstract(O)
35
-
36
- with pytest.raises(TypeError):
37
- O()
38
-
39
- class A(Abstract):
40
- @abc.abstractmethod
41
- def f(self):
42
- pass
43
-
44
- assert is_abstract(A)
45
-
46
- with pytest.raises(TypeError):
47
- A() # type: ignore
48
-
49
- class B(A, Abstract):
50
- pass
51
-
52
- with pytest.raises(TypeError):
53
- B() # type: ignore
54
-
55
- class C(B):
56
- f = 0
57
-
58
- assert C()
59
-
60
- with pytest.raises(TypeError):
61
- class D(A):
62
- pass
63
-
64
-
65
- def test_is_abstract():
66
- class A(Abstract):
67
- pass
68
-
69
- assert is_abstract(A)
70
-
71
- class B(A):
72
- pass
73
-
74
- assert not is_abstract(B)
75
-
76
- class C(Abstract):
77
-
78
- def __init_subclass__(cls, **kwargs):
79
- super().__init_subclass__(**kwargs)
80
- if cls.__name__ == 'D':
81
- assert is_abstract(cls)
82
- else:
83
- assert not is_abstract(cls)
84
-
85
- class D(C, Abstract):
86
- pass
87
-
88
- class E(D):
89
- pass
@@ -1,71 +0,0 @@
1
- import typing as ta
2
-
3
- import pytest
4
-
5
- from ..restrict import Final
6
- from ..restrict import FinalException
7
- from ..restrict import NoBool
8
- from ..restrict import Sealed
9
- from ..restrict import SealedException
10
- from ..restrict import no_bool
11
-
12
-
13
- def test_final():
14
- class A:
15
- pass
16
-
17
- A()
18
-
19
- class B(A, Final):
20
- pass
21
-
22
- B()
23
-
24
- with pytest.raises(FinalException):
25
- class C(B):
26
- pass
27
-
28
- T = ta.TypeVar('T')
29
-
30
- class D(ta.Generic[T], Final):
31
- pass
32
-
33
- D()
34
- D[int] # noqa
35
-
36
- with pytest.raises(FinalException):
37
- class E(D[int]):
38
- pass
39
-
40
-
41
- def test_sealed():
42
- class A(Sealed):
43
- __module__ = 'a'
44
-
45
- class B(A):
46
- __module__ = 'a'
47
-
48
- with pytest.raises(SealedException):
49
- class C(A):
50
- __module__ = 'c'
51
-
52
- class D(B):
53
- __module__ = 'd'
54
-
55
-
56
- def test_no_bool():
57
- @no_bool
58
- def f():
59
- return 1
60
-
61
- assert f() == 1
62
- assert bool(f())
63
- with pytest.raises(TypeError):
64
- bool(f)
65
-
66
- class C(NoBool):
67
- pass
68
-
69
- assert C # type: ignore
70
- with pytest.raises(TypeError):
71
- bool(C())
@@ -1,58 +0,0 @@
1
- import pytest
2
-
3
- from ..restrict import FinalException
4
- from ..simple import LazySingleton
5
- from ..simple import Marker
6
- from ..simple import Singleton
7
-
8
-
9
- def test_marker():
10
- class M(Marker):
11
- pass
12
-
13
- with pytest.raises(FinalException):
14
- class N(M):
15
- pass
16
- with pytest.raises(TypeError):
17
- M()
18
-
19
- assert repr(M) == '<M>'
20
-
21
- assert isinstance(M, M)
22
- assert issubclass(M, M) # noqa
23
-
24
- class O(Marker):
25
- pass
26
-
27
- assert isinstance(O, O)
28
- assert issubclass(O, O) # noqa
29
-
30
- assert not isinstance(M, O)
31
- assert not issubclass(M, O)
32
- assert not isinstance(O, M)
33
- assert not issubclass(O, M)
34
-
35
-
36
- def test_singletons():
37
- for bcls in [Singleton, LazySingleton]:
38
- foo_init_calls = 0
39
- foo2_init_calls = 0
40
-
41
- class Foo(bcls): # type: ignore
42
- def __init__(self):
43
- super().__init__()
44
- nonlocal foo_init_calls
45
- foo_init_calls += 1
46
-
47
- assert Foo() is Foo()
48
- assert foo_init_calls == 1
49
-
50
- class Foo2(Foo):
51
- def __init__(self):
52
- super().__init__()
53
- nonlocal foo2_init_calls
54
- foo2_init_calls += 1
55
-
56
- assert Foo2() is Foo2()
57
- assert foo2_init_calls == 1
58
- assert foo_init_calls == 2
@@ -1,72 +0,0 @@
1
- import abc
2
-
3
- import pytest
4
-
5
- from ..virtual import Callable
6
- from ..virtual import Virtual
7
- from ..virtual import virtual_check
8
-
9
-
10
- def test_virtual():
11
- class P(Virtual):
12
- @abc.abstractmethod
13
- def f(self):
14
- raise NotImplementedError
15
-
16
- with pytest.raises(TypeError):
17
- P() # type: ignore
18
-
19
- class A:
20
- def f(self):
21
- pass
22
-
23
- class B:
24
- def g(self):
25
- pass
26
-
27
- A()
28
-
29
- assert issubclass(A, P)
30
- assert not issubclass(B, P)
31
- assert isinstance(A(), P)
32
- assert not isinstance(B(), P)
33
-
34
- class C(P):
35
- def f(self):
36
- pass
37
-
38
- with pytest.raises(TypeError):
39
- class D(P):
40
- pass
41
-
42
- D() # type: ignore
43
-
44
- virtual_check(P)(A)
45
- with pytest.raises(TypeError):
46
- virtual_check(P)(B)
47
-
48
-
49
- def test_callable():
50
- with pytest.raises(Exception):
51
- Callable()
52
-
53
- with pytest.raises(Exception):
54
- class C(Callable): # noqa
55
- pass
56
-
57
- def f():
58
- pass
59
-
60
- assert isinstance(f, Callable)
61
- assert not isinstance(5, Callable)
62
-
63
- class D:
64
- pass
65
-
66
- class E:
67
- def __call__(self):
68
- pass
69
-
70
- assert isinstance(D, Callable)
71
- assert isinstance(E, Callable)
72
- assert isinstance(E(), Callable)
@@ -1,54 +0,0 @@
1
- import threading
2
-
3
- from ... import pydevd as opd
4
- from ._registry import register
5
-
6
-
7
- @register
8
- class PycharmPlugin:
9
-
10
- def pytest_addoption(self, parser):
11
- parser.addoption('--no-pycharm-debug', action='store_true', default=False, help='Disables pycharm debugging')
12
-
13
- def pytest_collection(self, session):
14
- setup = opd.get_setup()
15
- if setup is not None:
16
- if hasattr(session.config, '_env_timeout'):
17
- session.config._env_timeout = None
18
-
19
- def pytest_exception_interact(self, node, call, report):
20
- if node.session.config.option.no_pycharm_debug:
21
- return report
22
-
23
- try:
24
- import pydevd
25
- from pydevd import pydevd_tracing
26
- except ImportError:
27
- return report
28
-
29
- exctype, value, traceback = call.excinfo._excinfo
30
- frames = []
31
- while traceback:
32
- # FIXME: 3.12 DUPLICATE FRAME IDENTITIES!! prob same shit as greenlet/trio, need to 'pin'
33
- # FIXME: uhh it happens in 3.11 too and that works lol
34
- frames.append(traceback.tb_frame)
35
- traceback = traceback.tb_next
36
-
37
- thread = threading.current_thread()
38
- frames_by_id = {id(frame): frame for frame in frames}
39
- frame = frames[-1]
40
- exception = (exctype, value, traceback)
41
-
42
- if hasattr(thread, 'additional_info'):
43
- thread.additional_info.pydev_message = 'test fail'
44
- try:
45
- debugger = pydevd.debugger
46
- except AttributeError:
47
- debugger = pydevd.get_global_debugger()
48
-
49
- pydevd_tracing.SetTrace(None)
50
-
51
- debugger.stop_on_unhandled_exception(thread, frame, frames_by_id, exception)
52
- # debugger.handle_post_mortem_stop(thread, frame, frames_by_id, exception)
53
-
54
- return report