zrb 0.11.2__py3-none-any.whl → 0.12.0__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.
@@ -59,16 +59,16 @@ def get_app_monolith_env_map(
59
59
  template_env_map: Mapping[str, str], modules: List[str]
60
60
  ) -> Mapping[str, str]:
61
61
  env_map = copy.deepcopy(template_env_map)
62
- env_map[
63
- "APP_RMQ_CONNECTION"
64
- ] = f"amqp://{RABBITMQ_AUTH_USERNAME}:{RABBITMQ_AUTH_PASSWORD}@rabbitmq" # noqa
62
+ env_map["APP_RMQ_CONNECTION"] = (
63
+ f"amqp://{RABBITMQ_AUTH_USERNAME}:{RABBITMQ_AUTH_PASSWORD}@rabbitmq" # noqa
64
+ )
65
65
  env_map["APP_KAFKA_BOOTSTRAP_SERVERS"] = "redpanda:9092"
66
66
  env_map["APP_KAFKA_SASL_MECHANISM"] = REDPANDA_AUTH_MECHANISM
67
67
  env_map["APP_KAFKA_SASL_USER"] = REDPANDA_AUTH_USER_NAME
68
68
  env_map["APP_KAFKA_SASL_PASSWORD"] = REDPANDA_AUTH_USER_PASSWORD
69
- env_map[
70
- "APP_DB_CONNECTION"
71
- ] = f"postgresql+psycopg2://{POSTGRESQL_AUTH_USERNAME}:{POSTGRESQL_AUTH_PASSWORD}@postgresql:5432/{POSTGRESQL_DB}" # noqa
69
+ env_map["APP_DB_CONNECTION"] = (
70
+ f"postgresql+psycopg2://{POSTGRESQL_AUTH_USERNAME}:{POSTGRESQL_AUTH_PASSWORD}@postgresql:5432/{POSTGRESQL_DB}" # noqa
71
+ )
72
72
  for module_name in modules:
73
73
  env_name = get_module_flag_env_name(module_name)
74
74
  env_map[env_name] = "true"
@@ -77,9 +77,9 @@ def get_app_monolith_env_map(
77
77
  env_map["APP_ENABLE_FRONTEND"] = "true"
78
78
  env_map["APP_ENABLE_API"] = "true"
79
79
  env_map["APP_ENABLE_OTEL"] = "true" if ENABLE_MONITORING else "false"
80
- env_map[
81
- "APP_OTEL_EXPORTER_OTLP_ENDPOINT"
82
- ] = "http://signoz-otel-collector:4317" # noqa
80
+ env_map["APP_OTEL_EXPORTER_OTLP_ENDPOINT"] = (
81
+ "http://signoz-otel-collector:4317" # noqa
82
+ )
83
83
  return env_map
84
84
 
85
85
 
@@ -36,6 +36,9 @@ jobs:
36
36
  set -e
37
37
  export ZRB_ENV=${{ inputs.environment }}
38
38
  export ZRB_SHOW_PROMPT=false
39
+ echo "🏁 Install project dependencies"
40
+ poetry config virtualenvs.create false --local
41
+ poetry install
39
42
  echo "🏁 Start running"
40
43
  ${{ inputs.command }}
41
44
  - run: echo "🍏 This job's status is ${{ job.status }}."
@@ -95,6 +95,9 @@ class SingleBaseRemoteCmdTask(CmdTask):
95
95
  preexec_fn: Optional[Callable[[], Any]] = os.setsid,
96
96
  should_execute: Union[bool, str, Callable[..., bool]] = True,
97
97
  return_upstream_result: bool = False,
98
+ should_print_cmd_result: bool = True,
99
+ should_show_cmd: bool = True,
100
+ should_show_working_directory: bool = True,
98
101
  ):
99
102
  CmdTask.__init__(
100
103
  self,
@@ -128,6 +131,9 @@ class SingleBaseRemoteCmdTask(CmdTask):
128
131
  preexec_fn=preexec_fn,
129
132
  should_execute=should_execute,
130
133
  return_upstream_result=return_upstream_result,
134
+ should_print_cmd_result=should_print_cmd_result,
135
+ should_show_cmd=should_show_cmd,
136
+ should_show_working_directory=should_show_working_directory,
131
137
  )
132
138
  self._pre_cmd = pre_cmd
133
139
  self._pre_cmd_path = pre_cmd_path
