zrb 0.15.0__py3-none-any.whl → 0.16.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.
Files changed (94) hide show
  1. zrb/__init__.py +3 -0
  2. zrb/__main__.py +0 -3
  3. zrb/action/runner.py +6 -2
  4. zrb/advertisement.py +4 -0
  5. zrb/builtin/devtool/install/_input.py +2 -4
  6. zrb/builtin/devtool/install/helix/resource/config.toml +2 -1
  7. zrb/builtin/process/pid/get_by_name.py +1 -1
  8. zrb/builtin/project/create/template/project.sh +1 -0
  9. zrb/builtin/schedule.py +16 -10
  10. zrb/builtin/watch_changes.py +17 -14
  11. zrb/config/config.py +21 -14
  12. zrb/helper/accessories/color.py +5 -2
  13. zrb/helper/accessories/icon.py +4 -0
  14. zrb/helper/accessories/name.py +4 -0
  15. zrb/helper/accessories/untyped_color.py +10 -0
  16. zrb/helper/advertisement.py +3 -0
  17. zrb/helper/callable.py +5 -0
  18. zrb/helper/cli.py +2 -0
  19. zrb/helper/codemod/add_argument_to_function.py +6 -0
  20. zrb/helper/codemod/add_argument_to_function_call.py +6 -0
  21. zrb/helper/codemod/add_assert_resource.py +4 -0
  22. zrb/helper/codemod/add_function_call.py +4 -0
  23. zrb/helper/codemod/add_import_module.py +4 -0
  24. zrb/helper/codemod/add_key_value_to_dict.py +6 -0
  25. zrb/helper/codemod/add_property_to_class.py +6 -0
  26. zrb/helper/codemod/add_upstream_to_task.py +4 -0
  27. zrb/helper/codemod/append_code_to_function.py +6 -0
  28. zrb/helper/codemod/format_code.py +4 -0
  29. zrb/helper/default_env.py +2 -0
  30. zrb/helper/docker_compose/fetch_external_env.py +6 -0
  31. zrb/helper/docker_compose/file.py +4 -0
  32. zrb/helper/docstring.py +5 -0
  33. zrb/helper/env_map/fetch.py +4 -0
  34. zrb/helper/file/copy_tree.py +3 -0
  35. zrb/helper/file/match.py +4 -0
  36. zrb/helper/file/text.py +4 -0
  37. zrb/helper/git/detect_changes.py +4 -0
  38. zrb/helper/loader/load_module.py +2 -0
  39. zrb/helper/log.py +1 -1
  40. zrb/helper/map/conversion.py +4 -0
  41. zrb/helper/python_task.py +3 -0
  42. zrb/helper/render_data.py +4 -0
  43. zrb/helper/string/conversion.py +13 -36
  44. zrb/helper/string/jinja.py +4 -0
  45. zrb/helper/string/modification.py +4 -0
  46. zrb/helper/string/parse_replacement.py +4 -0
  47. zrb/helper/string/untyped_conversion.py +49 -0
  48. zrb/helper/task.py +4 -0
  49. zrb/helper/typecheck.py +6 -7
  50. zrb/helper/typing.py +32 -12
  51. zrb/helper/util.py +4 -0
  52. zrb/runner.py +3 -0
  53. zrb/task/any_task.py +4 -0
  54. zrb/task/any_task_event_handler.py +4 -0
  55. zrb/task/base_remote_cmd_task.py +4 -0
  56. zrb/task/base_task/base_task.py +1 -1
  57. zrb/task/checker.py +4 -0
  58. zrb/task/cmd_task.py +4 -1
  59. zrb/task/decorator.py +4 -0
  60. zrb/task/docker_compose_task.py +4 -0
  61. zrb/task/flow_task.py +4 -0
  62. zrb/task/http_checker.py +4 -0
  63. zrb/task/notifier.py +4 -0
  64. zrb/task/parallel.py +4 -0
  65. zrb/task/path_checker.py +4 -0
  66. zrb/task/path_watcher.py +4 -0
  67. zrb/task/port_checker.py +4 -0
  68. zrb/task/recurring_task.py +5 -0
  69. zrb/task/remote_cmd_task.py +4 -0
  70. zrb/task/resource_maker.py +4 -0
  71. zrb/task/rsync_task.py +4 -0
  72. zrb/task/server.py +192 -0
  73. zrb/task/task.py +4 -0
  74. zrb/task/time_watcher.py +4 -0
  75. zrb/task/wiki_task.py +4 -0
  76. zrb/task_env/constant.py +5 -0
  77. zrb/task_env/env.py +4 -0
  78. zrb/task_env/env_file.py +4 -0
  79. zrb/task_group/group.py +4 -0
  80. zrb/task_input/any_input.py +4 -0
  81. zrb/task_input/base_input.py +4 -0
  82. zrb/task_input/bool_input.py +4 -0
  83. zrb/task_input/choice_input.py +4 -0
  84. zrb/task_input/constant.py +5 -0
  85. zrb/task_input/float_input.py +4 -0
  86. zrb/task_input/int_input.py +4 -0
  87. zrb/task_input/password_input.py +4 -0
  88. zrb/task_input/str_input.py +4 -0
  89. zrb/task_input/task_input.py +4 -0
  90. {zrb-0.15.0.dist-info → zrb-0.16.0.dist-info}/METADATA +1 -1
  91. {zrb-0.15.0.dist-info → zrb-0.16.0.dist-info}/RECORD +94 -91
  92. {zrb-0.15.0.dist-info → zrb-0.16.0.dist-info}/LICENSE +0 -0
  93. {zrb-0.15.0.dist-info → zrb-0.16.0.dist-info}/WHEEL +0 -0
  94. {zrb-0.15.0.dist-info → zrb-0.16.0.dist-info}/entry_points.txt +0 -0
