ominfra 0.0.0.dev162__py3-none-any.whl → 0.0.0.dev163__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,7 +51,7 @@ class DeployAppManager(DeployPathOwner):
51
51
 
52
52
  def get_owned_deploy_paths(self) -> ta.AbstractSet[DeployPath]:
53
53
  return {
54
- DeployPath.parse('apps/@app/@tag'),
54
+ DeployPath.parse('apps/@app/@tag/'),
55
55
  }
56
56
 
57
57
  async def prepare_app(
@@ -70,4 +70,5 @@ class DeployAppManager(DeployPathOwner):
70
70
 
71
71
  #
72
72
 
73
- await self._venvs.setup_app_venv(app_tag)
73
+ if spec.venv is not None:
74
+ await self._venvs.setup_app_venv(app_tag, spec.venv)
@@ -43,11 +43,29 @@ class DeployGitCheckout:
43
43
  ##
44
44
 
45
45
 
46
+ @dc.dataclass(frozen=True)
47
+ class DeployVenvSpec:
48
+ interp: ta.Optional[str] = None
49
+
50
+ requirements_files: ta.Optional[ta.Sequence[str]] = None
51
+ extra_dependencies: ta.Optional[ta.Sequence[str]] = None
52
+
53
+ use_uv: bool = False
54
+
55
+ def __post_init__(self) -> None:
56
+ hash(self)
57
+
58
+
59
+ ##
60
+
61
+
46
62
  @dc.dataclass(frozen=True)
47
63
  class DeploySpec:
48
64
  app: DeployApp
49
65
  checkout: DeployGitCheckout
50
66
 
67
+ venv: ta.Optional[DeployVenvSpec] = None
68
+
51
69
  def __post_init__(self) -> None:
52
70
  hash(self)
53
71
 
@@ -14,6 +14,7 @@ from omlish.os.atomics import AtomicPathSwapping
14
14
 
15
15
  from .paths import DeployPath
16
16
  from .paths import DeployPathOwner
17
+ from .specs import DeployVenvSpec
17
18
  from .types import DeployAppTag
18
19
  from .types import DeployHome
19
20
 
@@ -43,8 +44,7 @@ class DeployVenvManager(DeployPathOwner):
43
44
  self,
44
45
  app_dir: str,
45
46
  venv_dir: str,
46
- *,
47
- use_uv: bool = True,
47
+ spec: DeployVenvSpec,
48
48
  ) -> None:
49
49
  sys_exe = 'python3'
50
50
 
@@ -61,7 +61,7 @@ class DeployVenvManager(DeployPathOwner):
61
61
  reqs_txt = os.path.join(app_dir, 'requirements.txt')
62
62
 
63
63
  if os.path.isfile(reqs_txt):
64
- if use_uv:
64
+ if spec.use_uv:
65
65
  await asyncio_subprocesses.check_call(venv_exe, '-m', 'pip', 'install', 'uv')
66
66
  pip_cmd = ['-m', 'uv', 'pip']
67
67
  else:
@@ -69,8 +69,13 @@ class DeployVenvManager(DeployPathOwner):
69
69
 
70
70
  await asyncio_subprocesses.check_call(venv_exe, *pip_cmd,'install', '-r', reqs_txt)
71
71
 
72
- async def setup_app_venv(self, app_tag: DeployAppTag) -> None:
72
+ async def setup_app_venv(
73
+ self,
74
+ app_tag: DeployAppTag,
75
+ spec: DeployVenvSpec,
76
+ ) -> None:
73
77
  await self.setup_venv(
74
78
  os.path.join(check.non_empty_str(self._deploy_home), 'apps', app_tag.app, app_tag.tag),
75
79
  os.path.join(self._dir(), app_tag.app, app_tag.tag),
80
+ spec,
76
81
  )
ominfra/scripts/manage.py CHANGED
@@ -4329,11 +4329,29 @@ class DeployGitCheckout:
4329
4329
  ##
4330
4330
 
4331
4331
 
4332
+ @dc.dataclass(frozen=True)
4333
+ class DeployVenvSpec:
4334
+ interp: ta.Optional[str] = None
4335
+
4336
+ requirements_files: ta.Optional[ta.Sequence[str]] = None
4337
+ extra_dependencies: ta.Optional[ta.Sequence[str]] = None
4338
+
4339
+ use_uv: bool = False
4340
+
4341
+ def __post_init__(self) -> None:
4342
+ hash(self)
4343
+
4344
+
4345
+ ##
4346
+
4347
+
4332
4348
  @dc.dataclass(frozen=True)
4333
4349
  class DeploySpec:
4334
4350
  app: DeployApp
4335
4351
  checkout: DeployGitCheckout
4336
4352
 
4353
+ venv: ta.Optional[DeployVenvSpec] = None
4354
+
4337
4355
  def __post_init__(self) -> None:
