ominfra 0.0.0.dev178__tar.gz → 0.0.0.dev180__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {ominfra-0.0.0.dev178/ominfra.egg-info → ominfra-0.0.0.dev180}/PKG-INFO +3 -3
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/cli.py +1 -1
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/driver.py +7 -16
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/inject.py +53 -19
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/interp.py +2 -2
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/venvs.py +2 -2
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/main.py +2 -2
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/remote/spawning.py +1 -1
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/scripts/manage.py +1001 -866
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/scripts/supervisor.py +111 -104
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/http.py +1 -1
- ominfra-0.0.0.dev180/ominfra/systemd.py +18 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/tailscale/cli.py +4 -4
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180/ominfra.egg-info}/PKG-INFO +3 -3
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra.egg-info/SOURCES.txt +1 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra.egg-info/requires.txt +2 -2
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/pyproject.toml +3 -3
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/LICENSE +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/MANIFEST.in +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/README.rst +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/.manifests.json +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/__about__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/__main__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/auth.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/dataclasses.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/journald2aws/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/journald2aws/__main__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/journald2aws/cursor.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/journald2aws/driver.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/journald2aws/main.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/journald2aws/poster.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/logs.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/aws/metadata.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/gcp/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/clouds/gcp/auth.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/cmds.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/configs.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/journald/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/journald/fields.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/journald/genmessages.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/journald/messages.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/journald/tailer.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/__main__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/bootstrap.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/bootstrap_.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/commands/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/commands/base.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/commands/inject.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/commands/local.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/commands/marshal.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/commands/ping.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/commands/subprocess.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/commands/types.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/config.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/apps.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/commands.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/conf.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/config.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/deploy.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/git.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/paths/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/paths/inject.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/paths/manager.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/paths/owners.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/paths/paths.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/paths/types.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/specs.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/tags.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/tmp.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/deploy/types.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/inject.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/marshal.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/remote/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/remote/_main.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/remote/channel.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/remote/config.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/remote/connection.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/remote/execution.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/remote/inject.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/remote/payload.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/system/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/system/commands.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/system/config.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/system/inject.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/system/packages.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/system/platforms.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/targets/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/targets/bestpython.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/targets/bestpython.sh +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/targets/connection.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/targets/inject.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/manage/targets/targets.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/pyremote.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/scripts/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/scripts/journald2aws.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/ssh.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/LICENSE.txt +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/__main__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/configs.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/dispatchers.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/dispatchersimpl.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/events.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/exceptions.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/groups.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/groupsimpl.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/inject.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/io.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/main.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/pipes.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/privileges.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/process.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/processimpl.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/setup.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/setupimpl.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/signals.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/spawning.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/spawningimpl.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/states.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/supervisor.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/types.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/utils/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/utils/collections.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/utils/diag.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/utils/fds.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/utils/fs.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/utils/os.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/utils/ostypes.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/utils/signals.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/utils/strings.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/supervisor/utils/users.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/tailscale/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/tailscale/api.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/threadworkers.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/tools/__init__.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra/tools/listresources.py +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra.egg-info/dependency_links.txt +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra.egg-info/entry_points.txt +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/ominfra.egg-info/top_level.txt +0 -0
- {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev180}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ominfra
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev180
|
4
4
|
Summary: ominfra
|
5
5
|
Author: wrmsr
|
6
6
|
License: BSD-3-Clause
|
@@ -12,8 +12,8 @@ Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: Operating System :: POSIX
|
13
13
|
Requires-Python: >=3.12
|
14
14
|
License-File: LICENSE
|
15
|
-
Requires-Dist: omdev==0.0.0.
|
16
|
-
Requires-Dist: omlish==0.0.0.
|
15
|
+
Requires-Dist: omdev==0.0.0.dev180
|
16
|
+
Requires-Dist: omlish==0.0.0.dev180
|
17
17
|
Provides-Extra: all
|
18
18
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
19
19
|
Requires-Dist: asyncssh~=2.18; extra == "all"
|
@@ -1,16 +1,14 @@
|
|
1
1
|
# ruff: noqa: UP006 UP007
|
2
|
-
import os.path
|
3
2
|
import typing as ta
|
4
3
|
|
5
|
-
from omlish.lite.check import check
|
6
4
|
from omlish.lite.typing import Func1
|
7
5
|
|
8
6
|
from .apps import DeployAppManager
|
9
|
-
from .deploy import DeployManager
|
10
7
|
from .paths.manager import DeployPathsManager
|
11
8
|
from .specs import DeploySpec
|
12
9
|
from .tags import DeployAppRev
|
13
10
|
from .tags import DeployTagMap
|
11
|
+
from .tags import DeployTime
|
14
12
|
from .types import DeployHome
|
15
13
|
|
16
14
|
|
@@ -23,16 +21,18 @@ class DeployDriver:
|
|
23
21
|
self,
|
24
22
|
*,
|
25
23
|
spec: DeploySpec,
|
24
|
+
home: DeployHome,
|
25
|
+
time: DeployTime,
|
26
26
|
|
27
|
-
deploys: DeployManager,
|
28
27
|
paths: DeployPathsManager,
|
29
28
|
apps: DeployAppManager,
|
30
29
|
) -> None:
|
31
30
|
super().__init__()
|
32
31
|
|
33
32
|
self._spec = spec
|
33
|
+
self._home = home
|
34
|
+
self._time = time
|
34
35
|
|
35
|
-
self._deploys = deploys
|
36
36
|
self._paths = paths
|
37
37
|
self._apps = apps
|
38
38
|
|
@@ -41,17 +41,8 @@ class DeployDriver:
|
|
41
41
|
|
42
42
|
#
|
43
43
|
|
44
|
-
hs = check.non_empty_str(self._spec.home)
|
45
|
-
hs = os.path.expanduser(hs)
|
46
|
-
hs = os.path.realpath(hs)
|
47
|
-
hs = os.path.abspath(hs)
|
48
|
-
|
49
|
-
home = DeployHome(hs)
|
50
|
-
|
51
|
-
#
|
52
|
-
|
53
44
|
deploy_tags = DeployTagMap(
|
54
|
-
self.
|
45
|
+
self._time,
|
55
46
|
self._spec.key(),
|
56
47
|
)
|
57
48
|
|
@@ -66,6 +57,6 @@ class DeployDriver:
|
|
66
57
|
|
67
58
|
await self._apps.prepare_app(
|
68
59
|
app,
|
69
|
-
|
60
|
+
self._home,
|
70
61
|
app_tags,
|
71
62
|
)
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# ruff: noqa: UP006 UP007
|
2
2
|
import contextlib
|
3
|
+
import os.path
|
3
4
|
import typing as ta
|
4
5
|
|
6
|
+
from omlish.lite.check import check
|
5
7
|
from omlish.lite.inject import ContextvarInjectorScope
|
6
8
|
from omlish.lite.inject import Injector
|
7
9
|
from omlish.lite.inject import InjectorBindingOrBindings
|
@@ -23,15 +25,64 @@ from .interp import InterpCommandExecutor
|
|
23
25
|
from .paths.inject import bind_deploy_paths
|
24
26
|
from .paths.owners import DeployPathOwner
|
25
27
|
from .specs import DeploySpec
|
28
|
+
from .tags import DeployTime
|
26
29
|
from .tmp import DeployHomeAtomics
|
27
30
|
from .tmp import DeployTmpManager
|
31
|
+
from .types import DeployHome
|
28
32
|
from .venvs import DeployVenvManager
|
29
33
|
|
30
34
|
|
35
|
+
##
|
36
|
+
|
37
|
+
|
31
38
|
class DeployInjectorScope(ContextvarInjectorScope):
|
32
39
|
pass
|
33
40
|
|
34
41
|
|
42
|
+
def bind_deploy_scope() -> InjectorBindings:
|
43
|
+
lst: ta.List[InjectorBindingOrBindings] = [
|
44
|
+
inj.bind_scope(DeployInjectorScope),
|
45
|
+
inj.bind_scope_seed(DeploySpec, DeployInjectorScope),
|
46
|
+
|
47
|
+
inj.bind(DeployDriver, in_=DeployInjectorScope),
|
48
|
+
]
|
49
|
+
|
50
|
+
#
|
51
|
+
|
52
|
+
def provide_deploy_driver_factory(injector: Injector, sc: DeployInjectorScope) -> DeployDriverFactory:
|
53
|
+
@contextlib.contextmanager
|
54
|
+
def factory(spec: DeploySpec) -> ta.Iterator[DeployDriver]:
|
55
|
+
with sc.enter({
|
56
|
+
inj.as_key(DeploySpec): spec,
|
57
|
+
}):
|
58
|
+
yield injector[DeployDriver]
|
59
|
+
return DeployDriverFactory(factory)
|
60
|
+
lst.append(inj.bind(provide_deploy_driver_factory, singleton=True))
|
61
|
+
|
62
|
+
#
|
63
|
+
|
64
|
+
def provide_deploy_home(deploy: DeploySpec) -> DeployHome:
|
65
|
+
hs = check.non_empty_str(deploy.home)
|
66
|
+
hs = os.path.expanduser(hs)
|
67
|
+
hs = os.path.realpath(hs)
|
68
|
+
hs = os.path.abspath(hs)
|
69
|
+
return DeployHome(hs)
|
70
|
+
lst.append(inj.bind(provide_deploy_home, in_=DeployInjectorScope))
|
71
|
+
|
72
|
+
#
|
73
|
+
|
74
|
+
def provide_deploy_time(deploys: DeployManager) -> DeployTime:
|
75
|
+
return deploys.make_deploy_time()
|
76
|
+
lst.append(inj.bind(provide_deploy_time, in_=DeployInjectorScope))
|
77
|
+
|
78
|
+
#
|
79
|
+
|
80
|
+
return inj.as_bindings(*lst)
|
81
|
+
|
82
|
+
|
83
|
+
##
|
84
|
+
|
85
|
+
|
35
86
|
def bind_deploy(
|
36
87
|
*,
|
37
88
|
deploy_config: DeployConfig,
|
@@ -40,6 +91,8 @@ def bind_deploy(
|
|
40
91
|
inj.bind(deploy_config),
|
41
92
|
|
42
93
|
bind_deploy_paths(),
|
94
|
+
|
95
|
+
bind_deploy_scope(),
|
43
96
|
]
|
44
97
|
|
45
98
|
#
|
@@ -75,25 +128,6 @@ def bind_deploy(
|
|
75
128
|
|
76
129
|
#
|
77
130
|
|
78
|
-
def provide_deploy_driver_factory(injector: Injector, sc: DeployInjectorScope) -> DeployDriverFactory:
|
79
|
-
@contextlib.contextmanager
|
80
|
-
def factory(spec: DeploySpec) -> ta.Iterator[DeployDriver]:
|
81
|
-
with sc.enter({
|
82
|
-
inj.as_key(DeploySpec): spec,
|
83
|
-
}):
|
84
|
-
yield injector[DeployDriver]
|
85
|
-
return DeployDriverFactory(factory)
|
86
|
-
lst.append(inj.bind(provide_deploy_driver_factory, singleton=True))
|
87
|
-
|
88
|
-
lst.extend([
|
89
|
-
inj.bind_scope(DeployInjectorScope),
|
90
|
-
inj.bind_scope_seed(DeploySpec, DeployInjectorScope),
|
91
|
-
|
92
|
-
inj.bind(DeployDriver, in_=DeployInjectorScope),
|
93
|
-
])
|
94
|
-
|
95
|
-
#
|
96
|
-
|
97
131
|
lst.extend([
|
98
132
|
bind_command(DeployCommand, DeployCommandExecutor),
|
99
133
|
bind_command(InterpCommand, InterpCommandExecutor),
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# ruff: noqa: UP006 UP007
|
2
2
|
import dataclasses as dc
|
3
3
|
|
4
|
-
from omdev.interp.
|
4
|
+
from omdev.interp.default import get_default_interp_resolver
|
5
5
|
from omdev.interp.types import InterpOpts
|
6
6
|
from omdev.interp.types import InterpSpecifier
|
7
7
|
from omlish.lite.check import check
|
@@ -28,7 +28,7 @@ class InterpCommand(Command['InterpCommand.Output']):
|
|
28
28
|
class InterpCommandExecutor(CommandExecutor[InterpCommand, InterpCommand.Output]):
|
29
29
|
async def execute(self, cmd: InterpCommand) -> InterpCommand.Output:
|
30
30
|
i = InterpSpecifier.parse(check.not_none(cmd.spec))
|
31
|
-
o = check.not_none(await
|
31
|
+
o = check.not_none(await get_default_interp_resolver().resolve(i, install=cmd.install))
|
32
32
|
return InterpCommand.Output(
|
33
33
|
exe=o.exe,
|
34
34
|
version=str(o.version.version),
|
@@ -6,7 +6,7 @@ TODO:
|
|
6
6
|
"""
|
7
7
|
import os.path
|
8
8
|
|
9
|
-
from omdev.interp.
|
9
|
+
from omdev.interp.default import get_default_interp_resolver
|
10
10
|
from omdev.interp.types import InterpSpecifier
|
11
11
|
from omlish.asyncs.asyncio.subprocesses import asyncio_subprocesses
|
12
12
|
from omlish.lite.check import check
|
@@ -25,7 +25,7 @@ class DeployVenvManager:
|
|
25
25
|
) -> None:
|
26
26
|
if spec.interp is not None:
|
27
27
|
i = InterpSpecifier.parse(check.not_none(spec.interp))
|
28
|
-
o = check.not_none(await
|
28
|
+
o = check.not_none(await get_default_interp_resolver().resolve(i))
|
29
29
|
sys_exe = o.exe
|
30
30
|
else:
|
31
31
|
sys_exe = 'python3'
|
@@ -14,7 +14,7 @@ import typing as ta
|
|
14
14
|
|
15
15
|
from omlish.argparse.cli import ArgparseCli
|
16
16
|
from omlish.argparse.cli import argparse_arg
|
17
|
-
from omlish.argparse.cli import
|
17
|
+
from omlish.argparse.cli import argparse_cmd
|
18
18
|
from omlish.lite.cached import cached_nullary
|
19
19
|
from omlish.lite.check import check
|
20
20
|
from omlish.lite.logs import log # noqa
|
@@ -55,7 +55,7 @@ class MainCli(ArgparseCli):
|
|
55
55
|
|
56
56
|
#
|
57
57
|
|
58
|
-
@
|
58
|
+
@argparse_cmd(
|
59
59
|
argparse_arg('--_payload-file'),
|
60
60
|
|
61
61
|
argparse_arg('--pycharm-debug-port', type=int),
|
@@ -9,7 +9,7 @@ import typing as ta
|
|
9
9
|
|
10
10
|
from omlish.asyncs.asyncio.subprocesses import asyncio_subprocesses
|
11
11
|
from omlish.lite.check import check
|
12
|
-
from omlish.
|
12
|
+
from omlish.shlex import shlex_maybe_quote
|
13
13
|
from omlish.subprocesses import SUBPROCESS_CHANNEL_OPTION_VALUES
|
14
14
|
from omlish.subprocesses import SubprocessChannelOption
|
15
15
|
|