zrb/__init__.py CHANGED
@@ -32,6 +32,7 @@ from zrb.task.resource_maker import (
32
32
  get_default_resource_skip_parsing,
33
33
  )
34
34
  from zrb.task.rsync_task import RsyncTask
35
+ from zrb.task.server import Controller, Server
35
36
  from zrb.task.task import Task
36
37
  from zrb.task.time_watcher import TimeWatcher
37
38
  from zrb.task.wiki_task import create_wiki_tasks
@@ -74,6 +75,8 @@ assert HTTPChecker
74
75
  assert PortChecker
75
76
  assert PathChecker
76
77
  assert PathWatcher
78
+ assert Controller
79
+ assert Server
77
80
  assert TimeWatcher
78
81
  assert ResourceMaker
79
82
  assert FlowTask
zrb/__main__.py CHANGED
@@ -1,10 +1,7 @@
1
- from zrb.helper.accessories.color import colored
2
1
  from zrb.helper.cli import create_cli
3
2
  from zrb.helper.default_env import inject_default_env
4
- from zrb.helper.log import logger
5
3
 
6
4
  inject_default_env()
7
- logger.info(colored("Create CLI instance", attrs=["dark"]))
8
5
  cli = create_cli()
9
6
 
10
7
  if __name__ == "__main__":
zrb/action/runner.py CHANGED
@@ -9,6 +9,8 @@ from zrb.helper.typing import Any, Callable, List, Mapping, Union
9
9
  from zrb.task.any_task import AnyTask
10
10
  from zrb.task_group.group import Group as TaskGroup
11
11
 
12
+ logger.debug(colored("Loading zrb.action.runner", attrs=["dark"]))
13
+
12
14
  CliSubcommand = Union[click.Group, click.Command]
13
15
 
14
16
 
@@ -88,7 +90,7 @@ class Runner:
88
90
  task_inputs = task._get_combined_inputs()
89
91
  task_cli_name = task.get_cli_name()
90
92
  task_description = task.get_description()
91
- callback = self.__wrap_task_function(task)
93
+ callback = self.__get_wrapped_task_function(task)
92
94
  command = click.Command(
93
95
  callback=callback, name=task_cli_name, help=task_description
94
96
  )
@@ -106,12 +108,14 @@ class Runner:
106
108
  command.params.append(click.Option(param_decl, **options))
107
109
  return command
108
110
 
109
- def __wrap_task_function(self, task: AnyTask) -> Callable[..., Any]:
111
+ def __get_wrapped_task_function(self, task: AnyTask) -> Callable[..., Any]:
110
112
  def wrapped_function(*args: Any, **kwargs: Any) -> Any:
111
113
  function = task.to_function(env_prefix=self.__env_prefix, raise_error=True)
112
114
  try:
113
115
  function(*args, **kwargs)
114
116
  except Exception:
115
117
  sys.exit(1)
118
+ finally:
119
+ task.clear_xcom()
116
120
 