4338
4356
  hash(self)
4339
4357
 
@@ -8284,8 +8302,7 @@ class DeployVenvManager(DeployPathOwner):
8284
8302
  self,
8285
8303
  app_dir: str,
8286
8304
  venv_dir: str,
8287
- *,
8288
- use_uv: bool = True,
8305
+ spec: DeployVenvSpec,
8289
8306
  ) -> None:
8290
8307
  sys_exe = 'python3'
8291
8308
 
@@ -8302,7 +8319,7 @@ class DeployVenvManager(DeployPathOwner):
8302
8319
  reqs_txt = os.path.join(app_dir, 'requirements.txt')
8303
8320
 
8304
8321
  if os.path.isfile(reqs_txt):
8305
- if use_uv:
8322
+ if spec.use_uv:
8306
8323
  await asyncio_subprocesses.check_call(venv_exe, '-m', 'pip', 'install', 'uv')
8307
8324
  pip_cmd = ['-m', 'uv', 'pip']
8308
8325
  else:
@@ -8310,10 +8327,15 @@ class DeployVenvManager(DeployPathOwner):
8310
8327
 
8311
8328
  await asyncio_subprocesses.check_call(venv_exe, *pip_cmd,'install', '-r', reqs_txt)
8312
8329
 
8313
- async def setup_app_venv(self, app_tag: DeployAppTag) -> None:
8330
+ async def setup_app_venv(
8331
+ self,
8332
+ app_tag: DeployAppTag,
8333
+ spec: DeployVenvSpec,
8334
+ ) -> None:
8314
8335
  await self.setup_venv(
8315
8336
  os.path.join(check.non_empty_str(self._deploy_home), 'apps', app_tag.app, app_tag.tag),
8316
8337
  os.path.join(self._dir(), app_tag.app, app_tag.tag),
8338
+ spec,
8317
8339
  )
8318
8340
 
8319
8341
 
@@ -8879,7 +8901,7 @@ class DeployAppManager(DeployPathOwner):
8879
8901
 
8880
8902
  def get_owned_deploy_paths(self) -> ta.AbstractSet[DeployPath]:
8881
8903
  return {
8882
- DeployPath.parse('apps/@app/@tag'),
8904
+ DeployPath.parse('apps/@app/@tag/'),
8883
8905
  }
8884
8906
 
