zrb 0.6.1__py3-none-any.whl → 0.7.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 (62) hide show
  1. zrb/builtin/devtool/aws/install.sh +13 -19
  2. zrb/builtin/devtool/devtool_install.py +100 -31
  3. zrb/builtin/devtool/docker/install.sh +17 -27
  4. zrb/builtin/devtool/gcloud/install.sh +4 -14
  5. zrb/builtin/devtool/gvm/download.sh +6 -9
  6. zrb/builtin/devtool/helix/install.sh +24 -21
  7. zrb/builtin/devtool/pyenv/download.sh +12 -18
  8. zrb/builtin/devtool/selenium/install.sh +8 -13
  9. zrb/builtin/devtool/tmux/install.sh +11 -17
  10. zrb/builtin/devtool/zsh/install.sh +13 -19
  11. zrb/builtin/generator/common/task_input.py +76 -13
  12. zrb/builtin/generator/docker_compose_task/template/src/kebab-zrb-task-name/image/Dockerfile +4 -2
  13. zrb/builtin/generator/docker_compose_task/template/src/kebab-zrb-task-name/image/pyproject.toml +25 -0
  14. zrb/builtin/generator/fastapp/add.py +9 -0
  15. zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/cmd/activate-venv.sh +5 -0
  16. zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/cmd/app-prepare-backend.sh +1 -1
  17. zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/cmd/app-prepare-load-test.sh +1 -2
  18. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/loadtest/pyproject.toml +21 -0
  19. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/Dockerfile +4 -2
  20. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/pyproject.toml +44 -0
  21. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/start.sh +2 -2
  22. zrb/builtin/generator/pip_package/add.py +8 -4
  23. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/activate-venv.sh +5 -0
  24. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/build.sh +1 -1
  25. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/install-symlink.sh +1 -1
  26. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/prepare-venv.sh +1 -2
  27. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/publish.sh +1 -1
  28. zrb/builtin/generator/pip_package/template/src/kebab-zrb-package-name/pyproject.toml +22 -27
  29. zrb/builtin/generator/plugin/create.py +6 -3
  30. zrb/builtin/generator/plugin/template/_cmd/activate-venv.sh +6 -2
  31. zrb/builtin/generator/plugin/template/_cmd/build.sh +1 -1
  32. zrb/builtin/generator/plugin/template/_cmd/install-symlink.sh +1 -1
  33. zrb/builtin/generator/plugin/template/_cmd/prepare-venv.sh +1 -2
  34. zrb/builtin/generator/plugin/template/_cmd/publish.sh +1 -1
  35. zrb/builtin/generator/plugin/template/project.sh +24 -20
  36. zrb/builtin/generator/plugin/template/pyproject.toml +22 -29
  37. zrb/builtin/generator/plugin/template/src/snake_zrb_package_name/__main__.py +5 -0
  38. zrb/builtin/generator/project/create.py +13 -1
  39. zrb/builtin/generator/project/template/project.sh +24 -35
  40. zrb/builtin/generator/project/template/pyproject.toml +21 -0
  41. zrb/builtin/generator/simple_python_app/add.py +9 -0
  42. zrb/builtin/generator/simple_python_app/template/_automate/snake_zrb_app_name/cmd/app-activate-venv.sh +6 -1
  43. zrb/builtin/generator/simple_python_app/template/_automate/snake_zrb_app_name/cmd/app-start.sh +2 -2
  44. zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/Dockerfile +4 -2
  45. zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/pyproject.toml +27 -0
  46. zrb/shell-scripts/_common-util.sh +15 -3
  47. zrb/shell-scripts/ensure-docker-is-installed.sh +17 -17
  48. zrb/shell-scripts/ensure-rsync-is-installed.sh +10 -6
  49. zrb/shell-scripts/ensure-ssh-is-installed.sh +20 -12
  50. zrb/task/notifier.py +16 -0
  51. {zrb-0.6.1.dist-info → zrb-0.7.0.dist-info}/METADATA +26 -28
  52. {zrb-0.6.1.dist-info → zrb-0.7.0.dist-info}/RECORD +220 -222
  53. {zrb-0.6.1.dist-info → zrb-0.7.0.dist-info}/WHEEL +1 -1
  54. zrb/builtin/generator/docker_compose_task/template/src/kebab-zrb-task-name/image/requirements.txt +0 -1
  55. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/loadtest/requirements.txt +0 -1
  56. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/requirements.txt +0 -24
  57. zrb/builtin/generator/pip_package/template/src/kebab-zrb-package-name/requirements.txt +0 -4
  58. zrb/builtin/generator/plugin/template/requirements.txt +0 -4
  59. zrb/builtin/generator/project/template/requirements.txt +0 -1
  60. zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/requirements.txt +0 -1
  61. {zrb-0.6.1.dist-info → zrb-0.7.0.dist-info}/LICENSE +0 -0
  62. {zrb-0.6.1.dist-info → zrb-0.7.0.dist-info}/entry_points.txt +0 -0
