zrb 0.7.3__py3-none-any.whl → 0.8.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.
zrb/builtin/__init__.py CHANGED
@@ -1,6 +1,7 @@
1
1
  from zrb.builtin import (
2
2
  base64,
3
3
  devtool,
4
+ docker,
4
5
  env,
5
6
  eval,
6
7
  explain,
@@ -18,18 +19,19 @@ from zrb.builtin import (
18
19
  )
19
20
 
20
21
  assert base64
22
+ assert devtool
23
+ assert docker
21
24
  assert env
22
25
  assert eval
26
+ assert explain
27
+ assert generator
23
28
  assert git
24
29
  assert md5
25
- assert explain
30
+ assert process
26
31
  assert project
27
32
  assert ubuntu
28
33
  assert update
29
- assert version
30
- assert devtool
31
- assert generator
32
- assert process
33
34
  assert say
34
- assert watch_changes
35
35
  assert schedule
36
+ assert version
37
+ assert watch_changes
zrb/builtin/docker.py ADDED
@@ -0,0 +1,20 @@
1
+ from zrb.builtin.group import docker_group
2
+ from zrb.runner import runner
3
+ from zrb.task.cmd_task import CmdTask
4
+
5
+ ###############################################################################
6
+ # Task Definitions
7
+ ###############################################################################
8
+
9
+ prune = CmdTask(
10
+ name="prune",
11
+ group=docker_group,
12
+ description="Prune unused images and volumes",
13
+ cmd=[
14
+ "docker system prune -af",
15
+ "docker image prune -af",
16
+ "docker system prune -af --volumes",
17
+ "docker system df",
18
+ ],
19
+ )
20
+ runner.register(prune)
@@ -1,5 +1,13 @@
1
1
  #!/bin/bash
2
2
 
3
+ if [ -n "$PREFIX" ] && [ "$PREFIX" = "/data/data/com.termux/files/usr" ]
4
+ then
5
+ IS_TERMUX=1
6
+ else
7
+ IS_TERMUX=0
8
+ fi
9
+
10
+
3
11
  log_progress() {
4
12
  echo -e "🤖 \e[0;33m${1}\e[0;0m"
5
13
  }
@@ -17,7 +25,7 @@ init() {
17
25
  then
18
26
  log_progress 'Install poetry'
19
27
  pip install --upgrade pip setuptools
20
- pip install "poetry==1.7.1"
28
+ pip install "poetry"
21
29
  fi
22
30
  if [ ! -d "${PROJECT_DIR}/.venv" ]
23
31
  then
@@ -40,9 +48,22 @@ reload() {
40
48
  log_progress 'Loading project configuration (.env)'
41
49
  source "${PROJECT_DIR}/.env"
42
50
 
51
+ if [ "$IS_TERMUX" = "1" ]
52
+ then
53
+ log_progress 'Updating Build Flags'
54
+ _OLD_CFLAGS="$CFLAGS"
55
+ export CFLAGS="$_OLD_CFLAGS -Wno-incompatible-function-pointer-types" # ruamel.yaml need this.
56
+ fi
57
+
43
58
  log_progress 'Install'
44
59
  poetry install
45
60
 
61
+ if [ "$IS_TERMUX" = "1" ]
62
+ then
63
+ log_progress 'Restoring Build Flags'
64
+ export CFLAGS="$_OLD_CFLAGS"
65
+ fi
66
+
46
67
  _CURRENT_SHELL=$(ps -p $$ | awk 'NR==2 {print $4}')
47
68
  case "$_CURRENT_SHELL" in
48
69
  *zsh)
@@ -1,5 +1,13 @@
1
1
  #!/bin/bash
2
2
 
3
+ if [ -n "$PREFIX" ] && [ "$PREFIX" = "/data/data/com.termux/files/usr" ]
4
+ then
5
+ IS_TERMUX=1
6
+ else
7
+ IS_TERMUX=0
8
+ fi
9
+
10
+
3
11
  log_progress() {
4
12
  echo -e "🤖 \e[0;33m${1}\e[0;0m"
5
13
  }
@@ -17,7 +25,7 @@ init() {
17
25
  then
18
26
  log_progress 'Install poetry'
19
27
  pip install --upgrade pip setuptools
20
- pip install "poetry==1.7.1"
28
+ pip install "poetry"
21
29
  fi
22
30
  if [ ! -d "${PROJECT_DIR}/.venv" ]
23
31
  then
@@ -40,9 +48,22 @@ reload() {
40
48
  log_progress 'Loading project configuration (.env)'
41
49
  source "${PROJECT_DIR}/.env"
42
50
 
51
+ if [ "$IS_TERMUX" = "1" ]
52
+ then
53
+ log_progress 'Updating Build Flags'
54
+ _OLD_CFLAGS="$CFLAGS"
55
+ export CFLAGS="$_OLD_CFLAGS -Wno-incompatible-function-pointer-types" # ruamel.yaml need this.
56
+ fi
57
+
43
58
  log_progress 'Install'
44
59
  poetry install
45
60
 
61
+ if [ "$IS_TERMUX" = "1" ]
62
+ then
63
+ log_progress 'Restoring Build Flags'
64
+ export CFLAGS="$_OLD_CFLAGS"
65
+ fi
66
+
46
67
  _CURRENT_SHELL=$(ps -p $$ | awk 'NR==2 {print $4}')
47
68
  case "$_CURRENT_SHELL" in
48
69
  *zsh)
zrb/builtin/git.py CHANGED
@@ -20,7 +20,7 @@ clear_branch = CmdTask(
20
20
  cmd=[
21
21
  "for BRANCH in $(git branch)",
22
22
  "do",
23
- ' if [ "$BRANCH" != "main" ]',
23
+ ' if [ "$BRANCH" != "main" ] && [ "$BRANCH" != "*" ]',
24
24
  " then",
25
25
  " git branch -D $BRANCH",
26
26
  " fi",
zrb/builtin/group.py CHANGED
@@ -17,5 +17,6 @@ dev_tool_install_group = Group(
17
17
  name="install", description="Install developer tools", parent=dev_tool_group
18
18
  )
19
19
  git_group = Group(name="git", description="Git related commands")
20
+ docker_group = Group(name="docker", description="Docker related commands")
20
21
  process_group = Group(name="process", description="Process related commands")
21
22
  plugin_group = Group(name="plugin", description="Plugin related command")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zrb
3
- Version: 0.7.3
3
+ Version: 0.8.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
@@ -3,7 +3,7 @@ zrb/__main__.py,sha256=dL2dVMkIZVBTcPuztE-WAbgKYsRPDMBp-IZtdgGYYf0,412
3
3
  zrb/action/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  zrb/action/runner.py,sha256=rjJvfcMwpcCIx6rrZLiXDwpnBi_yz6K0OKZ76SGqXSE,5092
5
5
  zrb/advertisement.py,sha256=qL-2EauUG8B6wxvZDIBchBfogYtXLJvWt_iw_IbYeO4,548
6
- zrb/builtin/__init__.py,sha256=NcBtDNQyUbJ-m6F8szPoBfk8Kmw7vd7keTxeRCFApis,451
6
+ zrb/builtin/__init__.py,sha256=W6InzR85JLPkja-cCFqgsk93GXcvKYnYQnPhEKo-g0M,477
7
7
  zrb/builtin/base64.py,sha256=LtKgDoZzrzf_yWpBU8Xic3az6qXEkgS50gIleSelrV4,1335
8
8
  zrb/builtin/devtool/__init__.py,sha256=PNpOlo6DiaMYfOXXVG3z9T2UyBshbVYFrYJsufBWCZ8,613
9
9
  zrb/builtin/devtool/aws/install.sh,sha256=K6VfNvTI5gfPfNA-oKqMqmP6uJ27WdLqASkDAkElYcA,1613
@@ -37,6 +37,7 @@ zrb/builtin/devtool/tmux/install.sh,sha256=-H-VIipUKLJJGk55Ml0c642G60Iq1DtXj8EQU
37
37
  zrb/builtin/devtool/tmux/resource/config.sh,sha256=wQCb4Q-mNkxIPOcvpN84X9RUWkGY16u3Vd-pOhVidgg,416
38
38
  zrb/builtin/devtool/zsh/install.sh,sha256=O6LnYuNzRAi-gC856Hb1kwqv57JljCRCIVJFuCroC5c,1680
39
39
  zrb/builtin/devtool/zsh/resource/config.sh,sha256=2ZEmmiu5KS-FSMlj48IDPh5dhx5fnbzri86CtzI5Np0,5068
40
+ zrb/builtin/docker.py,sha256=bn3vJrPJLQqO4WcoFgv7L-FB-PWYHeFOzySSkRjp4qM,586
40
41
  zrb/builtin/env.py,sha256=LwSLSn4nM-r9IGgrQA6uyIbnf2hEC5KagAvW3UZ_ZSY,1134
41
42
  zrb/builtin/eval.py,sha256=_y18fe28INT9ZA5OWHxAu8Jw3E0nm5fCv51UVFfkb9w,746
42
43
  zrb/builtin/explain.py,sha256=akQfTCgFTiWutAAC6VMZFrjlyDVQ90IWFPDdM_IgUpw,5353
@@ -1037,7 +1038,7 @@ zrb/builtin/generator/plugin/template/_cmd/build.sh,sha256=BdrlubJq1b9kjtB06IIBx
1037
1038
  zrb/builtin/generator/plugin/template/_cmd/install-symlink.sh,sha256=DntlTyRlfRyxier2byya2dUqW33T2g61yhZLKELVri8,37
1038
1039
  zrb/builtin/generator/plugin/template/_cmd/prepare-venv.sh,sha256=rXg-BvwoWK2xgbZvl01xHko6TZkSkb-yc_LiW8iF2n4,38
1039
1040
  zrb/builtin/generator/plugin/template/_cmd/publish.sh,sha256=kiF-8ngC9g-2OqDHH3Px5VLuP0q58JVh-EIPMYSLvr4,64
1040
- zrb/builtin/generator/plugin/template/project.sh,sha256=G5fJDCxhhB3PCwvD1VP1IiqpP3LgB65RTltL-oVs_WE,1524
1041
+ zrb/builtin/generator/plugin/template/project.sh,sha256=JROKY8-KQF6OFDb9XhkesE8838kYDY8q5D2SuMuv1aU,1990
1041
1042
  zrb/builtin/generator/plugin/template/pyproject.toml,sha256=xgCPcWXo3rwEvGEzH2nJG-dF9OSRcl7f_4vwnW8Y9U4,764
1042
1043
  zrb/builtin/generator/plugin/template/src/snake_zrb_package_name/__init__.py,sha256=5Twm0lVcddWW1tnRKDkKSkwMeuTxZgZ-GyPcr2MeyZk,130
1043
1044
  zrb/builtin/generator/plugin/template/src/snake_zrb_package_name/__main__.py,sha256=xniLN9eAYflMDjM9LOPlt7FATS1P6aZBkUTGa9cfv6w,121
@@ -1053,7 +1054,7 @@ zrb/builtin/generator/project/template/.gitignore,sha256=9Sy-cmSDOIawqlmervgoO1e
1053
1054
  zrb/builtin/generator/project/template/.python-version,sha256=rGeoqWHOE1NzOu73didX8_OyjR9O8b-XNp87WjKbO0s,7
1054
1055
  zrb/builtin/generator/project/template/README.md,sha256=jNnkBuWhfab1HlcOqi0NKaM1O1NtTjchFrvOtR4KQPg,2026
1055
1056
  zrb/builtin/generator/project/template/_automate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1056
- zrb/builtin/generator/project/template/project.sh,sha256=G5fJDCxhhB3PCwvD1VP1IiqpP3LgB65RTltL-oVs_WE,1524
1057
+ zrb/builtin/generator/project/template/project.sh,sha256=JROKY8-KQF6OFDb9XhkesE8838kYDY8q5D2SuMuv1aU,1990
1057
1058
  zrb/builtin/generator/project/template/pyproject.toml,sha256=OZEOtje1M6wVBoCx4ChcNNPMUWVFHv33CVV_isGdLmI,466
1058
1059
  zrb/builtin/generator/project/template/src/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1059
1060
  zrb/builtin/generator/project/template/template.env,sha256=mO3-iPEHihFbkBSr2VBZ15vyleL1S5MMpUKzGo9qtuw,124
@@ -1100,8 +1101,8 @@ zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/Dock
1100
1101
  zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/main.py,sha256=9oXlXs0J3d2fhm9flhVGA-H_XxCDsOj_dFRhyhWEjvc,511
1101
1102
  zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/pyproject.toml,sha256=c8Vz3Q2AmzZzayyAuAKlQk8YdwgaK4KLnzvpTHcEZLM,569
1102
1103
  zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/template.env,sha256=vtoZ0LV8OKAU1EUWBiB8PIKbf1FaNfm-49j7aXvKsgs,87
1103
- zrb/builtin/git.py,sha256=cqmN_CTSjzZI0g-gvOvCKjNOyOKLj2sA6uXjlYgCb3g,2992
1104
- zrb/builtin/group.py,sha256=o67C7nGyApqs5U7QMu5xGQyylPC7Ji9GaYbhrIP4AAk,1093
1104
+ zrb/builtin/git.py,sha256=Djz83w8_DiF1lZkWSl5HRgWlj7SArOpyQW5rQTjVUf0,3016
1105
+ zrb/builtin/group.py,sha256=LotriKtrebUzHgA4_0XzO4WPSG6Dkwb-E8_HsHPQlo8,1168
1105
1106
  zrb/builtin/helper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1106
1107
  zrb/builtin/helper/reccuring_action.py,sha256=_oApvOrn7K4NZa-vt-A-xvpUSPjPEG2gydPXzJEUzSo,1940
1107
1108
  zrb/builtin/md5.py,sha256=MUPvqfqExW0Bj--6K7_WkQiDCdxf3tW6JZiNn4HJyIg,1235
@@ -1215,8 +1216,8 @@ zrb/task_input/int_input.py,sha256=NVXAToqgdmWVwDqnr3XGuvq_QMNvUiIdD-pW5L4uebk,4
1215
1216
  zrb/task_input/password_input.py,sha256=5sS3XP7WtGow7r7Fid8J9SX0iNCidO6Bg7q40UpZDM0,4029
1216
1217
  zrb/task_input/str_input.py,sha256=D2WBeB-CdmAuOSzT7jTXvie7X3EK_m_Oq8_SVwmNpWA,4042
1217
1218
  zrb/task_input/task_input.py,sha256=L-U5dX-I2U5ci7GU226Q8pXcQe5SpGuOl5viFwlfiM0,2022
1218
- zrb-0.7.3.dist-info/LICENSE,sha256=WfnGCl8G60EYOPAEkuc8C9m9pdXWDe08NsKj3TBbxsM,728
1219
- zrb-0.7.3.dist-info/METADATA,sha256=3ayQrVqOJSRPPRg1nPc7PExALRRbWGMB1-DL0ej1vFE,16501
1220
- zrb-0.7.3.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
1221
- zrb-0.7.3.dist-info/entry_points.txt,sha256=xTgXc1kBKYhJHEujdaSPHUcJT3-hbyP1mLgwkv-5sSk,40
1222
- zrb-0.7.3.dist-info/RECORD,,
1219
+ zrb-0.8.0.dist-info/LICENSE,sha256=WfnGCl8G60EYOPAEkuc8C9m9pdXWDe08NsKj3TBbxsM,728
1220
+ zrb-0.8.0.dist-info/METADATA,sha256=9KMmw8WC5nnLhEEJOvEj5eo6PHw2mvZbtmYf1fM6dAk,16501
1221
+ zrb-0.8.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
1222
+ zrb-0.8.0.dist-info/entry_points.txt,sha256=xTgXc1kBKYhJHEujdaSPHUcJT3-hbyP1mLgwkv-5sSk,40
1223
+ zrb-0.8.0.dist-info/RECORD,,
File without changes
File without changes