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
@@ -1,6 +1,10 @@
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, Mapping
3
5
 
6
+ logger.debug(colored("Loading zrb.helper.map.conversion", attrs=["dark"]))
7
+
4
8
 
5
9
  @typechecked
6
10
  def to_str(
zrb/helper/python_task.py CHANGED
@@ -1,10 +1,13 @@
1
1
  import sys
2
2
 
3
3
  from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
4
5
  from zrb.helper.task import show_lines as task_show_lines
5
6
  from zrb.helper.typecheck import typechecked
6
7
  from zrb.task.task import Task
7
8
 
9
+ logger.debug(colored("Loading zrb.helper.python_task", attrs=["dark"]))
10
+
8
11
  _DEPRECATION_WARNING = """
9
12
  DEPRECATED: zrb.helper.python_task
10
13
  Use zrb.helper.task instead
zrb/helper/render_data.py CHANGED
@@ -3,6 +3,8 @@ import os
3
3
  import platform
4
4
  import time
5
5
 
6
+ from zrb.helper.accessories.color import colored
7
+ from zrb.helper.log import logger
6
8
  from zrb.helper.util import (
7
9
  coalesce,
8
10
  coalesce_str,
@@ -14,6 +16,8 @@ from zrb.helper.util import (
14
16
  to_snake_case,
15
17
  )
16
18
 
19
+ logger.debug(colored("Loading zrb.helper.render_data", attrs=["dark"]))
20
+
17
21
  DEFAULT_RENDER_DATA = {
18
22
  "datetime": datetime,
19
23
  "os": os,
@@ -1,54 +1,31 @@
1
- import keyword
2
- import logging
3
- import re
4
-
5
- from zrb.helper.string.constant import FALSE_STRS, TRUE_STRS
1
+ from zrb.helper.accessories.color import colored
2
+ from zrb.helper.log import logger
3
+ from zrb.helper.string.untyped_conversion import (
4
+ untyped_to_boolean,
5
+ untyped_to_cli_name,
6
+ untyped_to_logging_level,
7
+ untyped_to_variable_name,
8
+ )
6
9
  from zrb.helper.typecheck import typechecked
7
10
 
8
- NON_WORD = re.compile(r"[\W]+")
9
- LEADING_NUM = re.compile(r"^\d+")
10
- LOGGING_LEVEL_MAP = {
11
- "critical": logging.CRITICAL,
12
- "fatal": logging.FATAL,
13
- "error": logging.ERROR,
14
- "warning": logging.WARNING,
15
- "warn": logging.WARN,
16
- "info": logging.INFO,
17
- "debug": logging.DEBUG,
18
- "notset": logging.NOTSET,
19
- }
11
+ logger.debug(colored("Loading zrb.helper.string.conversion", attrs=["dark"]))
20
12
 
21
13
 
22
14
  @typechecked
23
15
  def to_cli_name(name: str) -> str:
24
- return NON_WORD.sub("-", name).strip("-").lower()
16
+ return untyped_to_cli_name((name))
25
17
 
26
18
 
27
19
  @typechecked
28
20
  def to_variable_name(string: str) -> str:
29
- # Replace any non-word characters with underscore
30
- string = NON_WORD.sub("_", string).strip()
31
- # Remove leading digits
32
- string = LEADING_NUM.sub("", string)
33
- # Convert to lowercase
34
- string = string.lower()
35
- if keyword.iskeyword(string):
36
- return string + "_"
37
- return string
21
+ return untyped_to_variable_name(string)
38
22
 
39
23
 
40
24
  @typechecked
41
25
  def to_boolean(string: str) -> bool:
42
- if string.lower() in TRUE_STRS:
43
- return True
44
- if string.lower() in FALSE_STRS:
45
- return False
46
- raise Exception(f'Cannot infer boolean value from "{string}"')
26
+ return untyped_to_boolean(string)
47
27
 
48
28
 
49
29
  @typechecked
50
30
  def to_logging_level(logging_level_str: str) -> int:
51
- lower_logging_level_str = logging_level_str.lower()
52
- if lower_logging_level_str in LOGGING_LEVEL_MAP:
53
- return LOGGING_LEVEL_MAP[lower_logging_level_str]
54
- return logging.WARNING
31
+ return untyped_to_logging_level(logging_level_str)
@@ -1,6 +1,10 @@
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
3
5
 
6
+ logger.debug(colored("Loading zrb.helper.string.jinja", attrs=["dark"]))
7
+
4
8
 
5
9
  @typechecked
6
10
  def is_probably_jinja(value: Any) -> bool:
@@ -1,5 +1,9 @@
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
 
5
+ logger.debug(colored("Loading zrb.helper.string.modification", attrs=["dark"]))
6
+
3
7
 
4
8
  @typechecked
5
9
  def double_quote(text: str) -> str:
@@ -1,6 +1,10 @@
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 Mapping
3
5
 
6
+ logger.debug(colored("Loading zrb.helper.string.parse_replacment", attrs=["dark"]))
7
+
4
8
 
5
9
  @typechecked
6
10
  def parse_replacement(text: str, replacement: Mapping[str, str]):
@@ -0,0 +1,49 @@
1
+ import keyword
2
+ import logging
3
+ import re
4
+
5
+ from zrb.helper.string.constant import FALSE_STRS, TRUE_STRS
6
+
7
+ NON_WORD = re.compile(r"[\W]+")
8
+ LEADING_NUM = re.compile(r"^\d+")
9
+ LOGGING_LEVEL_MAP = {
10
+ "critical": logging.CRITICAL,
11
+ "fatal": logging.FATAL,
12
+ "error": logging.ERROR,
13
+ "warning": logging.WARNING,
14
+ "warn": logging.WARN,
15
+ "info": logging.INFO,
16
+ "debug": logging.DEBUG,
17
+ "notset": logging.NOTSET,
18
+ }
19
+
20
+
21
+ def untyped_to_cli_name(name: str) -> str:
22
+ return NON_WORD.sub("-", name).strip("-").lower()
23
+
24
+
25
+ def untyped_to_variable_name(string: str) -> str:
26
+ # Replace any non-word characters with underscore
27
+ string = NON_WORD.sub("_", string).strip()
28
+ # Remove leading digits
29
+ string = LEADING_NUM.sub("", string)
30
+ # Convert to lowercase
31
+ string = string.lower()
32
+ if keyword.iskeyword(string):
33
+ return string + "_"
34
+ return string
35
+
36
+
37
+ def untyped_to_boolean(string: str) -> bool:
38
+ if string.lower() in TRUE_STRS:
39
+ return True
40
+ if string.lower() in FALSE_STRS:
41
+ return False
42
+ raise Exception(f'Cannot infer boolean value from "{string}"')
43
+
44
+
45
+ def untyped_to_logging_level(logging_level_str: str) -> int:
46
+ lower_logging_level_str = logging_level_str.lower()
47
+ if lower_logging_level_str in LOGGING_LEVEL_MAP:
48
+ return LOGGING_LEVEL_MAP[lower_logging_level_str]
49
+ return logging.WARNING
zrb/helper/task.py CHANGED
@@ -1,6 +1,10 @@
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.task.task import Task
3
5
 
6
+ logger.debug(colored("Loading zrb.helper.task", attrs=["dark"]))
7
+
4
8
 
5
9
  @typechecked
6
10
  def show_lines(task: Task, *lines: str):
zrb/helper/typecheck.py CHANGED
@@ -1,17 +1,16 @@
1
- import os
2
1
  from typing import TypeVar
3
2
 
4
- from beartype import beartype
5
-
6
- from zrb.helper.string.constant import FALSE_STRS
7
-
8
- enable_type_checking_str = os.getenv("ZRB_ENABLE_TYPE_CHECKING", "1").lower()
9
- enable_type_checking = enable_type_checking_str not in FALSE_STRS
3
+ from zrb.config.config import enable_type_checking
4
+ from zrb.helper.accessories.untyped_color import untyped_colored as colored
5
+ from zrb.helper.log import logger
10
6
 
7
+ logger.debug(colored("Loading zrb.helper.typecheck", attrs=["dark"]))
11
8
  T = TypeVar("T")
12
9
 
13
10
 
14
11
  def typechecked(anything: T) -> T:
15
12
  if enable_type_checking:
13
+ from beartype import beartype
14
+
16
15
  return beartype(anything)
17
16
  return anything
zrb/helper/typing.py CHANGED
@@ -1,15 +1,35 @@
1
- from beartype.typing import (
2
- Any,
3
- Callable,
4
- Iterable,
5
- List,
6
- Mapping,
7
- Optional,
8
- Tuple,
9
- Type,
10
- TypeVar,
11
- Union,
12
- )
1
+ from zrb.config.config import enable_type_checking
2
+ from zrb.helper.accessories.untyped_color import untyped_colored as colored
3
+ from zrb.helper.log import logger
4
+
5
+ logger.debug(colored("Loading zrb.helper.typing", attrs=["dark"]))
6
+
7
+ if enable_type_checking:
8
+ from beartype.typing import (
9
+ Any,
10
+ Callable,
11
+ Iterable,
12
+ List,
13
+ Mapping,
14
+ Optional,
15
+ Tuple,
16
+ Type,
17
+ TypeVar,
18
+ Union,
19
+ )
20
+ else:
21
+ from typing import (
22
+ Any,
23
+ Callable,
24
+ Iterable,
25
+ List,
26
+ Mapping,
27
+ Optional,
28
+ Tuple,
29
+ Type,
30
+ TypeVar,
31
+ Union,
32
+ )
13
33
 
14
34
  JinjaTemplate = str
15
35
 
zrb/helper/util.py CHANGED
@@ -2,10 +2,14 @@ import re
2
2
 
3
3
  import jinja2
4
4
 
5
+ from zrb.helper.accessories.color import colored
6
+ from zrb.helper.log import logger
5
7
  from zrb.helper.string.conversion import to_boolean as conversion_to_boolean
6
8
  from zrb.helper.typecheck import typechecked
7
9
  from zrb.helper.typing import Any, Optional
8
10
 
11
+ logger.debug(colored("Loading zrb.helper.util", attrs=["dark"]))
12
+
9
13
  NON_ALPHA_NUM = re.compile(r"[^a-zA-Z0-9]+")
10
14
 
11
15
 
zrb/runner.py CHANGED
@@ -1,4 +1,7 @@
1
1
  from zrb.action.runner import Runner
2
2
  from zrb.config.config import env_prefix
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
 
6
+ logger.debug(colored("Loading zrb.runner", attrs=["dark"]))
4
7
  runner = Runner(env_prefix=env_prefix)
zrb/task/any_task.py CHANGED
@@ -1,5 +1,7 @@
1
1
  from abc import ABC, abstractmethod
2
2
 
3
+ from zrb.helper.accessories.color import colored
4
+ from zrb.helper.log import logger
3
5
  from zrb.helper.typing import (
4
6
  Any,
5
7
  Callable,
@@ -15,6 +17,8 @@ from zrb.task_env.env import Env
15
17
  from zrb.task_env.env_file import EnvFile
16
18
  from zrb.task_input.any_input import AnyInput
17
19
 
20
+ logger.debug(colored("Loading zrb.task.any_task", attrs=["dark"]))
21
+
18
22
  # flake8: noqa E501
19
23
  TAnyTask = TypeVar("TAnyTask", bound="AnyTask")
20
24
 
@@ -1,6 +1,10 @@
1
+ from zrb.helper.accessories.color import colored
2
+ from zrb.helper.log import logger
1
3
  from zrb.helper.typing import Any, Callable
2
4
  from zrb.task.any_task import AnyTask
3
5
 
6
+ logger.debug(colored("Loading zrb.task.any_task_event_handler", attrs=["dark"]))
7
+
4
8
  _TaskEventHandler = Callable[[AnyTask], Any]
5
9
  OnTriggered = _TaskEventHandler
6
10
  OnWaiting = _TaskEventHandler
@@ -2,6 +2,8 @@ import copy
2
2
  import os
3
3
  import pathlib
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
  from zrb.helper.typing import (
7
9
  Any,
@@ -31,6 +33,8 @@ from zrb.task_env.env_file import EnvFile
31
33
  from zrb.task_group.group import Group
32
34
  from zrb.task_input.any_input import AnyInput
33
35
 
36
+ logger.debug(colored("Loading zrb.task.base_remote_cmd_task", attrs=["dark"]))
37
+
34
38
  TSingleBaseRemoteCmdTask = TypeVar(
35
39
  "TSingleBaseRemoteCmdTask", bound="SingleBaseRemoteCmdTask"
36
40
  )
@@ -140,7 +140,7 @@ class BaseTask(FinishTracker, AttemptTracker, Renderer, BaseTaskModel, AnyTask):
140
140
  xcom_dir = self.__get_xcom_dir()
141
141
  xcom_file = os.path.join(xcom_dir, key)
142
142
  with open(xcom_file, "w") as f:
143
- f.write(value)
143
+ f.write(f"{value}")
144
144
 
145
145
  def get_xcom(self, key: str) -> str:
146
146
  self.__ensure_xcom_dir_exists()
zrb/task/checker.py CHANGED
@@ -1,5 +1,7 @@
1
1
  import asyncio
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, Callable, Iterable, Optional, Union
5
7
  from zrb.task.any_task import AnyTask
@@ -18,6 +20,8 @@ from zrb.task_env.env_file import EnvFile
18
20
  from zrb.task_group.group import Group
19
21
  from zrb.task_input.any_input import AnyInput
20
22
 
23
+ logger.debug(colored("Loading zrb.task.checker", attrs=["dark"]))
24
+
21
25
 
22
26
  @typechecked
23
27
  class Checker(BaseTask):
zrb/task/cmd_task.py CHANGED
@@ -8,7 +8,8 @@ import sys
8
8
  import time
9
9
 
10
10
  from zrb.config.config import default_shell
11
- from zrb.helper.string.conversion import to_variable_name
11
+ from zrb.helper.accessories.color import colored
12
+ from zrb.helper.log import logger
12
13
  from zrb.helper.typecheck import typechecked
13
14
  from zrb.helper.typing import (
14
15
  Any,
@@ -36,6 +37,8 @@ from zrb.task_env.env_file import EnvFile
36
37
  from zrb.task_group.group import Group
37
38
  from zrb.task_input.any_input import AnyInput
38
39
 
40
+ logger.debug(colored("Loading zrb.task.cmd_task", attrs=["dark"]))
41
+
39
42
  _has_stty = True
40
43
  try:
41
44
  _original_stty = subprocess.getoutput("stty -g").rstrip()
zrb/task/decorator.py CHANGED
@@ -1,4 +1,6 @@
1
1
  from zrb.action.runner import Runner
2
+ from zrb.helper.accessories.color import colored
3
+ from zrb.helper.log import logger
2
4
  from zrb.helper.typecheck import typechecked
3
5
  from zrb.helper.typing import Any, Callable, Iterable, Optional, Union
4
6
  from zrb.task.any_task import AnyTask
@@ -17,6 +19,8 @@ from zrb.task_env.env_file import EnvFile
17
19
  from zrb.task_group.group import Group
18
20
  from zrb.task_input.any_input import AnyInput
19
21
 
22
+ logger.debug(colored("Loading zrb.task.decorator", attrs=["dark"]))
23
+
20
24
  # flake8: noqa E501
21
25
 
22
26
 
@@ -2,9 +2,11 @@ import os
2
2
  import pathlib
3
3
 
4
4
  from zrb.config.config import container_backend
5
+ from zrb.helper.accessories.color import colored
5
6
  from zrb.helper.accessories.name import get_random_name
6
7
  from zrb.helper.docker_compose.fetch_external_env import fetch_compose_file_env_map
7
8
  from zrb.helper.docker_compose.file import read_compose_file, write_compose_file
9
+ from zrb.helper.log import logger
8
10
  from zrb.helper.string.conversion import to_cli_name
9
11
  from zrb.helper.string.modification import double_quote
10
12
  from zrb.helper.typecheck import typechecked
@@ -37,6 +39,8 @@ from zrb.task_env.env_file import EnvFile
37
39
  from zrb.task_group.group import Group
38
40
  from zrb.task_input.any_input import AnyInput
39
41
 
42
+ logger.debug(colored("Loading zrb.task.docker_compose_task", attrs=["dark"]))
43
+
40
44
 
41
45
  def _get_ensure_zrb_network_task(backend: str):
42
46
  CURRENT_DIR = os.path.dirname(__file__)
zrb/task/flow_task.py CHANGED
@@ -1,3 +1,5 @@
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 Callable, Iterable, List, Optional, TypeVar, Union
3
5
  from zrb.task.any_task import AnyTask
@@ -16,6 +18,8 @@ from zrb.task_env.env_file import EnvFile
16
18
  from zrb.task_group.group import Group
17
19
  from zrb.task_input.any_input import AnyInput
18
20
 
21
+ logger.debug(colored("Loading zrb.task.flow_task", attrs=["dark"]))
22
+
19
23
  TFlowTask = TypeVar("TFlowTask", bound="FlowTask")
20
24
 
21
25
 
zrb/task/http_checker.py CHANGED
@@ -1,5 +1,7 @@
1
1
  from http.client import HTTPConnection, HTTPSConnection
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 (
5
7
  Any,
@@ -26,6 +28,8 @@ from zrb.task_env.env_file import EnvFile
26
28
  from zrb.task_group.group import Group
27
29
  from zrb.task_input.any_input import AnyInput
28
30
 
31
+ logger.debug(colored("Loading zrb.task.http_checker", attrs=["dark"]))
32
+
29
33
  THTTPChecker = TypeVar("THTTPChecker", bound="HTTPChecker")
30
34
 
31
35
 
zrb/task/notifier.py CHANGED
@@ -1,7 +1,9 @@
1
1
  import os
2
2
  import subprocess
3
3
 
4
+ from zrb.helper.accessories.color import colored
4
5
  from zrb.helper.accessories.icon import get_random_icon
6
+ from zrb.helper.log import logger
5
7
  from zrb.helper.string.modification import double_quote
6
8
  from zrb.helper.typecheck import typechecked
7
9
  from zrb.helper.typing import Any, Callable, Iterable, JinjaTemplate, Optional, Union
@@ -21,6 +23,8 @@ from zrb.task_env.env_file import EnvFile
21
23
  from zrb.task_group.group import Group
22
24
  from zrb.task_input.any_input import AnyInput
23
25
 
26
+ logger.debug(colored("Loading zrb.task.notifier", attrs=["dark"]))
27
+
24
28
  _CURRENT_DIR = os.path.dirname(__file__)
25
29
  _NOTIFY_PS1_PATH = os.path.realpath(
26
30
  os.path.abspath(
zrb/task/parallel.py CHANGED
@@ -1,9 +1,13 @@
1
1
  from abc import ABC, abstractmethod
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 List, TypeVar, Union
5
7
  from zrb.task.any_task import AnyTask
6
8
 
9
+ logger.debug(colored("Loading zrb.task.parallel", attrs=["dark"]))
10
+
7
11
  TParallel = TypeVar("TParallel", bound="Parallel")
8
12
 
9
13
 
zrb/task/path_checker.py CHANGED
@@ -1,4 +1,6 @@
1
+ from zrb.helper.accessories.color import colored
1
2
  from zrb.helper.file.match import get_file_names
3
+ from zrb.helper.log import logger
2
4
  from zrb.helper.typecheck import typechecked
3
5
  from zrb.helper.typing import (
4
6
  Any,
@@ -26,6 +28,8 @@ from zrb.task_env.env_file import EnvFile
26
28
  from zrb.task_group.group import Group
27
29
  from zrb.task_input.any_input import AnyInput
28
30
 
31
+ logger.debug(colored("Loading zrb.task.path_checker", attrs=["dark"]))
32
+
29
33
  TPathChecker = TypeVar("TPathChecker", bound="PathChecker")
30
34
 
31
35
 
zrb/task/path_watcher.py CHANGED
@@ -1,6 +1,8 @@
1
1
  import os
2
2
 
3
+ from zrb.helper.accessories.color import colored
3
4
  from zrb.helper.file.match import get_file_names
5
+ from zrb.helper.log import logger
4
6
  from zrb.helper.typecheck import typechecked
5
7
  from zrb.helper.typing import (
6
8
  Any,
@@ -29,6 +31,8 @@ from zrb.task_env.env_file import EnvFile
29
31
  from zrb.task_group.group import Group
30
32
  from zrb.task_input.any_input import AnyInput
31
33
 
34
+ logger.debug(colored("Loading zrb.task.path_watcher", attrs=["dark"]))
35
+
32
36
  TPathWatcher = TypeVar("TPathWatcher", bound="PathWatcher")
33
37
 
34
38
 
zrb/task/port_checker.py CHANGED
@@ -1,5 +1,7 @@
1
1
  import socket
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 (
5
7
  Any,
@@ -26,6 +28,8 @@ from zrb.task_env.env_file import EnvFile
26
28
  from zrb.task_group.group import Group
27
29
  from zrb.task_input.any_input import AnyInput
28
30
 
31
+ logger.debug(colored("Loading zrb.task.port_checker", attrs=["dark"]))
32
+
29
33
  TPortChecker = TypeVar("TPortChecker", bound="PortChecker")
30
34
 
31
35
 
@@ -1,7 +1,9 @@
1
1
  import asyncio
2
2
  import copy
3
3
 
4
+ from zrb.helper.accessories.color import colored
4
5
  from zrb.helper.accessories.name import get_random_name
6
+ from zrb.helper.log import logger
5
7
  from zrb.helper.typecheck import typechecked
6
8
  from zrb.helper.typing import Any, Callable, Iterable, List, Mapping, Optional, Union
7
9
  from zrb.task.any_task import AnyTask
@@ -20,6 +22,8 @@ from zrb.task_env.env_file import EnvFile
20
22
  from zrb.task_group.group import Group
21
23
  from zrb.task_input.any_input import AnyInput
22
24
 
25
+ logger.debug(colored("Loading zrb.task.recurring_task", attrs=["dark"]))
26
+
23
27
 
24
28
  class RunConfig:
25
29
  def __init__(
@@ -111,6 +115,7 @@ class RecurringTask(BaseTask):
111
115
  self._triggers: List[AnyTask] = [trigger.copy() for trigger in triggers]
112
116
  self._run_configs: List[RunConfig] = []
113
117
  self._single_execution = single_execution
118
+ self.print_err("Deprecated, please use Server instead")
114
119
 
115
120
  async def _set_keyval(self, kwargs: Mapping[str, Any], env_prefix: str):
116
121
  await super()._set_keyval(kwargs=kwargs, env_prefix=env_prefix)
@@ -1,6 +1,8 @@
1
1
  import os
2
2
  import pathlib
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 Any, Callable, Iterable, Optional, Union
6
8
  from zrb.task.any_task import AnyTask
@@ -20,6 +22,8 @@ from zrb.task_env.env_file import EnvFile
20
22
  from zrb.task_group.group import Group
21
23
  from zrb.task_input.any_input import AnyInput
22
24
 
25
+ logger.debug(colored("Loading zrb.task.remote_cmd_task", attrs=["dark"]))
26
+
23
27
  _CURRENT_DIR = os.path.dirname(__file__)
24
28
  _SHELL_SCRIPT_DIR = os.path.join(_CURRENT_DIR, "..", "shell-scripts")
25
29
  with open(os.path.join(_SHELL_SCRIPT_DIR, "ssh-util.sh")) as file:
@@ -1,4 +1,6 @@
1
+ from zrb.helper.accessories.color import colored
1
2
  from zrb.helper.file.copy_tree import copy_tree
3
+ from zrb.helper.log import logger
2
4
  from zrb.helper.typecheck import typechecked
3
5
  from zrb.helper.typing import (
4
6
  Any,
@@ -35,6 +37,8 @@ from zrb.task_env.env_file import EnvFile
35
37
  from zrb.task_group.group import Group
36
38
  from zrb.task_input.any_input import AnyInput
37
39
 
40
+ logger.debug(colored("Loading zrb.task.resource_maker", attrs=["dark"]))
41
+
38
42
  Replacement = Mapping[str, JinjaTemplate]
39
43
  ReplacementMutator = Callable[[AnyTask, Replacement], Replacement]
40
44
  TResourceMaker = TypeVar("TResourceMaker", bound="ResourceMaker")
zrb/task/rsync_task.py CHANGED
@@ -1,6 +1,8 @@
1
1
  import os
2
2
  import pathlib
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 Any, Callable, Iterable, JinjaTemplate, Optional, Union
6
8
  from zrb.task.any_task import AnyTask
@@ -20,6 +22,8 @@ from zrb.task_env.env_file import EnvFile
20
22
  from zrb.task_group.group import Group
21
23
  from zrb.task_input.any_input import AnyInput
22
24
 
25
+ logger.debug(colored("Loading zrb.task.rsync_task", attrs=["dark"]))
26
+
23
27
  _CURRENT_DIR = os.path.dirname(__file__)
24
28
  _SHELL_SCRIPT_DIR = os.path.join(_CURRENT_DIR, "..", "shell-scripts")
25
29
  with open(os.path.join(_SHELL_SCRIPT_DIR, "rsync-util.sh")) as file: