omdev 0.0.0.dev239__py3-none-any.whl → 0.0.0.dev241__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.
- omdev/.manifests.json +1 -1
- omdev/ci/cache.py +1 -1
- omdev/ci/ci.py +36 -11
- omdev/ci/cli.py +8 -0
- omdev/ci/consts.py +1 -1
- omdev/ci/docker/buildcaching.py +4 -3
- omdev/ci/docker/cache.py +28 -6
- omdev/ci/docker/cacheserved/__init__.py +0 -0
- omdev/ci/docker/cacheserved/cache.py +209 -0
- omdev/ci/docker/cacheserved/manifests.py +122 -0
- omdev/ci/docker/dataserver.py +9 -1
- omdev/ci/docker/imagepulling.py +4 -4
- omdev/ci/docker/inject.py +36 -7
- omdev/ci/github/client.py +2 -2
- omdev/ci/github/inject.py +2 -0
- omdev/ci/inject.py +16 -1
- omdev/dataserver/http.py +1 -0
- omdev/precheck/lite.py +3 -0
- omdev/scripts/bumpversion.py +4 -0
- omdev/scripts/ci.py +7254 -1345
- omdev/scripts/interp.py +21 -12
- omdev/scripts/pyproject.py +21 -12
- omdev/tools/docker.py +11 -27
- omdev/tools/git/cli.py +1 -0
- {omdev-0.0.0.dev239.dist-info → omdev-0.0.0.dev241.dist-info}/METADATA +2 -2
- {omdev-0.0.0.dev239.dist-info → omdev-0.0.0.dev241.dist-info}/RECORD +30 -28
- {omdev-0.0.0.dev239.dist-info → omdev-0.0.0.dev241.dist-info}/WHEEL +1 -1
- omdev/ci/docker/cacheserved.py +0 -262
- {omdev-0.0.0.dev239.dist-info → omdev-0.0.0.dev241.dist-info}/LICENSE +0 -0
- {omdev-0.0.0.dev239.dist-info → omdev-0.0.0.dev241.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev239.dist-info → omdev-0.0.0.dev241.dist-info}/top_level.txt +0 -0
omdev/ci/docker/inject.py
CHANGED
@@ -9,29 +9,58 @@ from .buildcaching import DockerBuildCaching
|
|
9
9
|
from .buildcaching import DockerBuildCachingImpl
|
10
10
|
from .cache import DockerCache
|
11
11
|
from .cache import DockerCacheImpl
|
12
|
+
from .cacheserved.cache import CacheServedDockerCache
|
12
13
|
from .imagepulling import DockerImagePulling
|
13
14
|
from .imagepulling import DockerImagePullingImpl
|
15
|
+
from .repositories import DockerImageRepositoryOpener
|
16
|
+
from .repositories import DockerImageRepositoryOpenerImpl
|
14
17
|
|
15
18
|
|
16
19
|
##
|
17
20
|
|
18
21
|
|
19
22
|
def bind_docker(
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
+
*,
|
24
|
+
build_caching_config: DockerBuildCachingImpl.Config,
|
25
|
+
cache_served_docker_cache_config: ta.Optional[CacheServedDockerCache.Config] = None,
|
26
|
+
image_pulling_config: DockerImagePullingImpl.Config = DockerImagePullingImpl.Config(),
|
23
27
|
) -> InjectorBindings:
|
24
|
-
lst: ta.List[InjectorBindingOrBindings] = [
|
28
|
+
lst: ta.List[InjectorBindingOrBindings] = []
|
29
|
+
|
30
|
+
#
|
31
|
+
|
32
|
+
lst.extend([
|
25
33
|
inj.bind(build_caching_config),
|
26
34
|
inj.bind(DockerBuildCachingImpl, singleton=True),
|
27
35
|
inj.bind(DockerBuildCaching, to_key=DockerBuildCachingImpl),
|
36
|
+
])
|
37
|
+
|
38
|
+
#
|
39
|
+
|
40
|
+
if cache_served_docker_cache_config is not None:
|
41
|
+
lst.extend([
|
42
|
+
inj.bind(DockerImageRepositoryOpenerImpl, singleton=True),
|
43
|
+
inj.bind(DockerImageRepositoryOpener, to_key=DockerImageRepositoryOpenerImpl),
|
28
44
|
|
29
|
-
|
30
|
-
|
45
|
+
inj.bind(cache_served_docker_cache_config),
|
46
|
+
inj.bind(CacheServedDockerCache, singleton=True),
|
47
|
+
inj.bind(DockerCache, to_key=CacheServedDockerCache),
|
48
|
+
])
|
31
49
|
|
50
|
+
else:
|
51
|
+
lst.extend([
|
52
|
+
inj.bind(DockerCacheImpl, singleton=True),
|
53
|
+
inj.bind(DockerCache, to_key=DockerCacheImpl),
|
54
|
+
])
|
55
|
+
|
56
|
+
#
|
57
|
+
|
58
|
+
lst.extend([
|
32
59
|
inj.bind(image_pulling_config),
|
33
60
|
inj.bind(DockerImagePullingImpl, singleton=True),
|
34
61
|
inj.bind(DockerImagePulling, to_key=DockerImagePullingImpl),
|
35
|
-
]
|
62
|
+
])
|
63
|
+
|
64
|
+
#
|
36
65
|
|
37
66
|
return inj.as_bindings(*lst)
|
omdev/ci/github/client.py
CHANGED
@@ -213,7 +213,7 @@ class GithubCacheServiceV1BaseClient(GithubCacheClient, abc.ABC):
|
|
213
213
|
|
214
214
|
#
|
215
215
|
|
216
|
-
KEY_PART_SEPARATOR = '
|
216
|
+
KEY_PART_SEPARATOR = '---'
|
217
217
|
|
218
218
|
def fix_key(self, s: str, partial_suffix: bool = False) -> str:
|
219
219
|
return self.KEY_PART_SEPARATOR.join([
|
@@ -230,7 +230,7 @@ class GithubCacheServiceV1BaseClient(GithubCacheClient, abc.ABC):
|
|
230
230
|
|
231
231
|
def get_entry_url(self, entry: GithubCacheClient.Entry) -> ta.Optional[str]:
|
232
232
|
entry1 = check.isinstance(entry, self.Entry)
|
233
|
-
return entry1.artifact.
|
233
|
+
return entry1.artifact.archive_location
|
234
234
|
|
235
235
|
#
|
236
236
|
|
omdev/ci/github/inject.py
CHANGED
@@ -5,6 +5,7 @@ from omlish.lite.inject import InjectorBindingOrBindings
|
|
5
5
|
from omlish.lite.inject import InjectorBindings
|
6
6
|
from omlish.lite.inject import inj
|
7
7
|
|
8
|
+
from ..cache import DataCache
|
8
9
|
from ..cache import FileCache
|
9
10
|
from .cache import GithubCache
|
10
11
|
|
@@ -15,6 +16,7 @@ from .cache import GithubCache
|
|
15
16
|
def bind_github() -> InjectorBindings:
|
16
17
|
lst: ta.List[InjectorBindingOrBindings] = [
|
17
18
|
inj.bind(GithubCache, singleton=True),
|
19
|
+
inj.bind(DataCache, to_key=GithubCache),
|
18
20
|
inj.bind(FileCache, to_key=GithubCache),
|
19
21
|
]
|
20
22
|
|
omdev/ci/inject.py
CHANGED
@@ -5,10 +5,13 @@ from omlish.lite.inject import InjectorBindingOrBindings
|
|
5
5
|
from omlish.lite.inject import InjectorBindings
|
6
6
|
from omlish.lite.inject import inj
|
7
7
|
|
8
|
+
from .cache import DataCache
|
8
9
|
from .cache import DirectoryFileCache
|
9
10
|
from .cache import FileCache
|
11
|
+
from .cache import FileCacheDataCache
|
10
12
|
from .ci import Ci
|
11
13
|
from .docker.buildcaching import DockerBuildCachingImpl
|
14
|
+
from .docker.cacheserved.cache import CacheServedDockerCache
|
12
15
|
from .docker.imagepulling import DockerImagePullingImpl
|
13
16
|
from .docker.inject import bind_docker
|
14
17
|
from .github.inject import bind_github
|
@@ -24,6 +27,8 @@ def bind_ci(
|
|
24
27
|
directory_file_cache_config: ta.Optional[DirectoryFileCache.Config] = None,
|
25
28
|
|
26
29
|
github: bool = False,
|
30
|
+
|
31
|
+
cache_served_docker: bool = False,
|
27
32
|
) -> InjectorBindings:
|
28
33
|
lst: ta.List[InjectorBindingOrBindings] = [ # noqa
|
29
34
|
inj.bind(config),
|
@@ -37,6 +42,10 @@ def bind_ci(
|
|
37
42
|
always_build=config.always_build,
|
38
43
|
),
|
39
44
|
|
45
|
+
cache_served_docker_cache_config=CacheServedDockerCache.Config(
|
46
|
+
#
|
47
|
+
) if cache_served_docker else None,
|
48
|
+
|
40
49
|
image_pulling_config=DockerImagePullingImpl.Config(
|
41
50
|
always_pull=config.always_pull,
|
42
51
|
),
|
@@ -50,7 +59,13 @@ def bind_ci(
|
|
50
59
|
|
51
60
|
if github:
|
52
61
|
lst.append(bind_github())
|
62
|
+
|
53
63
|
else:
|
54
|
-
lst.
|
64
|
+
lst.extend([
|
65
|
+
inj.bind(FileCache, to_key=DirectoryFileCache),
|
66
|
+
|
67
|
+
inj.bind(FileCacheDataCache, singleton=True),
|
68
|
+
inj.bind(DataCache, to_key=FileCacheDataCache),
|
69
|
+
])
|
55
70
|
|
56
71
|
return inj.as_bindings(*lst)
|
omdev/dataserver/http.py
CHANGED
omdev/precheck/lite.py
CHANGED
@@ -68,6 +68,7 @@ class LitePython8Precheck(Precheck['LitePython8Precheck.Config']):
|
|
68
68
|
@staticmethod
|
69
69
|
def _load_file_module(fp: str) -> None:
|
70
70
|
import os.path # noqa
|
71
|
+
import sys # noqa
|
71
72
|
import types # noqa
|
72
73
|
|
73
74
|
fp = os.path.abspath(fp)
|
@@ -83,6 +84,8 @@ class LitePython8Precheck(Precheck['LitePython8Precheck.Config']):
|
|
83
84
|
mod.__builtins__ = __builtins__ # type: ignore
|
84
85
|
mod.__spec__ = None
|
85
86
|
|
87
|
+
sys.modules[mn] = mod
|
88
|
+
|
86
89
|
code = compile(src, fp, 'exec')
|
87
90
|
exec(code, mod.__dict__, mod.__dict__)
|
88
91
|
|