8885
8907
  async def prepare_app(
@@ -8898,7 +8920,8 @@ class DeployAppManager(DeployPathOwner):
8898
8920
 
8899
8921
  #
8900
8922
 
8901
- await self._venvs.setup_app_venv(app_tag)
8923
+ if spec.venv is not None:
8924
+ await self._venvs.setup_app_venv(app_tag, spec.venv)
8902
8925
 
8903
8926
 
8904
8927
  ########################################
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ominfra
3
- Version: 0.0.0.dev162
3
+ Version: 0.0.0.dev163
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.dev162
16
- Requires-Dist: omlish==0.0.0.dev162
15
+ Requires-Dist: omdev==0.0.0.dev163
16
+ Requires-Dist: omlish==0.0.0.dev163
17
17
  Provides-Extra: all
18
18
  Requires-Dist: paramiko~=3.5; extra == "all"
19
19
  Requires-Dist: asyncssh~=2.18; extra == "all"
@@ -44,17 +44,17 @@ ominfra/manage/commands/ping.py,sha256=DVZFzL1Z_f-Bq53vxMrL3xOi0iK_nMonJE4KvQf9w
44
44
  ominfra/manage/commands/subprocess.py,sha256=yHGMbAI-xKe_9BUs5IZ3Yav8qRE-I9aGnBtTwW15Pnw,2440
45
45
  ominfra/manage/commands/types.py,sha256=XFZPeqeIBAaIIQF3pdPbGxLlb-LCrz6WtlDWO2q_vz0,210
46
46
  ominfra/manage/deploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
- ominfra/manage/deploy/apps.py,sha256=lXcbyX8_wrvvwKtIMM9P_Mh7xL8yj6z9_PFTl_0u-0U,1887
47
+ ominfra/manage/deploy/apps.py,sha256=Nv3eXVPxEbSz4wyTI8chJ-C-EEC721vFssvvg0YDRXo,1937
48
48
  ominfra/manage/deploy/commands.py,sha256=N9qVntnRgJ_IneI7rEQB2Za0oU7gouPfm-sl2MCwW1E,764
49
49
  ominfra/manage/deploy/config.py,sha256=aR6ubMEWqkTI55XtcG1Cczn6YhCVN6eSL8DT5EHQJN0,166
50
50
  ominfra/manage/deploy/git.py,sha256=6CGLvGH8uYkuT8gyZHybJb7sgUPTtFgy7grj1YHkI9g,3747
51
51
  ominfra/manage/deploy/inject.py,sha256=8wuIgdzkDCHbc69nD1meLjwfCOMdWOIfDT5yijL-du8,1441
52
52
  ominfra/manage/deploy/interp.py,sha256=OKkenH8YKEW_mEDR6X7_ZLxK9a1Ox6KHSwFPTHT6OzA,1029
53
53
  ominfra/manage/deploy/paths.py,sha256=tK8zZFWOHDRdTN5AlTe-3MpgZqovhWrljGosQmeEYvo,6839
54
- ominfra/manage/deploy/specs.py,sha256=Yq3WiLNJcodUBEsJfP18gPGB3X2ABI1g8YLlsUvJOXg,1230
54
+ ominfra/manage/deploy/specs.py,sha256=qQSMA2ns0dalbizYwOp14i154mCOkjyvvh4_cN0gT3k,1574
55
55
  ominfra/manage/deploy/tmp.py,sha256=L0pIfQuxQ7_6gC_AAv7eubI37_IPzCVR29hkn1MHL2Q,1230
56
56
  ominfra/manage/deploy/types.py,sha256=o95wqvTGNRq8Cxx7VpqeX-9x1tI8k8BpqPFvJZkJYBA,305
57
- ominfra/manage/deploy/venvs.py,sha256=ZG9tXhzg0R173T1IFIc5DE45xEuJK97DjlN1cQPAvXI,2229
57
+ ominfra/manage/deploy/venvs.py,sha256=u8ds1TVyipFVSfm7sgEHGPw4JPG_hXY2j1LnTCLjxqw,2337
58
58
  ominfra/manage/remote/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
59
  ominfra/manage/remote/_main.py,sha256=p5KoiS2WMw6QAqlDl_Zun-JybmCsy8awIfpBMLBjGMY,4356
60
60
  ominfra/manage/remote/channel.py,sha256=36xR9Ti9ZA8TUBtxmY0u7_3Lv7E6wzQTxlZl7gLR5GE,2224
@@ -76,7 +76,7 @@ ominfra/manage/targets/inject.py,sha256=P4597xWM-V3I_gCt2O71OLhYQkkXtuJvkYRsIbhh
76
76
  ominfra/manage/targets/targets.py,sha256=CFl8Uirgn3gfowO1Fn-LBK-6qYqEMFJ9snPUl0gCRuM,1753
77
77
  ominfra/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
78
  ominfra/scripts/journald2aws.py,sha256=EC8tSKW3hztBV_Kr_ykK72AmcvnWivUxcz6Sfg3M_hI,155085
79
- ominfra/scripts/manage.py,sha256=mslFxApTHF_954w462BIpZdk9V1oy02fJhcN1N1-Wf4,293592
79
+ ominfra/scripts/manage.py,sha256=M8k4XmOrq2R3rjUNU3SAHeqdjvWZptpXvFAl4A0RmGM,294060
80
80
  ominfra/scripts/supervisor.py,sha256=uPcw4o8gt8xvQ97jXK-WBAaZj3D81Lq9tqDoKxGvLCU,273791
81
81
  ominfra/supervisor/LICENSE.txt,sha256=yvqaMNsDhWxziHa9ien6qCW1SkZv-DQlAg96XjfSee8,1746
82
82
  ominfra/supervisor/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
@@ -119,9 +119,9 @@ ominfra/tailscale/api.py,sha256=C5-t_b6jZXUWcy5k8bXm7CFnk73pSdrlMOgGDeGVrpw,1370
119
119
  ominfra/tailscale/cli.py,sha256=h6akQJMl0KuWLHS7Ur6WcBZ2JwF0DJQhsPTnFBdGyNk,3571
120
120
  ominfra/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
121
121
  ominfra/tools/listresources.py,sha256=4qVg5txsb10EHhvqXXeM6gJ2jx9LbroEnPydDv1uXs0,6176
122
- ominfra-0.0.0.dev162.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
123
- ominfra-0.0.0.dev162.dist-info/METADATA,sha256=tmh0OqIMABojtwp_fUbGyKMod6s85abgUC2tuyhS30Q,731
124
- ominfra-0.0.0.dev162.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
125
- ominfra-0.0.0.dev162.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
126
- ominfra-0.0.0.dev162.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
127
- ominfra-0.0.0.dev162.dist-info/RECORD,,
122
+ ominfra-0.0.0.dev163.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
123
+ ominfra-0.0.0.dev163.dist-info/METADATA,sha256=q9fLsfIpIUNBG4_udrnURTTYe68b6VtNtktfvCBVlIs,731
124
+ ominfra-0.0.0.dev163.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
125
+ ominfra-0.0.0.dev163.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
126
+ ominfra-0.0.0.dev163.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
127
+ ominfra-0.0.0.dev163.dist-info/RECORD,,