omdev 0.0.0.dev419__py3-none-any.whl → 0.0.0.dev421__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.
@@ -1,5 +1,7 @@
1
1
  import abc
2
2
 
3
+ from omlish import lang
4
+
3
5
  from .types import CacheEntry
4
6
  from .types import CacheKey
5
7
 
@@ -7,7 +9,7 @@ from .types import CacheKey
7
9
  ##
8
10
 
9
11
 
10
- class Storage(abc.ABC):
12
+ class Storage(lang.Abstract):
11
13
  @abc.abstractmethod
12
14
  def get(self, key: CacheKey) -> CacheEntry | None:
13
15
  raise NotImplementedError
omdev/ci/cache.py CHANGED
@@ -15,6 +15,7 @@ import time
15
15
  import typing as ta
16
16
  import urllib.request
17
17
 
18
+ from omlish.lite.abstract import Abstract
18
19
  from omlish.lite.cached import cached_nullary
19
20
  from omlish.lite.check import check
20
21
  from omlish.lite.logs import log
@@ -29,7 +30,7 @@ CacheVersion = ta.NewType('CacheVersion', int)
29
30
  ##
30
31
 
31
32
 
32
- class FileCache(abc.ABC):
33
+ class FileCache(Abstract):
33
34
  DEFAULT_CACHE_VERSION: ta.ClassVar[CacheVersion] = CacheVersion(CI_CACHE_VERSION)
34
35
 
