ominfra 0.0.0.dev178__tar.gz → 0.0.0.dev179__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. {ominfra-0.0.0.dev178/ominfra.egg-info → ominfra-0.0.0.dev179}/PKG-INFO +3 -3
  2. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/driver.py +7 -16
  3. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/inject.py +53 -19
  4. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/interp.py +2 -2
  5. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/venvs.py +2 -2
  6. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/scripts/manage.py +788 -653
  7. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/scripts/supervisor.py +31 -30
  8. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179/ominfra.egg-info}/PKG-INFO +3 -3
  9. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra.egg-info/requires.txt +2 -2
  10. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/pyproject.toml +3 -3
  11. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/LICENSE +0 -0
  12. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/MANIFEST.in +0 -0
  13. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/README.rst +0 -0
  14. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/.manifests.json +0 -0
  15. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/__about__.py +0 -0
  16. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/__init__.py +0 -0
  17. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/__init__.py +0 -0
  18. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/__init__.py +0 -0
  19. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/__main__.py +0 -0
  20. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/auth.py +0 -0
  21. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/cli.py +0 -0
  22. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/dataclasses.py +0 -0
  23. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/journald2aws/__init__.py +0 -0
  24. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/journald2aws/__main__.py +0 -0
  25. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/journald2aws/cursor.py +0 -0
  26. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/journald2aws/driver.py +0 -0
  27. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/journald2aws/main.py +0 -0
  28. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/journald2aws/poster.py +0 -0
  29. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/logs.py +0 -0
  30. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/aws/metadata.py +0 -0
  31. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/gcp/__init__.py +0 -0
  32. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/clouds/gcp/auth.py +0 -0
  33. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/cmds.py +0 -0
  34. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/configs.py +0 -0
  35. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/journald/__init__.py +0 -0
  36. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/journald/fields.py +0 -0
  37. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/journald/genmessages.py +0 -0
  38. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/journald/messages.py +0 -0
  39. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/journald/tailer.py +0 -0
  40. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/__init__.py +0 -0
  41. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/__main__.py +0 -0
  42. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/bootstrap.py +0 -0
  43. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/bootstrap_.py +0 -0
  44. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/commands/__init__.py +0 -0
  45. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/commands/base.py +0 -0
  46. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/commands/inject.py +0 -0
  47. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/commands/local.py +0 -0
  48. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/commands/marshal.py +0 -0
  49. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/commands/ping.py +0 -0
  50. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/commands/subprocess.py +0 -0
  51. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/commands/types.py +0 -0
  52. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/config.py +0 -0
  53. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/__init__.py +0 -0
  54. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/apps.py +0 -0
  55. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/commands.py +0 -0
  56. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/conf.py +0 -0
  57. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/config.py +0 -0
  58. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/deploy.py +0 -0
  59. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/git.py +0 -0
  60. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/paths/__init__.py +0 -0
  61. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/paths/inject.py +0 -0
  62. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/paths/manager.py +0 -0
  63. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/paths/owners.py +0 -0
  64. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/paths/paths.py +0 -0
  65. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/paths/types.py +0 -0
  66. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/specs.py +0 -0
  67. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/tags.py +0 -0
  68. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/tmp.py +0 -0
  69. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/deploy/types.py +0 -0
  70. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/inject.py +0 -0
  71. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/main.py +0 -0
  72. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/marshal.py +0 -0
  73. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/remote/__init__.py +0 -0
  74. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/remote/_main.py +0 -0
  75. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/remote/channel.py +0 -0
  76. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/remote/config.py +0 -0
  77. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/remote/connection.py +0 -0
  78. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/remote/execution.py +0 -0
  79. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/remote/inject.py +0 -0
  80. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/remote/payload.py +0 -0
  81. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/remote/spawning.py +0 -0
  82. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/system/__init__.py +0 -0
  83. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/system/commands.py +0 -0
  84. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/system/config.py +0 -0
  85. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/system/inject.py +0 -0
  86. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/system/packages.py +0 -0
  87. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/system/platforms.py +0 -0
  88. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/targets/__init__.py +0 -0
  89. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/targets/bestpython.py +0 -0
  90. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/targets/bestpython.sh +0 -0
  91. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/targets/connection.py +0 -0
  92. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/targets/inject.py +0 -0
  93. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/manage/targets/targets.py +0 -0
  94. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/pyremote.py +0 -0
  95. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/scripts/__init__.py +0 -0
  96. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/scripts/journald2aws.py +0 -0
  97. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/ssh.py +0 -0
  98. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/LICENSE.txt +0 -0
  99. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/__init__.py +0 -0
  100. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/__main__.py +0 -0
  101. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/configs.py +0 -0
  102. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/dispatchers.py +0 -0
  103. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/dispatchersimpl.py +0 -0
  104. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/events.py +0 -0
  105. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/exceptions.py +0 -0
  106. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/groups.py +0 -0
  107. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/groupsimpl.py +0 -0
  108. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/http.py +0 -0
  109. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/inject.py +0 -0
  110. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/io.py +0 -0
  111. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/main.py +0 -0
  112. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/pipes.py +0 -0
  113. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/privileges.py +0 -0
  114. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/process.py +0 -0
  115. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/processimpl.py +0 -0
  116. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/setup.py +0 -0
  117. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/setupimpl.py +0 -0
  118. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/signals.py +0 -0
  119. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/spawning.py +0 -0
  120. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/spawningimpl.py +0 -0
  121. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/states.py +0 -0
  122. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/supervisor.py +0 -0
  123. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/types.py +0 -0
  124. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/utils/__init__.py +0 -0
  125. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/utils/collections.py +0 -0
  126. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/utils/diag.py +0 -0
  127. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/utils/fds.py +0 -0
  128. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/utils/fs.py +0 -0
  129. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/utils/os.py +0 -0
  130. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/utils/ostypes.py +0 -0
  131. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/utils/signals.py +0 -0
  132. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/utils/strings.py +0 -0
  133. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/supervisor/utils/users.py +0 -0
  134. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/tailscale/__init__.py +0 -0
  135. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/tailscale/api.py +0 -0
  136. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/tailscale/cli.py +0 -0
  137. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/threadworkers.py +0 -0
  138. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/tools/__init__.py +0 -0
  139. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra/tools/listresources.py +0 -0
  140. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra.egg-info/SOURCES.txt +0 -0
  141. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra.egg-info/dependency_links.txt +0 -0
  142. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra.egg-info/entry_points.txt +0 -0
  143. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/ominfra.egg-info/top_level.txt +0 -0
  144. {ominfra-0.0.0.dev178 → ominfra-0.0.0.dev179}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ominfra
3
- Version: 0.0.0.dev178
3
+ Version: 0.0.0.dev179
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.dev178
16
- Requires-Dist: omlish==0.0.0.dev178
15
+ Requires-Dist: omdev==0.0.0.dev179
16
+ Requires-Dist: omlish==0.0.0.dev179
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._deploys.make_deploy_time(),
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
- home,
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.resolvers import DEFAULT_INTERP_RESOLVER
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 DEFAULT_INTERP_RESOLVER.resolve(i, install=cmd.install))
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.resolvers import DEFAULT_INTERP_RESOLVER
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 DEFAULT_INTERP_RESOLVER.resolve(i))
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'