@@ -233,6 +239,9 @@ class BaseRemoteCmdTask(BaseTask):
233
239
  preexec_fn: Optional[Callable[[], Any]] = os.setsid,
234
240
  should_execute: Union[bool, str, Callable[..., bool]] = True,
235
241
  return_upstream_result: bool = False,
242
+ should_print_cmd_result: bool = True,
243
+ should_show_cmd: bool = True,
244
+ should_show_working_directory: bool = True,
236
245
  ):
237
246
  sub_tasks = [
238
247
  SingleBaseRemoteCmdTask(
@@ -267,6 +276,9 @@ class BaseRemoteCmdTask(BaseTask):
267
276
  preexec_fn=preexec_fn,
268
277
  should_execute=should_execute,
269
278
  return_upstream_result=return_upstream_result,
279
+ should_print_cmd_result=should_print_cmd_result,
280
+ should_show_cmd=should_show_cmd,
281
+ should_show_working_directory=should_show_working_directory,
270
282
  )
271
283
  for remote_config in list(remote_configs)
272
284
  ]
zrb/task/cmd_task.py CHANGED
@@ -130,6 +130,9 @@ class CmdTask(BaseTask):
130
130
  preexec_fn: Optional[Callable[[], Any]] = os.setsid,
131
131
  should_execute: Union[bool, str, Callable[..., bool]] = True,
132
132
  return_upstream_result: bool = False,
133
+ should_print_cmd_result: bool = True,
134
+ should_show_cmd: bool = True,
135
+ should_show_working_directory: bool = True,
133
136
  ):
134
137
  BaseTask.__init__(
135
138
  self,
@@ -171,6 +174,9 @@ class CmdTask(BaseTask):
171
174
  self._executable = executable
172
175
  self._process: Optional[asyncio.subprocess.Process]
173
176
  self._preexec_fn = preexec_fn
177
+ self._should_print_cmd_result = should_print_cmd_result
178
+ self._should_show_working_directory = should_show_working_directory
179
+ self._should_show_cmd = should_show_cmd
174
180
 
175
181
  def copy(self) -> TCmdTask:
176
182
  return super().copy()
@@ -194,7 +200,7 @@ class CmdTask(BaseTask):
194
200
  return super().to_function(env_prefix, raise_error, is_async, show_done_info)
195
201
 
196
202
  def print_result(self, result: CmdResult):
197
- if result.output == "":
203
+ if not self._should_print_cmd_result or result.output == "":
198
204
  return
199
205
  print(result.output)
200
206
 
@@ -217,8 +223,10 @@ class CmdTask(BaseTask):
217
223
 
218
224
  async def run(self, *args: Any, **kwargs: Any) -> CmdResult:
219
225
  cmd = self.get_cmd_script(*args, **kwargs)
220
- self.print_out_dark("Run script: " + self.__get_multiline_repr(cmd))
221
- self.print_out_dark("Working directory: " + self._cwd)
226
+ if self._should_show_cmd:
227
+ self.print_out_dark("Run script: " + self.__get_multiline_repr(cmd))
228
+ if self._should_show_working_directory:
229
+ self.print_out_dark("Working directory: " + self._cwd)
222
230
  self._output_buffer = []
223
231
  self._error_buffer = []
224
232
  process = await asyncio.create_subprocess_shell(
@@ -48,6 +48,7 @@ def _get_ensure_zrb_network_task(backend: str):
48
48
  os.path.join(SHELL_SCRIPT_DIR, f"ensure-{backend}-is-installed.sh"),
49
49
  ],
50
50
  preexec_fn=None,
51
+ should_print_cmd_result=False,
51
52
  )
52
53
  return CmdTask(
53
54
  name="ensure-zrb-network",
@@ -56,6 +57,7 @@ def _get_ensure_zrb_network_task(backend: str):
56
57
  f"{backend} network create -d bridge zrb",
57
58
  ],
58
59
  upstreams=[ensure_container_backend],
60
+ should_print_cmd_result=False,
59
61
  )
60
62
 
61
63
 
@@ -117,6 +119,9 @@ class DockerComposeTask(CmdTask):
117
119
  preexec_fn: Optional[Callable[[], Any]] = os.setsid,
118
120
  should_execute: Union[bool, str, Callable[..., bool]] = True,
119
121
  return_upstream_result: bool = False,
122
+ should_print_cmd_result: bool = True,
123
+ should_show_cmd: bool = True,
124
+ should_show_working_directory: bool = True,
120
125
  ):
121
126
  combined_env_files = list(env_files)