@@ -1,40 +1,43 @@
1
1
  #!/bin/bash
2
2
 
3
- PROJECT_DIR=$(pwd)
4
- echo "🤖 Set project directory to ${PROJECT_DIR}"
3
+ log_progress() {
4
+ echo -e "🤖 \e[0;33m${1}\e[0;0m"
5
+ }
6
+
5
7
 
8
+ init() {
9
+ export PROJECT_DIR=$(pwd)
10
+ log_progress "Setting project directory to ${PROJECT_DIR}"
6
11
 
7
- if [ -z "$PROJECT_USE_VENV" ] || [ "$PROJECT_USE_VENV" = 1 ]
8
- then
9
- if [ ! -d .venv ]
12
+ _IS_EMPTY_VENV=0
13
+ if [ ! -d "${PROJECT_DIR}/.venv" ]
10
14
  then
11
- echo '🤖 Create virtual environment'
15
+ log_progress 'Creating virtual environment'
12
16
  python -m venv "${PROJECT_DIR}/.venv"
13
- echo '🤖 Activate virtual environment'
14
17
  source "${PROJECT_DIR}/.venv/bin/activate"
18
+ pip install --upgrade pip
19
+ pip install "poetry==1.7.1"
20
+ _IS_EMPTY_VENV=1
15
21
  fi
16
22
 
17
- echo '🤖 Activate virtual environment'
23
+ log_progress 'Activating virtual environment'
18
24
  source "${PROJECT_DIR}/.venv/bin/activate"
19
- fi
25
+ }
26
+
20
27
 