117
121
  return wrapped_function
zrb/advertisement.py CHANGED
@@ -1,6 +1,10 @@
1
+ from zrb.helper.accessories.color import colored
1
2
  from zrb.helper.advertisement import Advertisement
3
+ from zrb.helper.log import logger
2
4
  from zrb.helper.typing import List
3
5
 
6
+ logger.debug(colored("Loading zrb.advertisement", attrs=["dark"]))
7
+
4
8
  # flake8: noqa E501
5
9
 
6
10
  advertisements: List[Advertisement] = [
@@ -1,11 +1,9 @@
1
- from zrb.config.config import get_current_shell
1
+ from zrb.config.config import default_shell
2
2
  from zrb.task_input.str_input import StrInput
3
3
 
4
- current_shell = get_current_shell()
5
-
6
4
  terminal_config_file_input = StrInput(
7
5
  name="config-file",
8
6
  shortcut="c",
9
7
  prompt="Config file",
10
- default="~/.zshrc" if current_shell == "zsh" else "~/.bashrc",
8
+ default="~/.zshrc" if default_shell == "zsh" else "~/.bashrc",
11
9
  )
@@ -3,6 +3,7 @@ theme = "gruvbox_transparent"
3
3
  [editor]
4
4
  line-number = "relative"
5
5
  mouse = true
6
+ bufferline = "always"
6
7
 
7
8
  [editor.cursor-shape]
8
9
  insert = "bar"
@@ -16,4 +17,4 @@ enable = true
16
17
  hidden = false
17
18
  git-ignore = false
18
19
  git-global = false
19
- git-exclude = false
20
+ git-exclude = false
@@ -16,7 +16,7 @@ get_process_pid_by_name = CmdTask(
16
16
  prompt="Process name to be checked",
17
17
  )
18
18
  ],
19
- cmd="pgrep {{ input.name }}",
19
+ cmd='pgrep "{{ input.name }}" || exit 0',
20
20
  checking_interval=3,
21
21
  )
22
22
  runner.register(get_process_pid_by_name)
