omlish 0.0.0.dev362__py3-none-any.whl → 0.0.0.dev364__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 (123) hide show
  1. omlish/.manifests.json +1 -1
  2. omlish/__about__.py +2 -2
  3. omlish/algorithm/distribute.py +3 -0
  4. omlish/algorithm/toposort.py +3 -0
  5. omlish/algorithm/unify.py +3 -0
  6. omlish/argparse/cli.py +1 -1
  7. omlish/asyncs/utils.py +1 -1
  8. omlish/codecs/base.py +1 -1
  9. omlish/codecs/chain.py +3 -0
  10. omlish/codecs/funcs.py +3 -0
  11. omlish/concurrent/executors.py +3 -0
  12. omlish/configs/nginx.py +3 -0
  13. omlish/configs/types.py +1 -1
  14. omlish/daemons/reparent.py +3 -0
  15. omlish/daemons/services.py +1 -1
  16. omlish/dataclasses/api/classes/conversion.py +1 -1
  17. omlish/dataclasses/processing/priority.py +3 -0
  18. omlish/datetimes.py +2 -1
  19. omlish/diag/pydevd.py +3 -0
  20. omlish/diag/replserver/console.py +3 -0
  21. omlish/diag/replserver/server.py +3 -0
  22. omlish/docker/cli.py +3 -0
  23. omlish/docker/compose.py +3 -0
  24. omlish/docker/manifests.py +3 -0
  25. omlish/formats/json/backends/base.py +3 -0
  26. omlish/formats/json/literals.py +1 -1
  27. omlish/formats/json5/__init__.py +4 -0
  28. omlish/formats/json5/codec.py +19 -0
  29. omlish/formats/json5/rendering.py +1 -1
  30. omlish/formats/props.py +3 -0
  31. omlish/formats/toml/writer.py +3 -0
  32. omlish/funcs/match.py +3 -0
  33. omlish/graphs/trees.py +1 -1
  34. omlish/http/clients/base.py +2 -2
  35. omlish/http/coro/fdio.py +3 -0
  36. omlish/http/coro/simple.py +3 -0
  37. omlish/http/dates.py +3 -0
  38. omlish/http/multipart.py +3 -0
  39. omlish/http/versions.py +3 -0
  40. omlish/inject/multis.py +2 -2
  41. omlish/io/compress/base.py +3 -0
  42. omlish/io/coro/readers.py +1 -1
  43. omlish/io/fileno.py +3 -0
  44. omlish/io/pyio.py +3 -0
  45. omlish/lang/__init__.py +1 -1
  46. omlish/lang/classes/abstract.py +1 -1
  47. omlish/lang/contextmanagers.py +1 -1
  48. omlish/lang/strings.py +1 -1
  49. omlish/lifecycles/abstract.py +3 -0
  50. omlish/lifecycles/base.py +3 -0
  51. omlish/lifecycles/contextmanagers.py +3 -0
  52. omlish/lifecycles/controller.py +3 -0
  53. omlish/lifecycles/manager.py +3 -0
  54. omlish/lifecycles/states.py +3 -0
  55. omlish/lifecycles/transitions.py +3 -0
  56. omlish/lite/check.py +1 -1
  57. omlish/lite/pycharm.py +3 -0
  58. omlish/lite/runtime.py +3 -0
  59. omlish/lite/secrets.py +3 -0
  60. omlish/manifests/types.py +3 -0
  61. omlish/marshal/naming.py +3 -0
  62. omlish/marshal/proxy.py +3 -0
  63. omlish/marshal/registries.py +3 -0
  64. omlish/multiprocessing/proxies.py +3 -0
  65. omlish/multiprocessing/spawn.py +3 -0
  66. omlish/os/deathsig.py +3 -0
  67. omlish/os/fcntl.py +3 -0
  68. omlish/os/filemodes.py +3 -0
  69. omlish/os/files.py +3 -0
  70. omlish/os/linux.py +3 -0
  71. omlish/os/mangle.py +1 -1
  72. omlish/os/paths.py +3 -0
  73. omlish/os/pidfiles/cli.py +3 -0
  74. omlish/os/signals.py +3 -0
  75. omlish/os/sizes.py +3 -0
  76. omlish/os/temp.py +3 -0
  77. omlish/reflect/ops.py +3 -0
  78. omlish/reflect/subst.py +3 -0
  79. omlish/specs/irc/messages/messages.py +1 -1
  80. omlish/specs/irc/numerics/formats.py +3 -0
  81. omlish/specs/irc/protocol/message.py +3 -0
  82. omlish/specs/irc/protocol/nuh.py +3 -0
  83. omlish/specs/irc/protocol/parsing.py +3 -0
  84. omlish/specs/irc/protocol/rendering.py +3 -0
  85. omlish/specs/irc/protocol/tags.py +3 -0
  86. omlish/specs/irc/protocol/utils.py +3 -0
  87. omlish/specs/jsonrpc/errors.py +3 -0
  88. omlish/specs/jsonrpc/marshal.py +3 -0
  89. omlish/specs/jsonschema/keywords/parse.py +11 -11
  90. omlish/sql/alchemy/asyncs.py +6 -3
  91. omlish/sql/alchemy/duckdb.py +3 -0
  92. omlish/sql/alchemy/exprs.py +3 -0
  93. omlish/sql/alchemy/secrets.py +4 -1
  94. omlish/sql/alchemy/sqlean.py +3 -0
  95. omlish/sql/tabledefs/alchemy.py +3 -0
  96. omlish/sql/tabledefs/dtypes.py +3 -0
  97. omlish/sql/tabledefs/lower.py +3 -0
  98. omlish/sql/tabledefs/marshal.py +3 -0
  99. omlish/subprocesses/run.py +2 -2
  100. omlish/term/vt100/c.py +3 -0
  101. omlish/testing/pytest/marks.py +3 -0
  102. omlish/testing/pytest/plugins/asyncs/backends/asyncio.py +3 -0
  103. omlish/testing/pytest/plugins/asyncs/backends/base.py +3 -0
  104. omlish/testing/pytest/plugins/asyncs/backends/trio.py +3 -0
  105. omlish/testing/pytest/plugins/asyncs/backends/trio_asyncio.py +3 -0
  106. omlish/testing/pytest/plugins/asyncs/utils.py +3 -0
  107. omlish/testing/pytest/plugins/depskip.py +3 -0
  108. omlish/testing/pytest/plugins/logging.py +3 -0
  109. omlish/testing/pytest/plugins/managermarks.py +3 -0
  110. omlish/testing/pytest/plugins/pydevd.py +3 -0
  111. omlish/testing/pytest/plugins/repeat.py +3 -0
  112. omlish/testing/pytest/plugins/skips.py +3 -0
  113. omlish/testing/pytest/plugins/spacing.py +3 -0
  114. omlish/testing/pytest/plugins/utils.py +3 -0
  115. omlish/text/go/quoting.py +3 -0
  116. omlish/text/parts.py +1 -1
  117. omlish/text/templating.py +31 -0
  118. {omlish-0.0.0.dev362.dist-info → omlish-0.0.0.dev364.dist-info}/METADATA +1 -1
  119. {omlish-0.0.0.dev362.dist-info → omlish-0.0.0.dev364.dist-info}/RECORD +123 -123
  120. {omlish-0.0.0.dev362.dist-info → omlish-0.0.0.dev364.dist-info}/WHEEL +0 -0
  121. {omlish-0.0.0.dev362.dist-info → omlish-0.0.0.dev364.dist-info}/entry_points.txt +0 -0
  122. {omlish-0.0.0.dev362.dist-info → omlish-0.0.0.dev364.dist-info}/licenses/LICENSE +0 -0
  123. {omlish-0.0.0.dev362.dist-info → omlish-0.0.0.dev364.dist-info}/top_level.txt +0 -0