21
28
  reload() {
22
29
 
23
30
  if [ ! -f "${PROJECT_DIR}/.env" ]
24
31
  then
25
- echo '🤖 Create project configuration (.env)'
32
+ log_progress 'Creating project configuration (.env)'
26
33
  cp "${PROJECT_DIR}/template.env" "${PROJECT_DIR}/.env"
27
34
  fi
28
35
 
29
- echo '🤖 Load project configuration (.env)'
36
+ log_progress 'Loading project configuration (.env)'
30
37
  source "${PROJECT_DIR}/.env"
31
38
 
32
- if [ -z "$PROJECT_AUTO_INSTALL_PIP" ] || [ "$PROJECT_AUTO_INSTALL_PIP" = 1 ]
33
- then
34
- echo '🤖 Install requirements'
35
- pip install --upgrade pip
36
- pip install -r "${PROJECT_DIR}/requirements.txt"
37
- fi
39
+ log_progress 'Install'
40
+ poetry install
38
41
 
39
42
  _CURRENT_SHELL=$(ps -p $$ | awk 'NR==2 {print $4}')
40
43
  case "$_CURRENT_SHELL" in
@@ -47,12 +50,13 @@ reload() {
47
50
  esac
48
51
  if [ "$_CURRENT_SHELL" = "zsh" ] || [ "$_CURRENT_SHELL" = "bash" ]
49
52
  then
50
- echo "🤖 Set up shell completion for $_CURRENT_SHELL"
53
+ log_progress "Setting up shell completion for $_CURRENT_SHELL"
51
54
  eval "$(_ZRB_COMPLETE=${_CURRENT_SHELL}_source zrb)"
52
55
  else
53
- echo "🤖 Cannot set up shell completion for $_CURRENT_SHELL"
56
+ log_progress "Cannot set up shell completion for $_CURRENT_SHELL"
54
57
  fi
55
58
  }
56
59
 
60
+ init
57
61
  reload
58
- echo '🤖 Happy Coding :)'
62
+ log_progress 'Happy Coding :)'
@@ -1,38 +1,31 @@
1
- [build-system]
2
- requires = ["flit_core>=3.4"]
3
- build-backend = "flit_core.buildapi"
4
-
5
- [project]
1
+ [tool.poetry]
6
2
  name = "kebab-zrb-package-name"
7
3
  version = "0.0.1"
8
- authors = [
9
- { name="zrbPackageAuthorName", email="zrbPackageAuthorEmail" },
10
- ]
11
4
  description = "zrbPackageDescription"
5
+ authors = ["zrbPackageAuthorName <zrbPackageAuthorEmail>"]
6
+ license = "AGPL-3.0-or-later"
12
7
  readme = "README.md"
13
- requires-python = ">=3.8"
14
- classifiers = [
15
- "Programming Language :: Python :: 3",
16
- "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
17
- "Operating System :: OS Independent",
18
- ]
19
- dependencies = [
20
- "zrb>=zrbVersion"
21
- ]
22
-
8
+ homepage = "zrbPackageHomepage"
9
+ repository = "zrbPackageRepository"
10
+ documentation = "zrbPackageDocumentation"
11
+ keywords = []
23
12
 
24
- [project.optional-dependencies]
25
- dev = []
26
- test = []
13
+ [tool.poetry.dependencies]
14
+ python = ">=3.10.0,<4.0.0"
15
+ zrb = ">=zrbVersion"
27
16
 
28
- [project.urls]
29
- "Homepage" = "zrbPackageHomepage"
30
- "Bug Tracker" = "zrbPackageBugTracker"
17
+ [tool.poetry.dev-dependencies]
18
+ flake8 = "~6.0.0"
19
+ black = "~23.12.1"
20
+ isort = "~5.13.2"
21
+ pytest = "~7.4.0"
22
+ pytest-cov = "~4.1.0"
23
+ pytest-asyncio = "~0.21.0"
24
+ flameprof = "~0.4"
31
25
 
32
- [project.scripts]
26
+ [tool.poetry.scripts]
33
27
  kebab-zrb-package-name = "snake_zrb_package_name.__main__:main"
34
28
 
35
- [tool.pytest.ini_options]
36
- pythonpath = [
37
- "src"
38
- ]
29
+ [build-system]
30
+ requires = ["poetry-core>=1.0.0"]
31
+ build-backend = "poetry.core.masonry.api"
@@ -1,3 +1,8 @@
1
1
  from .task.example_task import ExampleTask
2
2
 
3
3
  assert ExampleTask
4
+
5
+
6
+ def main():
7
+ fn = ExampleTask.to_function()
8
+ fn()
@@ -1,6 +1,9 @@
1
1
  import os
2
2
 
3
3
  from zrb.builtin.generator.common.task_input import (
4
+ project_author_email_input,
5
+ project_author_name_input,
6
+ project_description_input,
4
7
  project_dir_input,
5
8
  project_name_input,
6
9
  )
@@ -55,11 +58,20 @@ async def validate(*args: Any, **kwargs: Any):
55
58
 
56
59
  copy_resource = ResourceMaker(
57
60
  name="copy-resource",
58
- inputs=[project_dir_input, project_name_input],
61
+ inputs=[
62
+ project_dir_input,
63
+ project_name_input,
64
+ project_description_input,
65
+ project_author_name_input,
66
+ project_author_email_input,
67
+ ],
59
68
  upstreams=[validate],
60
69
  replacements={
61
70
  "zrbProjectDir": "{{input.project_dir}}",
62
71
  "zrbProjectName": "{{input.project_name}}",
72
+ "zrbProjectDescription": "{{input.project_description}}",
73
+ "zrbProjectAuthorName": "{{input.project_author_name}}",
74
+ "zrbProjectAuthorEmail": "{{input.project_author_email}}",
63
75
  "zrbImageDefaultNamespace": IMAGE_DEFAULT_NAMESPACE,
64
76
  "zrbVersion": version,
65
77
  },
@@ -1,55 +1,43 @@
1
1
  #!/bin/bash
2
2
 
3
- PROJECT_DIR=$(pwd)
4
- echo "🤖 Set project directory to ${PROJECT_DIR}"
3
+ log_progress() {
4
+ echo -e "🤖 \e[0;33m${1}\e[0;0m"
5
+ }
6
+
5
7
 
8
+ init() {
9
+ export PROJECT_DIR=$(pwd)
10
+ log_progress "Setting project directory to ${PROJECT_DIR}"
6
11
 
7
- _IS_EMPTY_VENV=0
8
- if [ -z "$PROJECT_USE_VENV" ] || [ "$PROJECT_USE_VENV" = 1 ]
9
- then
10
- if [ ! -d .venv ]
12
+ _IS_EMPTY_VENV=0
13
+ if [ ! -d "${PROJECT_DIR}/.venv" ]
11
14
  then
12
- echo '🤖 Create virtual environment'
15
+ log_progress 'Creating virtual environment'
13
16
  python -m venv "${PROJECT_DIR}/.venv"
17
+ source "${PROJECT_DIR}/.venv/bin/activate"
18
+ pip install --upgrade pip
19
+ pip install "poetry==1.7.1"
14
20
  _IS_EMPTY_VENV=1
15
21
  fi
16
- echo '🤖 Activate virtual environment'
17
- source "${PROJECT_DIR}/.venv/bin/activate"
18
- fi
19
22
 
20
- install_requirements() {
21
- echo '🤖 Install requirements'
22
- pip install --upgrade pip
23
- pip install -r "${PROJECT_DIR}/requirements.txt"
23
+ log_progress 'Activating virtual environment'
24
+ source "${PROJECT_DIR}/.venv/bin/activate"
24
25
  }
25
26
 
27
+
26
28
  reload() {
27
29
 
28
30
  if [ ! -f "${PROJECT_DIR}/.env" ]
29
31
  then
30
- echo '🤖 Create project configuration (.env)'
32
+ log_progress 'Creating project configuration (.env)'
31
33
  cp "${PROJECT_DIR}/template.env" "${PROJECT_DIR}/.env"
32
34
  fi
33
35
 
34
- echo '🤖 Load project configuration (.env)'
36
+ log_progress 'Loading project configuration (.env)'
35
37
  source "${PROJECT_DIR}/.env"
36
38
 
37
- if [ -z "$PROJECT_AUTO_INSTALL_PIP" ] || [ "$PROJECT_AUTO_INSTALL_PIP" = 1 ]
38
- then
39
- if [ "$_IS_EMPTY_VENV" = 1 ]
40
- then
41
- install_requirements
42
- _IS_EMPTY_VENV=0
43
- else
44
- echo '🤖 Checking .venv and requirements.txt timestamp'
45
- _VENV_TIMESTAMP=$(find .venv -type d -exec stat -c %Y {} \; | sort -n | tail -n 1)
46
- _REQUIREMENTS_TIMESTAMP=$(stat -c %Y requirements.txt)
47
- if [ "$_VENV_TIMESTAMP" -lt "$_REQUIREMENTS_TIMESTAMP" ]
48
- then
49
- install_requirements
50
- fi
51
- fi
52
- fi
39
+ log_progress 'Install'
40
+ poetry install
53
41
 
54
42
  _CURRENT_SHELL=$(ps -p $$ | awk 'NR==2 {print $4}')
55
43
  case "$_CURRENT_SHELL" in
@@ -62,12 +50,13 @@ reload() {
62
50
  esac
63
51
  if [ "$_CURRENT_SHELL" = "zsh" ] || [ "$_CURRENT_SHELL" = "bash" ]
64
52
  then
65
- echo "🤖 Set up shell completion for $_CURRENT_SHELL"
53
+ log_progress "Setting up shell completion for $_CURRENT_SHELL"
66
54
  eval "$(_ZRB_COMPLETE=${_CURRENT_SHELL}_source zrb)"
67
55
  else
68
- echo "🤖 Cannot set up shell completion for $_CURRENT_SHELL"
56
+ log_progress "Cannot set up shell completion for $_CURRENT_SHELL"
69
57
  fi
70
58
  }
71
59
 
60
+ init
72
61
  reload
73
- echo '🤖 Happy Coding :)'
62
+ log_progress 'Happy Coding :)'
@@ -0,0 +1,21 @@
1
+ [tool.poetry]
2
+ name = "kebab-zrb-project-name"
3
+ version = "0.0.1"
4
+ description = "zrbProjectDescription"
5
+ authors = ["zrbProjectAuthorName <zrbProjectAuthorEmail>"]
6
+ keywords = []
7
+ packages = [
8
+ {include = "kebab-zrb-project-name", from = ".."},
9
+ ]
10
+
11
+ [tool.poetry.dependencies]
12
+ python = ">=3.10.0,<4.0.0"
13
+ zrb = ">=zrbVersion"
14
+
15
+ [tool.poetry.dev-dependencies]
16
+
17
+ [tool.poetry.scripts]
18
+
19
+ [build-system]
20
+ requires = ["poetry-core>=1.0.0"]
21
+ build-backend = "poetry.core.masonry.api"
@@ -6,6 +6,9 @@ from zrb.builtin.generator.common.helper import (
6
6
  )
7
7
  from zrb.builtin.generator.common.task_factory import create_register_module
8
8
  from zrb.builtin.generator.common.task_input import (
9
+ app_author_email_input,
10
+ app_author_name_input,
11
+ app_description_input,
9
12
  app_image_name_input,
10
13
  app_name_input,
11
14
  env_prefix_input,
@@ -58,6 +61,9 @@ copy_resource = ResourceMaker(
58
61
  inputs=[
59
62
  project_dir_input,
60
63
  app_name_input,
64
+ app_description_input,
65
+ app_author_name_input,
66
+ app_author_email_input,
61
67
  app_image_name_input,
62
68
  http_port_input,
63
69
  env_prefix_input,
@@ -65,6 +71,9 @@ copy_resource = ResourceMaker(
65
71
  upstreams=[validate],
66
72
  replacements={
67
73
  "zrbAppName": "{{input.app_name}}",
74
+ "zrbAppDescription": "{{input.app_description}}",
75
+ "zrbAppAuthorName": "{{input.app_author_name}}",
76
+ "zrbAppAuthorEmail": "{{input.app_author_email}}",
68
77
  "zrbAppHttpPort": '{{util.coalesce(input.http_port, "3000")}}',
69
78
  "ZRB_ENV_PREFIX": '{{util.coalesce(input.env_prefix, "MY").upper()}}',
70
79
  "zrb-app-image-name": "{{input.app_image_name}}",
@@ -2,6 +2,11 @@ if [ ! -d .venv ]
2
2
  then
3
3
  echo "Init virtual environment"
4
4
  python -m venv .venv
5
+ source .venv/bin/activate
6
+ echo "Upgrade Pip"
7
+ pip install -U pip
8
+ echo "Install Poetry"
9
+ pip install "poetry==1.7.1"
5
10
  fi
6
11
  echo "Activate virtual environment"
7
- source .venv/bin/activate
12
+ source .venv/bin/activate
@@ -1,6 +1,6 @@
1
1
  PYTHONUNBUFFERED=1
2
2
  echo "Install packages"
3
- pip install -r requirements.txt
3
+ poetry install --no-root
4
4
 
5
5
  echo "Start app"
6
- uvicorn main:app --host {{env.get("APP_HOST", "0.0.0.0")}} --port {{env.get("APP_PORT", "8080")}}
6
+ poetry run uvicorn main:app --host {{env.get("APP_HOST", "0.0.0.0")}} --port {{env.get("APP_PORT", "8080")}}
@@ -2,6 +2,8 @@ FROM python:3.10-slim
2
2
  ENV APP_MESSAGE "Hello, world!"
3
3
  ENV APP_PORT 8080
4
4
  WORKDIR /home
5
+ COPY ./pyproject.toml ./pyproject.toml
6
+ RUN pip install "poetry==1.7.1"
7
+ RUN poetry install --only main --no-root
5
8
  COPY . .
6
- RUN pip install -r requirements.txt
7
- CMD uvicorn main:app --host "0.0.0.0" --port "$APP_PORT"
9
+ CMD poetry run uvicorn main:app --host "0.0.0.0" --port "$APP_PORT"
@@ -0,0 +1,27 @@
1
+ [tool.poetry]
2
+ name = "kebab-zrb-app-name"
3
+ version = "0.0.1"
4
+ description = "zrbAppDescription"
5
+ authors = ["zrbAppAuthorName <zrbAppAuthorEmail>"]
6
+ keywords = []
7
+ packages = [
8
+ {include = "kebab-zrb-project-name", from = ".."},
9
+ ]
10
+
11
+ [tool.poetry.dependencies]
12
+ python = ">=3.10.0,<4.0.0"
13
+ uvicorn = "==0.20.0"
14
+
15
+ [tool.poetry.dev-dependencies]
16
+ flake8 = "~6.0.0"
17
+ black = "~23.12.1"
18
+ isort = "~5.13.2"
19
+ pytest = "~7.4.0"
20
+ pytest-cov = "~4.1.0"
21
+ pytest-asyncio = "~0.21.0"
22
+ flameprof = "~0.4"
23
+
24
+ [build-system]
25
+ requires = ["poetry-core>=1.0.0"]
26
+ build-backend = "poetry.core.masonry.api"
27
+
@@ -1,7 +1,19 @@
1
1
  set -e
2
- # Determine OS type
3
2
  OS_TYPE=$(uname)
4
- # Function to check if a command exists
3
+
5
4
  command_exists() {
6
5
  command -v "$1" &> /dev/null
7
- }
6
+ }
7
+
8
+ try_sudo() {
9
+ if command_exists sudo
10
+ then
11
+ sudo $@
12
+ else
13
+ $@
14
+ fi
15
+ }
16
+
17
+ log_progress() {
18
+ echo -e "🤖 \e[0;33m${1}\e[0;0m"
19
+ }
@@ -18,29 +18,29 @@ else
18
18
  then
19
19
  if command_exists apt
20
20
  then
21
- sudo apt update
22
- sudo apt-get remove docker docker-engine docker.io containerd runc || true
23
- sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
24
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
25
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
26
- echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
27
- sudo apt update
28
- sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
21
+ try_sudo apt update
22
+ try_sudo apt-get remove docker docker-engine docker.io containerd runc || true
23
+ try_sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
24
+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg |try_sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
25
+ try_sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
26
+ echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |try_sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
27
+ try_sudo apt update
28
+ try_sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
29
29
  elif command_exists yum
30
30
  then
31
- sudo yum install -y docker
32
- sudo systemctl start docker
33
- sudo systemctl enable docker
31
+ try_sudo yum install -y docker
32
+ try_sudo systemctl start docker
33
+ try_sudo systemctl enable docker
34
34
  elif command_exists dnf
35
35
  then
36
- sudo dnf install -y docker
37
- sudo systemctl start docker
38
- sudo systemctl enable docker
36
+ try_sudo dnf install -y docker
37
+ try_sudo systemctl start docker
38
+ try_sudo systemctl enable docker
39
39
  elif command_exists pacman
40
40
  then
41
- sudo pacman -Syu --noconfirm docker
42
- sudo systemctl start docker
43
- sudo systemctl enable docker
41
+ try_sudo pacman -Syu --noconfirm docker
42
+ try_sudo systemctl start docker
43
+ try_sudo systemctl enable docker
44
44
  else
45
45
  echo "No known package manager found. Please install Docker manually."
46
46
  exit 1
@@ -15,19 +15,23 @@ else
15
15
  fi
16
16
  elif [ "$OS_TYPE" = "Linux" ]
17
17
  then
18
- if command_exists apt
18
+ if command_exists pkg
19
19
  then
20
- sudo apt update
21
- sudo apt install -y rsync
20
+ try_sudo pkg update
21
+ try_sudo pkg install -y rsync
22
+ elif command_exists apt
23
+ then
24
+ try_sudo apt update
25
+ try_sudo apt install -y rsync
22
26
  elif command_exists yum
23
27
  then
24
- sudo yum install -y rsync
28
+ try_sudo yum install -y rsync
25
29
  elif command_exists dnf
26
30
  then
27
- sudo dnf install -y rsync
31
+ try_sudo dnf install -y rsync
28
32
  elif command_exists pacman
29
33
  then
30
- sudo pacman -Syu --noconfirm rsync
34
+ try_sudo pacman -Syu --noconfirm rsync
31
35
  else
32
36
  echo "No known package manager found. Please install Rsync manually."
33
37
  exit 1
@@ -15,19 +15,23 @@ else
15
15
  fi
16
16
  elif [ "$OS_TYPE" = "Linux" ]
17
17
  then
18
- if command_exists apt
18
+ if command_exists pkg
19
19
  then
20
- sudo apt update
21
- sudo apt install -y openssh-client
20
+ try_sudo pkg update
21
+ try_sudo pkg install -y openssh
22
+ elif command_exists apt
23
+ then
24
+ try_sudo apt update
25
+ try_sudo apt install -y openssh-client
22
26
  elif command_exists yum
23
27
  then
24
- sudo yum install -y openssh-clients
28
+ try_sudo yum install -y openssh-clients
25
29
  elif command_exists dnf
26
30
  then
27
- sudo dnf install -y openssh-clients
31
+ try_sudo dnf install -y openssh-clients
28
32
  elif command_exists pacman
29
33
  then
30
- sudo pacman -Syu --noconfirm openssh
34
+ try_sudo pacman -Syu --noconfirm openssh
31
35
  else
32
36
  echo "No known package manager found. Please install SSH manually."
33
37
  exit 1
@@ -54,19 +58,23 @@ else
54
58
  fi
55
59
  elif [ "$OS_TYPE" = "Linux" ]
56
60
  then
57
- if command_exists apt
61
+ if command_exists pkg
62
+ then
63
+ try_sudo pkg update
64
+ try_sudo pkg install -y sshpass
65
+ elif command_exists apt
58
66
  then
59
- sudo apt update
60
- sudo apt install -y sshpass
67
+ try_sudo apt update
68
+ try_sudo apt install -y sshpass
61
69
  elif command_exists yum
62
70
  then
63
- sudo yum install -y sshpass
71
+ try_sudo yum install -y sshpass
64
72
  elif command_exists dnf
65
73
  then
66
- sudo dnf install -y sshpass
74
+ try_sudo dnf install -y sshpass
67
75
  elif command_exists pacman
68
76
  then
69
- sudo pacman -Syu --noconfirm sshpass
77
+ try_sudo pacman -Syu --noconfirm sshpass
70
78
  else
71
79
  echo "No known package manager found. Please install SSHPass manually."
72
80
  exit 1
zrb/task/notifier.py CHANGED
@@ -124,6 +124,9 @@ class Notifier(BaseTask):
124
124
  if self._show_toast and _is_notify_send_available():
125
125
  cmd = ["notify-send", title, message]
126
126
  subprocess.run(cmd, stdout=subprocess.DEVNULL)
127
+ if self._show_toast and _is_termux_notification_available():
128
+ cmd = ["termux-notification", "-t", title, "-c", message, "--sound"]
129
+ subprocess.run(cmd, stdout=subprocess.DEVNULL)
127
130
  if self._show_stdout:
128
131
  task.print_out(message)
129
132
  task._play_bell()
@@ -142,6 +145,19 @@ def _is_powershell_available():
142
145
  return False
143
146
 
144
147
 
148
+ def _is_termux_notification_available():
149
+ try:
150
+ subprocess.run(
151
+ ["termux-notification", "--help"],
152
+ check=True,
153
+ stdout=subprocess.DEVNULL,
154
+ stderr=subprocess.DEVNULL,
155
+ )
156
+ return True
157
+ except (subprocess.CalledProcessError, FileNotFoundError, PermissionError):
158
+ return False
159
+
160
+
145
161
  def _is_notify_send_available():
146
162
  try:
147
163
  subprocess.run(
@@ -1,35 +1,33 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zrb
3
- Version: 0.6.1
3
+ Version: 0.7.0
4
4
  Summary: A Framework to Enhance Your Workflow
5
- Author-email: Go Frendi Gunawan <gofrendiasgard@gmail.com>
6
- Requires-Python: >=3.10.0
7
- Description-Content-Type: text/markdown
8
- Classifier: Programming Language :: Python :: 3
5
+ Home-page: https://github.com/state-alchemists/zrb
6
+ License: AGPL-3.0-or-later
7
+ Keywords: Automation,Task Runner,Code Generator,Low Code
8
+ Author: Go Frendi Gunawan
9
+ Author-email: gofrendiasgard@gmail.com
10
+ Requires-Python: >=3.10.0,<4.0.0
9
11
  Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
10
- Classifier: Operating System :: OS Independent
11
- Requires-Dist: click ~= 8.1.4
12
- Requires-Dist: aiofiles ~= 23.1.0
13
- Requires-Dist: beartype ~= 0.15.0
14
- Requires-Dist: termcolor ~= 2.3.0
15
- Requires-Dist: Jinja2 ~= 3.1.2
16
- Requires-Dist: libcst ~= 0.4.9
17
- Requires-Dist: python-dotenv ~= 1.0.0
18
- Requires-Dist: jsons ~= 1.6.3
19
- Requires-Dist: ruamel.yaml ~= 0.17.32
20
- Requires-Dist: setuptools ~= 68.0.0
21
- Requires-Dist: autopep8 ~= 2.0.2
22
- Requires-Dist: croniter ~= 2.0.1
23
- Requires-Dist: flake8 ~= 6.0.0 ; extra == "dev"
24
- Requires-Dist: black~=23.12.1 ; extra == "dev"
25
- Requires-Dist: isort~=5.13.2 ; extra == "dev"
26
- Requires-Dist: pytest ~= 7.4.0 ; extra == "dev"
27
- Requires-Dist: pytest-cov ~= 4.1.0 ; extra == "dev"
28
- Requires-Dist: pytest-asyncio ~= 0.21.0 ; extra == "dev"
29
- Requires-Dist: flameprof ~= 0.4 ; extra == "dev"
30
- Project-URL: Bug Tracker, https://github.com/state-alchemists/zrb/issues
31
- Project-URL: Homepage, https://github.com/state-alchemists/zrb
32
- Provides-Extra: dev
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Dist: Jinja2 (>=3.1.2,<3.2.0)
17
+ Requires-Dist: aiofiles (>=23.1.0,<23.2.0)
18
+ Requires-Dist: autopep8 (>=2.0.2,<2.1.0)
19
+ Requires-Dist: beartype (>=0.15.0,<0.16.0)
20
+ Requires-Dist: click (>=8.1.4,<8.2.0)
21
+ Requires-Dist: croniter (>=2.0.1,<2.1.0)
22
+ Requires-Dist: jsons (>=1.6.3,<1.7.0)
23
+ Requires-Dist: libcst (>=0.4.9,<0.5.0)
24
+ Requires-Dist: python-dotenv (>=1.0.0,<1.1.0)
25
+ Requires-Dist: ruamel.yaml (>=0.17.32,<0.18.0)
26
+ Requires-Dist: setuptools (>=68.0.0,<68.1.0)
27
+ Requires-Dist: termcolor (>=2.3.0,<2.4.0)
28
+ Project-URL: Documentation, https://github.com/state-alchemists/zrb
29
+ Project-URL: Repository, https://github.com/state-alchemists/zrb
30
+ Description-Content-Type: text/markdown
33
31
 
34
32
  ![](https://raw.githubusercontent.com/state-alchemists/zrb/main/_images/zrb/android-chrome-192x192.png)
35
33