35
36
  def __init__(
@@ -229,7 +230,7 @@ class DirectoryFileCache(FileCache):
229
230
 
230
231
  class DataCache:
231
232
  @dc.dataclass(frozen=True)
232
- class Data(abc.ABC): # noqa
233
+ class Data(Abstract):
233
234
  pass
234
235
 
235
236
  @dc.dataclass(frozen=True)
@@ -3,6 +3,8 @@ import abc
3
3
  import dataclasses as dc
4
4
  import typing as ta
5
5
 
6
+ from omlish.lite.abstract import Abstract
7
+
6
8
  from .cache import DockerCache
7
9
  from .cache import DockerCacheKey
8
10
  from .cmds import is_docker_image_present
@@ -12,7 +14,7 @@ from .cmds import tag_docker_image
12
14
  ##
13
15
 
14
16
 
15
- class DockerBuildCaching(abc.ABC):
17
+ class DockerBuildCaching(Abstract):
16
18
  @abc.abstractmethod
17
19
  def cached_build_docker_image(
18
20
  self,
omdev/ci/docker/cache.py CHANGED
@@ -3,6 +3,7 @@ import abc
3
3
  import dataclasses as dc
4
4
  import typing as ta
5
5
 
6
+ from omlish.lite.abstract import Abstract
6
7
  from omlish.lite.check import check
7
8
  from omlish.os.temp import temp_file_context
8
9
 
@@ -35,7 +36,7 @@ class DockerCacheKey:
35
36
  ##
36
37
 
37
38
 
38
- class DockerCache(abc.ABC):
39
+ class DockerCache(Abstract):
39
40
  @abc.abstractmethod
40
41
  def load_cache_docker_image(self, key: DockerCacheKey) -> ta.Awaitable[ta.Optional[str]]:
41
42
  raise NotImplementedError
@@ -1,9 +1,9 @@
1
1
  # ruff: noqa: UP006 UP007 UP045
2
- import abc
3
2
  import dataclasses as dc
4
3
  import os.path
5
4
  import typing as ta
6
5
 
6
+ from omlish.lite.abstract import Abstract
7
7
  from omlish.lite.check import check
8
8
 
9
9
  from ....dataserver.routes import DataServerRoute
@@ -25,7 +25,7 @@ class CacheServedDockerImageManifest:
25
25
  content_length: int
26
26
 
27
27
  @dc.dataclass(frozen=True)
28
- class Target(abc.ABC): # noqa
28
+ class Target(Abstract):
29
29
  pass
30
30
 
31
31
  @dc.dataclass(frozen=True)
@@ -3,6 +3,7 @@ import abc
3
3
  import dataclasses as dc
4
4
  import typing as ta
5
5
 
6
+ from omlish.lite.abstract import Abstract
6
7
  from omlish.lite.timing import log_timing_context
7
8
  from omlish.text.mangle import StringMangler
8
9
 
@@ -16,7 +17,7 @@ from .cmds import pull_docker_image
16
17
  ##
17
18
 
18
19
 
19
- class DockerImagePulling(abc.ABC):
20
+ class DockerImagePulling(Abstract):
20
21
  @abc.abstractmethod
21
22
  def pull_docker_image(self, image: str) -> ta.Awaitable[None]:
22
23
  raise NotImplementedError
@@ -5,6 +5,7 @@ import shlex
5
5
  import typing as ta
6
6
 
7
7
  from omlish.asyncs.asyncio.subprocesses import asyncio_subprocesses
8
+ from omlish.lite.abstract import Abstract
8
9
  from omlish.lite.timing import log_timing_context
9
10
  from omlish.os.temp import temp_dir_context
10
11
 
@@ -15,7 +16,7 @@ from ...oci.repositories import OciRepository
15
16
  ##
16
17
 
17
18
 
18
- class DockerImageRepositoryOpener(abc.ABC):
19
+ class DockerImageRepositoryOpener(Abstract):
19
20
  @abc.abstractmethod
20
21
  def open_docker_image_repository(self, image: str) -> ta.AsyncContextManager[OciRepository]:
21
22
  raise NotImplementedError
@@ -12,6 +12,7 @@ import urllib.request
12
12
 
13
13
  from omlish.asyncs.asyncio.utils import asyncio_wait_concurrent
14
14
  from omlish.http.urllib import NonRaisingUrllibErrorProcessor
15
+ from omlish.lite.abstract import Abstract
15
16
  from omlish.lite.check import check
16
17
  from omlish.lite.json import json_dumps_compact
17
18
  from omlish.lite.logs import log
@@ -24,9 +25,9 @@ from ..env import register_github_env_var
24
25
  ##
25
26
 
26
27
 
27
- class GithubCacheClient(abc.ABC):
28
+ class GithubCacheClient(Abstract):
28
29
  @dc.dataclass(frozen=True)
29
- class Entry(abc.ABC): # noqa
30
+ class Entry(Abstract):
30
31
  pass
31
32
 
32
33
  @abc.abstractmethod
@@ -48,7 +49,7 @@ class GithubCacheClient(abc.ABC):
48
49
  ##
49
50
 
50
51
 
51
- class BaseGithubCacheClient(GithubCacheClient, abc.ABC):
52
+ class BaseGithubCacheClient(GithubCacheClient, Abstract):
52
53
  AUTH_TOKEN_ENV_VAR = register_github_env_var('ACTIONS_RUNTIME_TOKEN') # noqa
53
54
 
54
55
  KEY_SUFFIX_ENV_VAR = register_github_env_var('GITHUB_RUN_ID')
@@ -29,7 +29,7 @@ class ImageClipboardContents(ClipboardContents):
29
29
  ##
30
30
 
31
31
 
32
- class Clipboard(abc.ABC):
32
+ class Clipboard(lang.Abstract):
33
33
  @abc.abstractmethod
34
34
  def get(self) -> list[ClipboardContents]:
35
35
  raise NotImplementedError
omdev/cmake.py CHANGED
@@ -2,6 +2,7 @@ import abc
2
2
  import typing as ta
3
3
 
4
4
  from omlish import dataclasses as dc
5
+ from omlish import lang
5
6
 
6
7
 
7
8
  ##
@@ -21,7 +22,7 @@ class Var:
21
22
 
22
23
 
23
24
  @dc.dataclass(frozen=True)
24
- class Target(abc.ABC):
25
+ class Target(lang.Abstract):
25
26
  name: str
26
27
  src_files: ta.Sequence[str]
27
28
 
@@ -7,6 +7,7 @@ import os
7
7
  import typing as ta
8
8
  import urllib.request
9
9
 
10
+ from omlish.lite.abstract import Abstract
10
11
  from omlish.lite.check import check
11
12
 
12
13
  from .targets import BytesDataServerTarget
@@ -50,7 +51,7 @@ class DataServerError(Exception):
50
51
  pass
51
52
 
52
53
 
53
- class DataServerHandler(abc.ABC):
54
+ class DataServerHandler(Abstract):
54
55
  @abc.abstractmethod
55
56
  def handle(self, req: DataServerRequest) -> DataServerResponse:
56
57
  raise NotImplementedError
@@ -59,7 +60,7 @@ class DataServerHandler(abc.ABC):
59
60
  ##
60
61
 
61
62
 
62
- class DataServerTargetHandler(DataServerHandler, abc.ABC, ta.Generic[DataServerTargetT]):
63
+ class DataServerTargetHandler(DataServerHandler, Abstract, ta.Generic[DataServerTargetT]):
63
64
  def __init__(self, target: DataServerTargetT) -> None:
64
65
  super().__init__()
65
66
 
@@ -1,8 +1,8 @@
1
1
  # ruff: noqa: UP006 UP007 UP045
2
- import abc
3
2
  import dataclasses as dc
4
3
  import typing as ta
5
4
 
5
+ from omlish.lite.abstract import Abstract
6
6
  from omlish.lite.check import check
7
7
  from omlish.lite.dataclasses import dataclass_maybe_post_init
8
8
  from omlish.lite.marshal import OBJ_MARSHALER_OMIT_IF_NONE
@@ -12,7 +12,7 @@ from omlish.lite.marshal import OBJ_MARSHALER_OMIT_IF_NONE
12
12
 
13
13
 
14
14
  @dc.dataclass(frozen=True)
15
- class DataServerTarget(abc.ABC): # noqa
15
+ class DataServerTarget(Abstract):
16
16
  content_type: ta.Optional[str] = dc.field(default=None, metadata={OBJ_MARSHALER_OMIT_IF_NONE: True})
17
17
  content_length: ta.Optional[int] = dc.field(default=None, metadata={OBJ_MARSHALER_OMIT_IF_NONE: True})
18
18
 
@@ -9,6 +9,7 @@ TODO:
9
9
  import abc
10
10
  import typing as ta
11
11
 
12
+ from omlish.lite.abstract import Abstract
12
13
  from omlish.lite.strings import snake_case
13
14
 
14
15
  from ..types import Interp
@@ -19,13 +20,13 @@ from ..types import InterpVersion
19
20
  ##
20
21
 
21
22
 
22
- class InterpProvider(abc.ABC):
23
+ class InterpProvider(Abstract):
23
24
  name: ta.ClassVar[str]
24
25
 
25
26
  def __init_subclass__(cls, **kwargs: ta.Any) -> None:
26
27
  super().__init_subclass__(**kwargs)
27
28
 
28
- if abc.ABC not in cls.__bases__ and 'name' not in cls.__dict__:
29
+ if Abstract not in cls.__bases__ and 'name' not in cls.__dict__:
29
30
  sfx = 'InterpProvider'
30
31
  if not cls.__name__.endswith(sfx):
31
32
  raise NameError(cls)
@@ -8,6 +8,7 @@ import sys
8
8
  import typing as ta
9
9
 
10
10
  from omlish.asyncs.asyncio.subprocesses import asyncio_subprocesses
11
+ from omlish.lite.abstract import Abstract
11
12
  from omlish.lite.cached import async_cached_nullary
12
13
  from omlish.lite.cached import cached_nullary
13
14
  from omlish.lite.check import check
@@ -89,7 +90,7 @@ THREADED_PYENV_INSTALL_OPTS = PyenvInstallOpts(conf_opts=['--disable-gil'])
89
90
  #
90
91
 
91
92
 
92
- class PyenvInstallOptsProvider(abc.ABC):
93
+ class PyenvInstallOptsProvider(Abstract):
93
94
  @abc.abstractmethod
94
95
  def opts(self) -> ta.Awaitable[PyenvInstallOpts]:
95
96
  raise NotImplementedError