122
127
  CmdTask.__init__(
@@ -149,6 +154,9 @@ class DockerComposeTask(CmdTask):
149
154
  preexec_fn=preexec_fn,
150
155
  should_execute=should_execute,
151
156
  return_upstream_result=return_upstream_result,
157
+ should_print_cmd_result=should_print_cmd_result,
158
+ should_show_cmd=should_show_cmd,
159
+ should_show_working_directory=should_show_working_directory,
152
160
  )
153
161
  self._setup_cmd = setup_cmd
154
162
  self._setup_cmd_path = setup_cmd_path
zrb/task/wiki_task.py CHANGED
@@ -4,6 +4,7 @@ from zrb.action.runner import Runner
4
4
  from zrb.helper.task import show_lines
5
5
  from zrb.helper.typecheck import typechecked
6
6
  from zrb.helper.typing import Any, Callable, Iterable, List, Mapping, Optional, Union
7
+ from zrb.helper.util import to_human_readable
7
8
  from zrb.task.any_task import AnyTask
8
9
  from zrb.task.any_task_event_handler import (
9
10
  OnFailed,
@@ -49,9 +50,11 @@ def create_wiki_tasks(
49
50
  if not file_name.endswith(".md"):
50
51
  continue
51
52
  task_name = file_name[:-3]
53
+ task_description = f"Article about {to_human_readable(task_name)}"
52
54
  task = Task(
53
55
  name=task_name,
54
56
  group=group,
57
+ description=task_description,
55
58
  inputs=inputs,
56
59
  envs=envs,
57
60
  env_files=env_files,
@@ -73,7 +76,12 @@ def create_wiki_tasks(
73
76
  runner.register(task)
74
77
  tasks.append(task)
75
78
  for dir_name in directory_structure["dirs"]:
76
- sub_group = Group(name=dir_name, parent=group)
79
+ sub_group_description = f"Articles related to {to_human_readable(dir_name)}"
80
+ sub_group = Group(
81
+ name=dir_name,
82
+ parent=group,
83
+ description=sub_group_description,
84
+ )
77
85
  sub_tasks = create_wiki_tasks(
78
86
  directory=os.path.join(abs_directory, dir_name),
79
87
  group=sub_group,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zrb
3
- Version: 0.11.2
3
+ Version: 0.12.0
4
4
  Summary: A Framework to Enhance Your Workflow
5
5
  Home-page: https://github.com/state-alchemists/zrb
6
6
  License: AGPL-3.0-or-later
@@ -277,7 +277,7 @@ zrb/builtin/project/add/fastapp/app/template/src/kebab-zrb-app-name/deployment/.
277
277
  zrb/builtin/project/add/fastapp/app/template/src/kebab-zrb-app-name/deployment/Pulumi.yaml,sha256=OpqAWQyuaMkG_wjk4ccynSShAHeR5D5Bkm0C7lQ3rxc,137
278
278
  zrb/builtin/project/add/fastapp/app/template/src/kebab-zrb-app-name/deployment/README.md,sha256=M_QMch-NGGA02Yiq3YG4pe22wIm8aKcL4CU8iekeqmQ,1139
279
279
  zrb/builtin/project/add/fastapp/app/template/src/kebab-zrb-app-name/deployment/__main__.py,sha256=SMjuTEdgm3gt9-RICbxfR3uk3VkPjTCblSTZKB5kMiA,1519
280
- zrb/builtin/project/add/fastapp/app/template/src/kebab-zrb-app-name/deployment/_common.py,sha256=quWZRYtJCBJSZlf0P4K80RJGXkmgs-nQ8F80KW9Y7DQ,4943
280
+ zrb/builtin/project/add/fastapp/app/template/src/kebab-zrb-app-name/deployment/_common.py,sha256=erhThPwhlO__4hLvzdlHFXoCVRiFmQaZVPs3GXeKT3I,4949
281
281
  zrb/builtin/project/add/fastapp/app/template/src/kebab-zrb-app-name/deployment/app_helper.py,sha256=qrlUIcDYk_vVlP-VFY5qe0MHIDTJzepfy6Dy_qRjpb0,6043
282
282
  zrb/builtin/project/add/fastapp/app/template/src/kebab-zrb-app-name/deployment/helm-charts/postgresql/.helmignore,sha256=kOvs30nBuFH2VWxM4r3302DAc0sv0upb1unt5YNKrow,351
283
283
  zrb/builtin/project/add/fastapp/app/template/src/kebab-zrb-app-name/deployment/helm-charts/postgresql/Chart.lock,sha256=9znie2HO_DnJE3F5Fxf_GLSIVZHGxCRUpjSPuN57LBs,231
@@ -1268,7 +1268,7 @@ zrb/builtin/project/create/_input.py,sha256=hiSB7jSUqfDlQeSb2S_p14G-Ipo8mMLyNwh6
1268
1268
  zrb/builtin/project/create/create.py,sha256=7OGvlhWz63uLBh4jxZ4W8drEDL8Fpvc1kO9bcTvZjx8,3188
1269
1269
  zrb/builtin/project/create/init-git.sh,sha256=38ri7BuoT_5vXS2jlNbJmkSPgaZvkIBWt-Np_DhMjLI,110
1270
1270
  zrb/builtin/project/create/template/.flake8,sha256=uBzLhwCiogbbtgxD9dBTGxSm_8VQ1UHpVkn2CroGl3c,56
1271
- zrb/builtin/project/create/template/.github/workflows/_zrb.yml,sha256=KO39KchT81zPwvmwUntYzpU7D0PVuaD73wi8s48IDcs,1081
1271
+ zrb/builtin/project/create/template/.github/workflows/_zrb.yml,sha256=OsXYQrxU9J5-RdjhdsVRMjbICo7gb2-Ww1Jh1J3zT_M,1214
1272
1272
  zrb/builtin/project/create/template/.github/workflows/hello.yml,sha256=JmaDXN3vagvA47Sy41Z4ieNMElqqkM-k6y7t5CHJ93o,208
1273
1273
  zrb/builtin/project/create/template/.gitignore,sha256=9Sy-cmSDOIawqlmervgoO1eWMoJpOTUIneOpNqGW2Dw,27
1274
1274
  zrb/builtin/project/create/template/.python-version,sha256=rGeoqWHOE1NzOu73didX8_OyjR9O8b-XNp87WjKbO0s,7
@@ -1355,7 +1355,7 @@ zrb/shell-scripts/ssh-util.sh,sha256=9lXDzw6oO8HuA4vdbfps_uQMMwKyNYX9fZkZgpK52g8
1355
1355
  zrb/task/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1356
1356
  zrb/task/any_task.py,sha256=hxL55NcbsXhMy4xa1z7pdhV5qE41QC5s63BrN81s0MQ,39020
1357
1357
  zrb/task/any_task_event_handler.py,sha256=vpO9t0fck8-oFu1KYptfcg2hXKRsk6V5je4Dg-Bl21o,359
1358
- zrb/task/base_remote_cmd_task.py,sha256=nwEuiSF4dh3hKNfBH0ABWotx59wU-on4E6jzW2Wl67U,9296
1358
+ zrb/task/base_remote_cmd_task.py,sha256=dDs9li5EMNLfLclfAacAXumqESA_V-GNqVdwQpbbAAc,9938
1359
1359
  zrb/task/base_task/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1360
1360
  zrb/task/base_task/base_task.py,sha256=tN1f6ZWPk0YdkmP9PJFRCuwkoY1n1RuftZLXjUzKLtM,19079
1361
1361
  zrb/task/base_task/component/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -1365,9 +1365,9 @@ zrb/task/base_task/component/pid_model.py,sha256=RjJIqOpavucDssnd3q3gT4q8QnP8I9S
1365
1365
  zrb/task/base_task/component/renderer.py,sha256=9wP2IW811Ta81IoPWmeQ7yVc7eG-uaSnOVbEyeaOIuk,4439
1366
1366
  zrb/task/base_task/component/trackers.py,sha256=gM9eOukMh6kvNJnRsHscQ_JN--Haa2YA4bIufqh8upE,1950
1367
1367
  zrb/task/checker.py,sha256=c_7vNq4Li_OdB9OXE6_VDAFazZwUKC9E7aesuksGH_I,3193
1368
- zrb/task/cmd_task.py,sha256=wrSB-6jhPwd0dHVqGgonQjRu8qfXw7w8WH85p7yOOf4,13966
1368
+ zrb/task/cmd_task.py,sha256=QaVWKbnUGmdWJ97IGdR5i3irvdLxCq6_CWPc8WaMxM0,14417
1369
1369
  zrb/task/decorator.py,sha256=7qEkdPoKzOIYQQnCXnjQMw0okG5rC24m7cmNxCou9r8,2887
1370
- zrb/task/docker_compose_task.py,sha256=o93cxty8DCbcV_vqnIEpvPDvU5Yn9hzQb5frOvzFsug,14331
1370
+ zrb/task/docker_compose_task.py,sha256=4CPfegRbcczP8-6Ugy52V6KO6PZRwL-fJ4l38nTpn_g,14724
1371
1371
  zrb/task/flow_task.py,sha256=uhwwT1Xpwcr4V9LPfJq4kyD3QC-4U9ijTAYLMBV2NIU,4715
1372
1372
  zrb/task/http_checker.py,sha256=QF43EuqY8FhLr7u-zVlITnjKgq6ozTy42f8kiqlBYAY,5248
1373
1373
  zrb/task/notifier.py,sha256=AYZamGg8GDDu-smNOx8s84k6iTgpSspcIzgYthzPolM,6066
@@ -1381,7 +1381,7 @@ zrb/task/resource_maker.py,sha256=QrzYlhWCAMu2_WmMr4RImbP53ppNHzeob6I5cHxX2xU,66
1381
1381
  zrb/task/rsync_task.py,sha256=5X_Il43TTXkqMF-W5olzoGzykIm9zZNkwe7oLLQ4dwY,4034
1382
1382
  zrb/task/task.py,sha256=38w8diC22nU5bzN2X9mfJ8PKxxMl1Q_Lrlu5uIBRuc4,182
1383
1383
  zrb/task/time_watcher.py,sha256=M-GZPZIYmeBiTDeU9mgecpMJ7UMoZ1Zsj9c4OwTVa7o,3984
1384
- zrb/task/wiki_task.py,sha256=xoMAIzyKfbo0EMUdP4j4ccQzDA1AR-Dg-ZnPHEPp8qU,3848
1384
+ zrb/task/wiki_task.py,sha256=HXKpssgKGdjBckW-Ena8m-sUqxX6Ty6_hQ9bIXAEI9Q,4178
1385
1385
  zrb/task_env/constant.py,sha256=pWmniGJQV-74aNR7J0PYldFbL6YxZT27Nxs1jdwhH_Q,44
1386
1386
  zrb/task_env/env.py,sha256=y16WTzZGUJB596a2Qb_X1dhV0oYxU4JwlWf_rrHKMWo,4766
1387
1387
  zrb/task_env/env_file.py,sha256=BWG9ei41GrTKuTAOudneVBM-3ay88cnlM_11zWKMePE,2932
@@ -1398,8 +1398,8 @@ zrb/task_input/int_input.py,sha256=NVXAToqgdmWVwDqnr3XGuvq_QMNvUiIdD-pW5L4uebk,4
1398
1398
  zrb/task_input/password_input.py,sha256=5sS3XP7WtGow7r7Fid8J9SX0iNCidO6Bg7q40UpZDM0,4029
1399
1399
  zrb/task_input/str_input.py,sha256=D2WBeB-CdmAuOSzT7jTXvie7X3EK_m_Oq8_SVwmNpWA,4042
1400
1400
  zrb/task_input/task_input.py,sha256=L-U5dX-I2U5ci7GU226Q8pXcQe5SpGuOl5viFwlfiM0,2022
1401
- zrb-0.11.2.dist-info/LICENSE,sha256=WfnGCl8G60EYOPAEkuc8C9m9pdXWDe08NsKj3TBbxsM,728
1402
- zrb-0.11.2.dist-info/METADATA,sha256=yGesrK8rmEm0sy8qHo5h51y43auYn7Xpkce56LQBYTg,16460
1403
- zrb-0.11.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
1404
- zrb-0.11.2.dist-info/entry_points.txt,sha256=xTgXc1kBKYhJHEujdaSPHUcJT3-hbyP1mLgwkv-5sSk,40
1405
- zrb-0.11.2.dist-info/RECORD,,
1401
+ zrb-0.12.0.dist-info/LICENSE,sha256=WfnGCl8G60EYOPAEkuc8C9m9pdXWDe08NsKj3TBbxsM,728
1402
+ zrb-0.12.0.dist-info/METADATA,sha256=unvSp2-5OzeGq9N8kU5eSQX3sMPEk1gay6IyG3S_cg0,16460
1403
+ zrb-0.12.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
1404
+ zrb-0.12.0.dist-info/entry_points.txt,sha256=xTgXc1kBKYhJHEujdaSPHUcJT3-hbyP1mLgwkv-5sSk,40
1405
+ zrb-0.12.0.dist-info/RECORD,,
File without changes
File without changes