omlish/.manifests.json CHANGED
@@ -125,7 +125,7 @@
125
125
  "module": ".formats.json5.codec",
126
126
  "attr": "_JSON5_LAZY_CODEC",
127
127
  "file": "omlish/formats/json5/codec.py",
128
- "line": 54,
128
+ "line": 73,
129
129
  "value": {
130
130
  "$.codecs.base.LazyLoadedCodec": {
131
131
  "mod_name": "omlish.formats.json5.codec",
omlish/__about__.py CHANGED
@@ -1,5 +1,5 @@
1
- __version__ = '0.0.0.dev362'
2
- __revision__ = '09c5218470c2d3eab0217fad907ace2acf9de2fb'
1
+ __version__ = '0.0.0.dev364'
2
+ __revision__ = 'efbc21858b1c3354b55f4666e435a1bd79b1a23a'
3
3
 
4
4
 
5
5
  #
@@ -8,6 +8,9 @@ import typing as ta
8
8
  T = ta.TypeVar('T')
9
9
 
10
10
 
11
+ ##
12
+
13
+
11
14
  def distribute_evenly(
12
15
  items: ta.Iterable[ta.Tuple[T, float]],
13
16
  n_bins: int,
@@ -7,6 +7,9 @@ import typing as ta
7
7
  T = ta.TypeVar('T')
8
8
 
9
9
 
10
+ ##
11
+
12
+
10
13
  def mut_toposort(data: ta.Dict[T, ta.Set[T]]) -> ta.Iterator[ta.Set[T]]:
11
14
  for k, v in data.items():
12
15
  v.discard(k)
omlish/algorithm/unify.py CHANGED
@@ -5,6 +5,9 @@ import typing as ta
5
5
  T = ta.TypeVar('T')
6
6
 
7
7
 
8
+ ##
9
+
10
+
8
11
  def mut_unify_sets(sets: ta.Iterable[set[T]]) -> list[set[T]]:
9
12
  rem: list[set[T]] = list(sets)
10
13
  ret: list[set[T]] = []
omlish/argparse/cli.py CHANGED
@@ -259,7 +259,7 @@ class ArgparseCli:
259
259
 
260
260
  if self._unknown_args and not (cmd is not None and cmd.accepts_unknown):
261
261
  msg = f'unrecognized arguments: {" ".join(self._unknown_args)}'
262
- if (parser := self.get_parser()).exit_on_error: # type: ignore
262
+ if (parser := self.get_parser()).exit_on_error:
263
263
  parser.error(msg)
264
264
  else:
265
265
  raise argparse.ArgumentError(None, msg)
omlish/asyncs/utils.py CHANGED
@@ -9,7 +9,7 @@ T = ta.TypeVar('T')
9
9
  ##
10
10
 
11
11
 
12
- async def call_with_async_exit_stack( # type: ignore[return] # ???
12
+ async def call_with_async_exit_stack(
13
13
  fn: ta.Callable[ta.Concatenate[contextlib.AsyncExitStack, P], ta.Awaitable[T]],
14
14
  *args: ta.Any,
15
15
  **kwargs: ta.Any,
omlish/codecs/base.py CHANGED
@@ -72,7 +72,7 @@ class Codec:
72
72
  name: str = dc.xfield(coerce=check_codec_name)
73
73
  aliases: ta.Collection[str] | None = dc.xfield(
74
74
  default=None,
75
- coerce=lang.opt_fn(lambda s: [check_codec_name(a) for a in s]), # type: ignore
75
+ coerce=lang.opt_fn(lambda s: [check_codec_name(a) for a in s]),
76
76
  )
77
77
 
78
78
  input: rfl.Type = dc.xfield(coerce=rfl.type_)
omlish/codecs/chain.py CHANGED
@@ -4,6 +4,9 @@ import typing as ta
4
4
  from .base import EagerCodec
5
5
 
6
6
 
7
+ ##
8
+
9
+
7
10
  @dc.dataclass(frozen=True)
8
11
  class ChainEagerCodec(EagerCodec[ta.Any, ta.Any]):
9
12
  codecs: ta.Sequence[EagerCodec]
omlish/codecs/funcs.py CHANGED
@@ -9,6 +9,9 @@ I = ta.TypeVar('I')
9
9
  O = ta.TypeVar('O')
10
10
 
11
11
 
12
+ ##
13
+
14
+
12
15
  @dc.dataclass(frozen=True)
13
16
  class FnPairEagerCodec(EagerCodec[I, O]):
14
17
  fp: fps.FnPair[I, O]
@@ -7,6 +7,9 @@ T = ta.TypeVar('T')
7
7
  P = ta.ParamSpec('P')
8
8
 
9
9
 
10
+ ##
11
+
12
+
10
13
  class ImmediateExecutor(cf.Executor):
11
14
  def __init__(self, *, immediate_exceptions: bool = False) -> None:
12
15
  super().__init__()
omlish/configs/nginx.py CHANGED
@@ -14,6 +14,9 @@ from ..lite.check import check
14
14
  from ..text.indent import IndentWriter
15
15
 
16
16
 
17
+ ##
18
+
19
+
17
20
  @dc.dataclass()
18
21
  class NginxConfigItems:
19
22
  lst: ta.List['NginxConfigItem']
omlish/configs/types.py CHANGED
@@ -6,4 +6,4 @@ import typing as ta
6
6
  ConfigMap = ta.Mapping[str, ta.Any]
7
7
 
8
8
 
9
- #
9
+ ##
@@ -2,6 +2,9 @@ import os
2
2
  import sys
3
3
 
4
4
 
5
+ ##
6
+
7
+
5
8
  def reparent_process(
6
9
  *,
7
10
  no_close_stdio: bool = False,
@@ -108,7 +108,7 @@ class ServiceDaemon(lang.Final, ta.Generic[ServiceT, ServiceConfigT]):
108
108
  def service_(self) -> ServiceT:
109
109
  with self._lock:
110
110
  if isinstance(self.service, Service):
111
- return self.service # type: ignore[return-value]
111
+ return self.service
112
112
  elif isinstance(self.service, Service.Config):
113
113
  return Service.from_config(self.service) # type: ignore[return-value]
114
114
  else:
@@ -6,7 +6,7 @@ from ...specs import ClassSpec
6
6
  from ...specs import FieldSpec
7
7
 
8
8
 
9
- #
9
+ ##
10
10
 
11
11
 
12
12
  def std_params_to_class_spec(
@@ -1,6 +1,9 @@
1
1
  import enum
2
2
 
3
3
 
4
+ ##
5
+
6
+
4
7
  class ProcessorPriority(enum.IntEnum):
5
8
  BOOTSTRAP = enum.auto()
6
9
 
omlish/datetimes.py CHANGED
@@ -68,7 +68,8 @@ def parse_timedelta(s: str) -> datetime.timedelta:
68
68
  timedelta_kwargs = {
69
69
  k: float(v)
70
70
  for k, v in match.groupdict().items()
71
- if k != 'negative' and v is not None}
71
+ if k != 'negative' and v is not None
72
+ }
72
73
  if not timedelta_kwargs:
73
74
  raise ValueError
74
75
  sign = -1 if match.groupdict().get('negative') else 1
omlish/diag/pydevd.py CHANGED
@@ -39,6 +39,9 @@ from .. import check
39
39
  from .. import lang
40
40
 
41
41
 
42
+ ##
43
+
44
+
42
45
  ALLOW_DEBUGGER_CALLS = False
43
46
 
44
47
 
@@ -31,6 +31,9 @@ from ... import check
31
31
  log = logging.getLogger(__name__)
32
32
 
33
33
 
34
+ ##
35
+
36
+
34
37
  class DisconnectError(Exception):
35
38
  pass
36
39
 
@@ -37,6 +37,9 @@ from .console import InteractiveSocketConsole
37
37
  log = logging.getLogger(__name__)
38
38
 
39
39
 
40
+ ##
41
+
42
+
40
43
  class ReplServer:
41
44
  CONNECTION_THREAD_NAME = 'ReplServerConnection'
42
45
 
omlish/docker/cli.py CHANGED
@@ -18,6 +18,9 @@ from .. import marshal as msh
18
18
  from ..formats import json
19
19
 
20
20
 
21
+ ##
22
+
23
+
21
24
  @dc.dataclass(frozen=True)
22
25
  @msh.update_object_metadata(field_naming=msh.Naming.CAMEL, unknown_field='x')
23
26
  @msh.update_fields_metadata(['id'], name='ID')
omlish/docker/compose.py CHANGED
@@ -14,6 +14,9 @@ else:
14
14
  yaml = lang.proxy_import('yaml')
15
15
 
16
16
 
17
+ ##
18
+
19
+
17
20
  class ComposeConfig:
18
21
  def __init__(
19
22
  self,
@@ -8,6 +8,9 @@ from .. import lang
8
8
  from .. import marshal as msh
9
9
 
10
10
 
11
+ ##
12
+
13
+
11
14
  SCHEMA_VERSION = 2
12
15
 
13
16
 
@@ -4,6 +4,9 @@ import typing as ta
4
4
  from .... import lang
5
5
 
6
6
 
7
+ ##
8
+
9
+
7
10
  class Backend(lang.Abstract):
8
11
  @abc.abstractmethod
9
12
  def dump(self, obj: ta.Any, fp: ta.Any, **kwargs: ta.Any) -> None:
@@ -118,7 +118,7 @@ def encode_string(
118
118
  if process_chunks is not None:
119
119
  chunks: list[str] = [
120
120
  replace(p.group(0)) if isinstance(p, re.Match) else p
121
- for p in lang.iter_matches(pat, s)
121
+ for p in lang.iter_pat(pat, s)
122
122
  ]
123
123
 
124
124
  return ''.join([
@@ -1,7 +1,11 @@
1
1
  from .codec import ( # noqa
2
+ dump,
3
+ dump_compact,
4
+ dump_pretty,
2
5
  dumps,
3
6
  dumps_pretty,
4
7
  dumps_compact,
8
+ load,
5
9
  loads,
6
10
  )
7
11
 
@@ -42,10 +42,29 @@ def dumps_compact(obj: ta.Any, **kwargs: ta.Any) -> str:
42
42
  return dumps(obj, **json.COMPACT_KWARGS, **kwargs)
43
43
 
44
44
 
45
+ def dump(obj: ta.Any, fp: ta.Any, **kwargs: ta.Any) -> None:
46
+ fp.write(dumps(obj, **kwargs))
47
+
48
+
49
+ def dump_pretty(obj: ta.Any, fp: ta.Any, **kwargs: ta.Any) -> None:
50
+ fp.write(dumps_pretty(obj, **kwargs))
51
+
52
+
53
+ def dump_compact(obj: ta.Any, fp: ta.Any, **kwargs: ta.Any) -> None:
54
+ fp.write(dumps_compact(obj, **kwargs))
55
+
56
+
57
+ #
58
+
59
+
45
60
  def loads(s: str, **kwargs: ta.Any) -> ta.Any:
46
61
  return parsing.parse(s, **kwargs)
47
62
 
48
63
 
64
+ def load(fp: ta.Any, **kwargs: ta.Any) -> ta.Any:
65
+ return loads(fp.read(), **kwargs)
66
+
67
+
49
68
  ##
50
69
 
51
70
 
@@ -75,7 +75,7 @@ class Json5Renderer(JsonRenderer):
75
75
  if c[0] == '\\':
76
76
  it = [c]
77
77
  else:
78
- it = lang.iter_matches(SOFTWRAP_WS_PAT, c)
78
+ it = lang.iter_pat(SOFTWRAP_WS_PAT, c)
79
79
 
80
80
  for x in it:
81
81
  if isinstance(x, re.Match):
omlish/formats/props.py CHANGED
@@ -35,6 +35,9 @@ import time
35
35
  import typing as ta
36
36
 
37
37
 
38
+ ##
39
+
40
+
38
41
  class PropertyTuple(ta.NamedTuple):
39
42
  data: ta.Any
40
43
  meta: ta.Any
@@ -5,6 +5,9 @@ import string
5
5
  import typing as ta
6
6
 
7
7
 
8
+ ##
9
+
10
+
8
11
  class TomlWriter:
9
12
  @dc.dataclass(frozen=True)
10
13
  class Literal:
omlish/funcs/match.py CHANGED
@@ -143,6 +143,7 @@ class CachedMatchFn(MatchFn[P, T]):
143
143
  lock: lang.DefaultLockable = None,
144
144
  ) -> None:
145
145
  super().__init__()
146
+
146
147
  self._f = f
147
148
  self._key = key
148
149
  self._lock = lock
@@ -206,8 +207,10 @@ class MatchFnClass(MatchFn[P, T]):
206
207
 
207
208
  def __init_subclass__(cls, strict: bool = False, **kwargs: ta.Any) -> None:
208
209
  super().__init_subclass__()
210
+
209
211
  if '_cls_match_fn' in cls.__dict__:
210
212
  raise AttributeError('_cls_match_fn')
213
+
211
214
  d = {}
212
215
  for c in cls.__mro__:
213
216
  for a, o in c.__dict__.items():
omlish/graphs/trees.py CHANGED
@@ -62,7 +62,7 @@ class BasicTreeAnalysis(ta.Generic[NodeT]):
62
62
 
63
63
  self._set_fac: ta.Callable[..., ta.MutableSet[NodeT]] = col.IdentitySet if identity else set
64
64
  self._dict_fac: ta.Callable[..., ta.MutableMapping[NodeT, ta.Any]] = col.IdentityKeyDict if identity else dict
65
- self._rank_seq_fac: ta.Callable[..., col.RankedSeq[NodeT]] = functools.partial(col.RankedSeq, identity=identity) # type: ignore # noqa
65
+ self._rank_seq_fac: ta.Callable[..., col.RankedSeq[NodeT]] = functools.partial(col.RankedSeq, identity=identity)
66
66
 
67
67
  def walk(cur: NodeT, parent: NodeT | None) -> None:
68
68
  check.not_none(cur)
@@ -116,12 +116,12 @@ def close_response(resp: BaseHttpResponse) -> None:
116
116
  @contextlib.contextmanager
117
117
  def closing_response(resp: BaseHttpResponseT) -> ta.Iterator[BaseHttpResponseT]:
118
118
  if isinstance(resp, HttpResponse):
119
- yield resp # type: ignore
119
+ yield resp
120
120
  return
121
121
 
122
122
  elif isinstance(resp, StreamHttpResponse):
123
123
  with contextlib.closing(resp):
124
- yield resp # type: ignore
124
+ yield resp
125
125
 
126
126
  else:
127
127
  raise TypeError(resp)
omlish/http/coro/fdio.py CHANGED
@@ -12,6 +12,9 @@ from ..handlers import HttpHandler
12
12
  from .server import CoroHttpServer
13
13
 
14
14
 
15
+ ##
16
+
17
+
15
18
  class CoroHttpServerConnectionFdioHandler(SocketFdioHandler):
16
19
  def __init__(
17
20
  self,
@@ -33,6 +33,9 @@ if ta.TYPE_CHECKING:
33
33
  import ssl
34
34
 
35
35
 
36
+ ##
37
+
38
+
36
39
  @contextlib.contextmanager
37
40
  def make_simple_http_server(
38
41
  bind: CanSocketBinder,
omlish/http/dates.py CHANGED
@@ -26,6 +26,9 @@ import time
26
26
  from .. import check
27
27
 
28
28
 
29
+ ##
30
+
31
+
29
32
  def _dt_as_utc(dt: datetime.datetime | None) -> datetime.datetime | None:
30
33
  if dt is None:
31
34
  return dt
omlish/http/multipart.py CHANGED
@@ -12,6 +12,9 @@ from .. import cached
12
12
  MultipartData: ta.TypeAlias = ta.Any # bytes | file
13
13
 
14
14
 
15
+ ##
16
+
17
+
15
18
  @dc.dataclass(frozen=True)
16
19
  class MultipartField:
17
20
  data: MultipartData
omlish/http/versions.py CHANGED
@@ -3,6 +3,9 @@
3
3
  import typing as ta
4
4
 
5
5
 
6
+ ##
7
+
8
+
6
9
  class HttpProtocolVersion(ta.NamedTuple):
7
10
  major: int
8
11
  minor: int
omlish/inject/multis.py CHANGED
@@ -87,7 +87,7 @@ class SetBinder(ElementGenerator, ta.Generic[T]):
87
87
  if not isinstance(self, SetBinder):
88
88
  raise TypeError
89
89
  self._sbs.extend(SetBinding(self._multi_key, as_key(k)) for k in keys)
90
- return self # type: ignore
90
+ return self
91
91
 
92
92
  def __iter__(self) -> ta.Iterator[Element]:
93
93
  yield self._set_provider_binding
@@ -115,7 +115,7 @@ class MapBinder(ElementGenerator, ta.Generic[K, V]):
115
115
  if not isinstance(self, MapBinder):
116
116
  raise TypeError
117
117
  self._mbs.append(MapBinding(self._multi_key, map_key, as_key(map_value_key)))
118
- return self # type: ignore
118
+ return self
119
119
 
120
120
  def __iter__(self) -> ta.Iterator[Element]:
121
121
  yield self._map_provider_binding
@@ -4,6 +4,9 @@ from ..coro import BytesSteppedCoro
4
4
  from ..coro import BytesSteppedReaderCoro
5
5
 
6
6
 
7
+ ##
8
+
9
+
7
10
  class Compression(abc.ABC):
8
11
  @abc.abstractmethod
9
12
  def compress(self, d: bytes) -> bytes:
omlish/io/coro/readers.py CHANGED
@@ -100,7 +100,7 @@ class PrependableCoroReader(CoroReader[AnyT]):
100
100
  if rem:
101
101
  d = check.not_none((yield rem))
102
102
  if d:
103
- lst.append(d) # type: ignore[unreachable]
103
+ lst.append(d)
104
104
 
105
105
  if len(lst) == 1:
106
106
  return lst[0]
omlish/io/fileno.py CHANGED
@@ -3,6 +3,9 @@
3
3
  import dataclasses as dc
4
4
 
5
5
 
6
+ ##
7
+
8
+
6
9
  @dc.dataclass(frozen=True)
7
10
  class Fileno:
8
11
  fd: int
omlish/io/pyio.py CHANGED
@@ -52,6 +52,9 @@ import threading
52
52
  import warnings
53
53
 
54
54
 
55
+ ##
56
+
57
+
55
58
  valid_seek_flags = {0, 1, 2} # Hardwired values
56
59
  if hasattr(os, 'SEEK_HOLE'):
57
60
  valid_seek_flags.add(os.SEEK_HOLE)
omlish/lang/__init__.py CHANGED
@@ -327,7 +327,7 @@ from .strings import ( # noqa
327
327
  is_ident_cont,
328
328
  is_ident_start,
329
329
  is_sunder,
330
- iter_matches,
330
+ iter_pat,
331
331
  prefix_delimited,
332
332
  prefix_lines,
333
333
  replace_many,
@@ -19,7 +19,7 @@ _INTERNAL_ABSTRACT_ATTRS = frozenset([_FORCE_ABSTRACT_ATTR])
19
19
 
20
20
  def make_abstract(obj: T) -> T:
21
21
  if callable(obj):
22
- return ta.cast(T, abc.abstractmethod(obj))
22
+ return abc.abstractmethod(obj)
23
23
  elif isinstance(obj, property):
24
24
  return ta.cast(T, property(
25
25
  abc.abstractmethod(obj.fget) if obj.fget is not None else None,
@@ -123,7 +123,7 @@ class AsyncContextManager(abc.ABC, ta.Generic[T]):
123
123
  def maybe_managing(obj: T) -> ta.Iterator[T]:
124
124
  if isinstance(obj, ta.ContextManager):
125
125
  with obj:
126
- yield ta.cast(T, obj)
126
+ yield obj
127
127
  else:
128
128
  yield obj
129
129
 
omlish/lang/strings.py CHANGED
@@ -216,7 +216,7 @@ STRING_BOOL_VALUES: ta.Mapping[str, bool] = {
216
216
  ##
217
217
 
218
218
 
219
- def iter_matches(pat: re.Pattern[str], s: str, **kwargs: ta.Any) -> ta.Generator[str | re.Match]:
219
+ def iter_pat(pat: re.Pattern[str], s: str, **kwargs: ta.Any) -> ta.Generator[str | re.Match]:
220
220
  p = 0
221
221
  for m in re.finditer(pat, s, **kwargs):
222
222
  if p < (l := m.start()):
@@ -9,6 +9,9 @@ from .base import Lifecycle
9
9
  AbstractLifecycleT = ta.TypeVar('AbstractLifecycleT', bound='AbstractLifecycle')
10
10
 
11
11
 
12
+ ##
13
+
14
+
12
15
  class AbstractLifecycle(lang.Abstract):
13
16
  @dc.dataclass(frozen=True)
14
17
  class _Lifecycle(Lifecycle, lang.Final, ta.Generic[AbstractLifecycleT]):
omlish/lifecycles/base.py CHANGED
@@ -8,6 +8,9 @@ LifecycleT = ta.TypeVar('LifecycleT', bound='Lifecycle')
8
8
  LifecycleCallback: ta.TypeAlias = ta.Callable[[LifecycleT], None]
9
9
 
10
10
 
11
+ ##
12
+
13
+
11
14
  class Lifecycle:
12
15
  def lifecycle_construct(self) -> None:
13
16
  pass
@@ -14,6 +14,9 @@ LifecycleT = ta.TypeVar('LifecycleT', bound='Lifecycle')
14
14
  ContextManagerT = ta.TypeVar('ContextManagerT', bound=ta.ContextManager)
15
15
 
16
16
 
17
+ ##
18
+
19
+
17
20
  @dc.dataclass(frozen=True)
18
21
  class ContextManagerLifecycle(Lifecycle, lang.Final, ta.Generic[ContextManagerT]):
19
22
  cm: ContextManagerT
@@ -13,6 +13,9 @@ from .transitions import LifecycleTransitions
13
13
  LifecycleT = ta.TypeVar('LifecycleT', bound='Lifecycle')
14
14
 
15
15
 
16
+ ##
17
+
18
+
16
19
  class LifecycleListener(ta.Generic[LifecycleT]):
17
20
  def on_starting(self, obj: LifecycleT) -> None:
18
21
  pass
@@ -12,6 +12,9 @@ from .states import LifecycleStateError
12
12
  from .states import LifecycleStates
13
13
 
14
14
 
15
+ ##
16
+
17
+
15
18
  class LifecycleManager(AbstractLifecycle):
16
19
  @dc.dataclass(frozen=True)
17
20
  class Entry(lang.Final):
@@ -5,6 +5,9 @@ from .. import dataclasses as dc
5
5
  from .. import lang
6
6
 
7
7
 
8
+ ##
9
+
10
+
8
11
  class LifecycleStateError(Exception):
9
12
  pass
10
13
 
@@ -5,6 +5,9 @@ from .states import LifecycleState
5
5
  from .states import LifecycleStates
6
6
 
7
7
 
8
+ ##
9
+
10
+
8
11
  @dc.dataclass(frozen=True)
9
12
  class LifecycleTransition(lang.Final):
10
13
  old: frozenset[LifecycleState]
omlish/lite/check.py CHANGED
@@ -437,7 +437,7 @@ class Checks:
437
437
  render_fmt='%s',
438
438
  )
439
439
 
440
- return v # type: ignore
440
+ return v
441
441
 
442
442
  def non_empty_str(self, v: ta.Optional[str], msg: CheckMessage = None) -> str:
443
443
  if not isinstance(v, str) or not v:
omlish/lite/pycharm.py CHANGED
@@ -3,6 +3,9 @@ import dataclasses as dc
3
3
  import typing as ta
4
4
 
5
5
 
6
+ ##
7
+
8
+
6
9
  DEFAULT_PYCHARM_VERSION = '242.23726.102'
7
10
 
8
11