@@ -56,6 +56,7 @@ reload() {
56
56
  fi
57
57
 
58
58
  log_info 'Install'
59
+ poetry lock --no-update
59
60
  poetry install
60
61
 
61
62
  if [ "$IS_TERMUX" = "1" ]
zrb/builtin/schedule.py CHANGED
@@ -1,10 +1,10 @@
1
1
  from zrb.builtin._helper.reccuring_action import create_recurring_action
2
2
  from zrb.runner import runner
3
- from zrb.task.recurring_task import RecurringTask
3
+ from zrb.task.server import Controller, Server
4
4
  from zrb.task.time_watcher import TimeWatcher
5
5
  from zrb.task_input.str_input import StrInput
6
6
 
7
- schedule = RecurringTask(
7
+ schedule = Server(
8
8
  name="schedule",
9
9
  icon="📅",
10
10
  color="yellow",
@@ -17,15 +17,21 @@ schedule = RecurringTask(
17
17
  description="Schedule cron pattern to show the message",
18
18
  ),
19
19
  ],
20
- triggers=[
21
- TimeWatcher(
22
- name="watch-time", color="cyan", icon="⏰", schedule="{{input.schedule}}"
20
+ controllers=[
21
+ Controller(
22
+ name="periodic",
23
+ trigger=TimeWatcher(
24
+ name="watch-time",
25
+ color="cyan",
26
+ icon="⏰",
27
+ schedule="{{input.schedule}}",
28
+ ),
29
+ action=create_recurring_action(
30
+ notif_title="Schedule",
31
+ trigger_caption="Schedule",
32
+ trigger_xcom_key="watch-time.scheduled-time",
33
+ ),
23
34
  )
24
35
  ],
25
- task=create_recurring_action(
26
- notif_title="Schedule",
27
- trigger_caption="Schedule",
28
- trigger_xcom_key="watch-time.scheduled-time",
29
- ),
30
36
  )
31
37
  runner.register(schedule)
@@ -1,10 +1,10 @@
1
1
  from zrb.builtin._helper.reccuring_action import create_recurring_action
2
2
  from zrb.runner import runner
3
3
  from zrb.task.path_watcher import PathWatcher
4
- from zrb.task.recurring_task import RecurringTask
4
+ from zrb.task.server import Controller, Server
5
5
  from zrb.task_input.str_input import StrInput
6
6
 
7
- watch_changes = RecurringTask(
7
+ watch_changes = Server(
8
8
  name="watch-changes",
9
9
  icon="🕵️",
10
10
  color="yellow",
@@ -23,19 +23,22 @@ watch_changes = RecurringTask(
23
23
  description="Ignored file pattern",
24
24
  ),
25
25
  ],
26
- triggers=[
27
- PathWatcher(
28
- name="watch-path",
29
- color="cyan",
30
- icon="👀",
31
- path="{{input.pattern}}",
32
- ignored_path="{{input.ignored_pattern}}",
26
+ controllers=[
27
+ Controller(
28
+ name="watch",
29
+ trigger=PathWatcher(
30
+ name="watch-path",
31
+ color="cyan",
32
+ icon="👀",
33
+ path="{{input.pattern}}",
34
+ ignored_path="{{input.ignored_pattern}}",
35
+ ),
36
+ action=create_recurring_action(
37
+ notif_title="Watch",
38
+ trigger_caption="File changes",
39
+ trigger_xcom_key="watch-path.file",
40
+ ),
33
41
  )
34
42
  ],
35
- task=create_recurring_action(
36
- notif_title="Watch",
37
- trigger_caption="File changes",
38
- trigger_xcom_key="watch-path.file",
39
- ),
40
43
  )
41
44
  runner.register(watch_changes)
zrb/config/config.py CHANGED
@@ -1,17 +1,17 @@
1
1
  import importlib.metadata as metadata
2
2
  import os
3
3
 
4
- from zrb.helper.string.conversion import to_boolean, to_logging_level
5
- from zrb.helper.typecheck import typechecked
4
+ from zrb.helper.string.untyped_conversion import (
5
+ untyped_to_boolean,
6
+ untyped_to_logging_level,
7
+ )
6
8
 
7
9
 
8
- @typechecked
9
- def get_version() -> str:
10
+ def _get_version() -> str:
10
11
  return metadata.version("zrb")
11
12
 
12
13
 
13
- @typechecked
14
- def get_current_shell() -> str:
14
+ def _get_current_shell() -> str:
15
15
  current_shell = os.getenv("SHELL", "")
16
16
  if current_shell.endswith("zsh"):
17
17
  return "zsh"
@@ -24,17 +24,24 @@ def _get_valid_container_backend(container_backend: str) -> str:
24
24
  return "docker"
25
25
 
26
26
 
27
- tmp_dir = os.getenv("ZRB_TMP_DIR", "/tmp")
28
- default_shell = os.getenv("ZRB_SHELL", get_current_shell())
27
+ def _get_default_tmp_dir() -> str:
28
+ if os.path.isdir("/tmp"):
29
+ return "/tmp"
30
+ return os.path.expanduser(os.path.join("~", ".tmp"))
31
+
32
+
33
+ tmp_dir = os.getenv("ZRB_TMP_DIR", _get_default_tmp_dir())
34
+ default_shell = os.getenv("ZRB_SHELL", _get_current_shell())
29
35
  init_script_str = os.getenv("ZRB_INIT_SCRIPTS", "")
30
36
  init_scripts = init_script_str.split(":") if init_script_str != "" else []
31
- logging_level = to_logging_level(os.getenv("ZRB_LOGGING_LEVEL", "WARNING"))
32
- should_load_builtin = to_boolean(os.getenv("ZRB_SHOULD_LOAD_BUILTIN", "1"))
37
+ logging_level = untyped_to_logging_level(os.getenv("ZRB_LOGGING_LEVEL", "WARNING"))
38
+ should_load_builtin = untyped_to_boolean(os.getenv("ZRB_SHOULD_LOAD_BUILTIN", "1"))
33
39
  env_prefix = os.getenv("ZRB_ENV", "")
34
- show_advertisement = to_boolean(os.getenv("ZRB_SHOW_ADVERTISEMENT", "1"))
35
- show_prompt = to_boolean(os.getenv("ZRB_SHOW_PROMPT", "1"))
36
- show_time = to_boolean(os.getenv("ZRB_SHOW_TIME", "1"))
37
- version = get_version()
40
+ show_advertisement = untyped_to_boolean(os.getenv("ZRB_SHOW_ADVERTISEMENT", "1"))
41
+ show_prompt = untyped_to_boolean(os.getenv("ZRB_SHOW_PROMPT", "1"))
42
+ show_time = untyped_to_boolean(os.getenv("ZRB_SHOW_TIME", "1"))
43
+ version = _get_version()
38
44
  container_backend = _get_valid_container_backend(
39
45
  os.getenv("ZRB_CONTAINER_BACKEND", "docker")
40
46
  )
47
+ enable_type_checking = untyped_to_boolean(os.getenv("ZRB_ENABLE_TYPE_CHECKING", "1"))
@@ -1,11 +1,14 @@
1
1
  import random
2
2
 
3
3
  from termcolor import COLORS
4
- from termcolor import colored as term_colored
5
4
 
5
+ from zrb.helper.accessories.untyped_color import untyped_colored
6
+ from zrb.helper.log import logger
6
7
  from zrb.helper.typecheck import typechecked
7
8
  from zrb.helper.typing import Iterable, Optional
8
9
 
10
+ logger.debug(untyped_colored("Loading zrb.helper.accessories.color", attrs=["dark"]))
11
+
9
12
 
10
13
  @typechecked
11
14
  def get_random_color() -> str:
@@ -37,4 +40,4 @@ def colored(
37
40
  on_color: Optional[str] = None,
38
41
  attrs: Optional[Iterable[str]] = None,
39
42
  ) -> str:
40
- return term_colored(text, color, on_color, attrs)
43
+ return untyped_colored(text, color, on_color, attrs)
@@ -1,7 +1,11 @@
1
1
  import random
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
 
7
+ logger.debug(colored("Loading zrb.helper.accessories.icon", attrs=["dark"]))
8
+
5
9
 
6
10
  @typechecked
7
11
  def get_random_icon() -> str:
@@ -1,8 +1,12 @@
1
1
  import random
2
2
  import string
3
3
 
4
+ from zrb.helper.accessories.color import colored
5
+ from zrb.helper.log import logger
4
6
  from zrb.helper.typecheck import typechecked
5
7
 
8
+ logger.debug(colored("Loading zrb.helper.accessories.name", attrs=["dark"]))
9
+
6
10
 
7
11
  @typechecked
8
12
  def get_random_name(
@@ -0,0 +1,10 @@
1
+ from termcolor import colored as term_colored
2
+
3
+
4
+ def untyped_colored(
5
+ text,
6
+ color=None,
7
+ on_color=None,
8
+ attrs=None,
9
+ ) -> str:
10
+ return term_colored(text, color, on_color, attrs)
@@ -4,9 +4,12 @@ import re
4
4
  import sys
5
5
 
6
6
  from zrb.helper.accessories.color import colored
7
+ from zrb.helper.log import logger
7
8
  from zrb.helper.typecheck import typechecked
8
9
  from zrb.helper.typing import Iterable, Optional
9
10
 
11
+ logger.debug(colored("Loading zrb.helper.advertisement", attrs=["dark"]))
12
+
10
13
 
11
14
  @typechecked
12
15
  class Advertisement:
zrb/helper/callable.py CHANGED
@@ -1,6 +1,11 @@
1
1
  import inspect
2
2
  from typing import Any, Callable
3
3
 
4
+ from zrb.helper.accessories.color import colored
5
+ from zrb.helper.log import logger
6
+
7
+ logger.debug(colored("Loading zrb.helper.callable", attrs=["dark"]))
8
+
4
9
 
5
10
  async def run_async(fn: Callable, *args: Any, **kwargs: Any) -> Any:
6
11
  if inspect.iscoroutinefunction(fn):
zrb/helper/cli.py CHANGED
@@ -11,6 +11,8 @@ from zrb.helper.log import logger
11
11
  from zrb.helper.typecheck import typechecked
12
12
  from zrb.runner import runner
13
13
 
14
+ logger.debug(colored("Loading zrb.helper.cli", attrs=["dark"]))
15
+
14
16
  HELP = f"""
15
17
  bb
16
18
  zzzzz rr rr bb
@@ -1,7 +1,13 @@
1
1
  import libcst as cst
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
 
7
+ logger.debug(
8
+ colored("Loading zrb.helper.codemod.add_argument_to_function", attrs=["dark"])
9
+ )
10
+
5
11
 
6
12
  @typechecked
7
13
  class AddArgumentTransformer(cst.CSTTransformer):
@@ -1,7 +1,13 @@
1
1
  import libcst as cst
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
 
7
+ logger.debug(
8
+ colored("Loading zrb.helper.codemod.add_argument_to_function_call", attrs=["dark"])
9
+ )
10
+
5
11
 
6
12
  @typechecked
7
13
  class AddArgumentTransformer(cst.CSTTransformer):
@@ -1,7 +1,11 @@
1
1
  import libcst as cst
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
 
7
+ logger.debug(colored("Loading zrb.helper.codemod.add_assert_resource", attrs=["dark"]))
8
+
5
9
 
6
10
  @typechecked
7
11
  def add_assert_resource(code: str, resource: str) -> str:
@@ -1,7 +1,11 @@
1
1
  import libcst as cst
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
 
7
+ logger.debug(colored("Loading zrb.helper.codemod.add_function_call", attrs=["dark"]))
8
+
5
9
 
6
10
  @typechecked
7
11
  def add_function_call(code: str, function_name: str, parameters: list) -> str:
@@ -1,8 +1,12 @@
1
1
  import libcst as cst
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
  from zrb.helper.typing import Optional, Tuple, Union
5
7
 
8
+ logger.debug(colored("Loading zrb.helper.codemod.add_import_module", attrs=["dark"]))
9
+
6
10
 
7
11
  @typechecked
8
12
  def add_import_module(
@@ -1,7 +1,13 @@
1
1
  import libcst as cst
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
 
7
+ logger.debug(
8
+ colored("Loading zrb.helper.codemod.add_key_value_to_dict", attrs=["dark"])
9
+ )
10
+
5
11
 
6
12
  @typechecked
7
13
  class AddKeyValuePairTransformer(cst.CSTTransformer):
@@ -1,8 +1,14 @@
1
1
  import libcst as cst
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
  from zrb.helper.typing import Optional
5
7
 
8
+ logger.debug(
9
+ colored("Loading zrb.helper.codemod.add_property_to_class", attrs=["dark"])
10
+ )
11
+
6
12
 
7
13
  @typechecked
8
14
  class AddPropertyTransformer(cst.CSTTransformer):
@@ -1,7 +1,11 @@
1
1
  import libcst as cst
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
 
7
+ logger.debug(colored("Loading zrb.helper.codemod.add_upstream_to_task", attrs=["dark"]))
8
+
5
9
 
6
10
  @typechecked
7
11
  class TaskTransformer(cst.CSTTransformer):
@@ -1,7 +1,13 @@
1
1
  import libcst as cst
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
 
7
+ logger.debug(
8
+ colored("Loading zrb.helper.codemod.append_code_to_function", attrs=["dark"])
9
+ )
10
+
5
11
 
6
12
  @typechecked
7
13
  class AppendCodeTransformer(cst.CSTTransformer):
@@ -1,7 +1,11 @@
1
1
  import autopep8
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
 
7
+ logger.debug(colored("Loading zrb.helper.codemod.format_code", attrs=["dark"]))
8
+
5
9
 
6
10
  @typechecked
7
11
  def format_code(code: str) -> str:
zrb/helper/default_env.py CHANGED
@@ -6,9 +6,11 @@ from zrb.helper.log import logger
6
6
  from zrb.helper.typecheck import typechecked
7
7
  from zrb.helper.typing import Mapping, Optional
8
8
 
9
+ logger.debug(colored("Loading zrb.helper.default_env", attrs=["dark"]))
9
10
  _PROJECT_DIR_MAP: Mapping[str, str] = {}
10
11
 
11
12
 
13
+ @lru_cache
12
14
  def inject_default_env():
13
15
  # Inject PYTHONUNBUFFERED
14
16
  if "PYTHONUNBUFFERED" not in os.environ:
@@ -1,6 +1,12 @@
1
+ from zrb.helper.accessories.color import colored
2
+ from zrb.helper.log import logger
1
3
  from zrb.helper.typecheck import typechecked
2
4
  from zrb.helper.typing import Any, List, Mapping
3
5
 
6
+ logger.debug(
7
+ colored("Loading zrb.helper.docker_compose.fetch_external_env", attrs=["dark"])
8
+ )
9
+
4
10
 
5
11
  @typechecked
6
12
  def fetch_compose_file_env_map(data: Any) -> Mapping[str, str]:
@@ -1,8 +1,12 @@
1
1
  from ruamel.yaml import YAML, CommentedMap
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
  from zrb.helper.typing import Any, Mapping
5
7
 
8
+ logger.debug(colored("Loading zrb.helper.docker_compose.file", attrs=["dark"]))
9
+
6
10
 
7
11
  @typechecked
8
12
  def read_compose_file(file_name: str) -> Any:
zrb/helper/docstring.py CHANGED
@@ -1,6 +1,11 @@
1
1
  import inspect
2
2
  import re
3
3
 
4
+ from zrb.helper.accessories.color import colored
5
+ from zrb.helper.log import logger
6
+
7
+ logger.debug(colored("Loading zrb.helper.docstring", attrs=["dark"]))
8
+
4
9
 
5
10
  def get_markdown_from_docstring(cls) -> str:
6
11
  """
@@ -1,3 +1,5 @@
1
+ from zrb.helper.accessories.color import colored
2
+ from zrb.helper.log import logger
1
3
  from zrb.helper.string.jinja import is_probably_jinja
2
4
  from zrb.helper.typecheck import typechecked
3
5
  from zrb.helper.typing import List, Mapping
@@ -5,6 +7,8 @@ from zrb.task.any_task import AnyTask
5
7
  from zrb.task_env.env import Env
6
8
  from zrb.task_group.group import Group
7
9
 
10
+ logger.debug(colored("Loading zrb.helper.env_map.fetch", attrs=["dark"]))
11
+
8
12
 
9
13
  @typechecked
10
14
  def fetch_env_map_from_group(
@@ -2,12 +2,15 @@ import fnmatch
2
2
  import os
3
3
  import shutil
4
4
 
5
+ from zrb.helper.accessories.color import colored
5
6
  from zrb.helper.file.text import read_text_file_async, write_text_file_async
6
7
  from zrb.helper.log import logger
7
8
  from zrb.helper.string.parse_replacement import parse_replacement
8
9
  from zrb.helper.typecheck import typechecked
9
10
  from zrb.helper.typing import Iterable, Mapping, Optional
10
11
 
12
+ logger.debug(colored("Loading zrb.helper.file.copy_tree", attrs=["dark"]))
13
+
11
14
 
12
15
  @typechecked
13
16
  async def copy_tree(
zrb/helper/file/match.py CHANGED
@@ -1,9 +1,13 @@
1
1
  import fnmatch
2
2
  import glob
3
3
 
4
+ from zrb.helper.accessories.color import colored
5
+ from zrb.helper.log import logger
4
6
  from zrb.helper.typecheck import typechecked
5
7
  from zrb.helper.typing import Iterable, List
6
8
 
9
+ logger.debug(colored("Loading zrb.helper.file.match", attrs=["dark"]))
10
+
7
11
 
8
12
  @typechecked
9
13
  def get_file_names(glob_path: str, glob_ignored_paths: Iterable[str]) -> List[str]:
zrb/helper/file/text.py CHANGED
@@ -2,8 +2,12 @@ import os
2
2
 
3
3
  import aiofiles
4
4
 
5
+ from zrb.helper.accessories.color import colored
6
+ from zrb.helper.log import logger
5
7
  from zrb.helper.typecheck import typechecked
6
8
 
9
+ logger.debug(colored("Loading zrb.helper.file.text", attrs=["dark"]))
10
+
7
11
 
8
12
  @typechecked
9
13
  async def read_text_file_async(file_name: str) -> str:
@@ -1,8 +1,12 @@
1
1
  import subprocess
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typecheck import typechecked
4
6
  from zrb.helper.typing import Mapping
5
7
 
8
+ logger.debug(colored("Loading zrb.helper.git.detect_changes", attrs=["dark"]))
9
+
6
10
 
7
11
  @typechecked
8
12
  class ModificationState:
@@ -8,6 +8,8 @@ from zrb.helper.accessories.color import colored
8
8
  from zrb.helper.log import logger
9
9
  from zrb.helper.typecheck import typechecked
10
10
 
11
+ logger.debug(colored("Loading zrb.helper.loader.load_module", attrs=["dark"]))
12
+
11
13
  pattern = re.compile("[^a-zA-Z0-9]")
12
14
 
13
15
 
zrb/helper/log.py CHANGED
@@ -1,7 +1,7 @@
1
1
  import logging
2
2
 
3
3
  from zrb.config.config import logging_level
4
- from zrb.helper.accessories.color import colored
4
+ from zrb.helper.accessories.untyped_color import untyped_colored as colored
5
5
 
6
6
  # create logger
7
7
  logger = logging.getLogger("zrb")