zrb 0.6.0__py3-none-any.whl → 0.6.1__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/__init__.py +24 -20
- zrb/__main__.py +5 -5
- zrb/action/runner.py +22 -30
- zrb/advertisement.py +10 -9
- zrb/builtin/__init__.py +18 -16
- zrb/builtin/base64.py +13 -18
- zrb/builtin/devtool/__init__.py +14 -3
- zrb/builtin/devtool/devtool_install.py +207 -221
- zrb/builtin/env.py +9 -12
- zrb/builtin/eval.py +9 -9
- zrb/builtin/explain.py +73 -74
- zrb/builtin/generator/__init__.py +7 -11
- zrb/builtin/generator/app_generator/add.py +86 -87
- zrb/builtin/generator/app_generator/template/base/_automate/generate_snake_zrb_meta_template_name/add.py +78 -77
- zrb/builtin/generator/app_generator/template/base/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/_checker.py +6 -6
- zrb/builtin/generator/app_generator/template/base/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/_common.py +14 -15
- zrb/builtin/generator/app_generator/template/base/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/container.py +32 -32
- zrb/builtin/generator/app_generator/template/base/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/deployment.py +29 -30
- zrb/builtin/generator/app_generator/template/base/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/image.py +1 -3
- zrb/builtin/generator/app_generator/template/base/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/local.py +5 -4
- zrb/builtin/generator/app_generator/template/base/_automate/generate_snake_zrb_meta_template_name/template/src/kebab-zrb-app-name/deployment/__main__.py +24 -32
- zrb/builtin/generator/app_generator/template/build-custom-image/_automate/generate_snake_zrb_meta_template_name/add.py +89 -87
- zrb/builtin/generator/app_generator/template/build-custom-image/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/_common.py +14 -15
- zrb/builtin/generator/app_generator/template/build-custom-image/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/container.py +42 -54
- zrb/builtin/generator/app_generator/template/build-custom-image/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/deployment.py +34 -32
- zrb/builtin/generator/app_generator/template/build-custom-image/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/image.py +19 -22
- zrb/builtin/generator/app_generator/template/build-custom-image/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/local.py +18 -18
- zrb/builtin/generator/app_generator/template/http-port/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/_checker.py +10 -10
- zrb/builtin/generator/app_generator/template/http-port-build-custom-image/_automate/generate_snake_zrb_meta_template_name/template/_automate/snake_zrb_app_name/local.py +19 -19
- zrb/builtin/generator/app_generator/template/use-helm/_automate/generate_snake_zrb_meta_template_name/template/src/kebab-zrb-app-name/deployment/__main__.py +12 -14
- zrb/builtin/generator/cmd_task/add.py +23 -25
- zrb/builtin/generator/cmd_task/template/_automate/snake_zrb_task_name.py +3 -5
- zrb/builtin/generator/common/helper.py +15 -20
- zrb/builtin/generator/common/task_factory.py +29 -26
- zrb/builtin/generator/common/task_input.py +97 -91
- zrb/builtin/generator/docker_compose_task/add.py +38 -39
- zrb/builtin/generator/docker_compose_task/template/_automate/snake_zrb_task_name.py +13 -19
- zrb/builtin/generator/docker_compose_task/template/src/kebab-zrb-task-name/image/main.py +18 -14
- zrb/builtin/generator/fastapp/add.py +94 -90
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/_checker.py +28 -27
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/_config.py +68 -39
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/_env.py +24 -22
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/_env_file.py +12 -12
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/_get_start_microservices.py +43 -41
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/_helper.py +23 -24
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/_input.py +21 -20
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/cmd/app-load-test.sh +1 -1
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/cmd/app-start.sh +1 -1
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/cmd/app-test.sh +2 -2
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/container.py +46 -39
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/deployment.py +28 -20
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/frontend.py +21 -27
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/image.py +23 -18
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/load_test.py +35 -36
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/local.py +68 -58
- zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/test.py +24 -38
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/deployment/__main__.py +23 -21
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/deployment/_common.py +72 -75
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/deployment/app_helper.py +70 -75
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/deployment/helm_postgresql_helper.py +18 -21
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/deployment/helm_rabbitmq_helper.py +11 -19
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/deployment/helm_redpanda_helper.py +18 -15
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/deployment/helm_signoz_helper.py +17 -21
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/docker-compose.yml +12 -12
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/loadtest/locustfile.py +10 -12
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/Dockerfile +1 -0
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/component/app.py +35 -30
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/component/app_lifespan.py +21 -17
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/component/app_state.py +3 -2
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/component/db_connection.py +18 -20
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/component/frontend_index.py +5 -6
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/component/log.py +7 -15
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/component/messagebus.py +38 -34
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/component/rpc.py +19 -18
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/config.py +68 -103
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/error.py +11 -10
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/messagebus/__init__.py +2 -4
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/messagebus/kafka/admin.py +38 -35
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/messagebus/kafka/consumer.py +38 -45
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/messagebus/kafka/publisher.py +26 -29
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/messagebus/messagebus.py +8 -14
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/messagebus/mock.py +12 -8
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/messagebus/rabbitmq/admin.py +37 -44
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/messagebus/rabbitmq/consumer.py +42 -67
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/messagebus/rabbitmq/publisher.py +32 -55
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/model/repo_model.py +11 -10
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/repo/__init__.py +2 -2
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/repo/db_entity_mixin.py +3 -6
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/repo/db_repo.py +76 -83
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/repo/repo.py +5 -5
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/repo/search_filter.py +1 -0
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/rpc/__init__.py +1 -1
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/rpc/messagebus/caller.py +17 -19
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/rpc/messagebus/server.py +14 -18
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/rpc/rpc.py +15 -28
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/schema/__init__.py +1 -1
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/schema/base_schema.py +6 -5
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/serializer/__init__.py +1 -3
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/core/serializer/serializer.py +3 -4
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/helper/async_task.py +3 -5
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/helper/conversion.py +10 -10
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/helper/migration.py +6 -10
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/migrate.py +3 -2
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/api.py +7 -12
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/component/__init__.py +4 -6
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/component/access_token_scheme.py +9 -10
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/component/access_token_util.py +6 -5
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/component/authorizer.py +4 -4
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/component/bearer_token_scheme.py +1 -1
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/component/model/user_model.py +8 -10
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/component/password_hasher.py +1 -1
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/component/refresh_token_util.py +7 -6
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/component/repo/group_repo.py +3 -8
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/component/repo/permission_repo.py +3 -7
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/component/repo/user_repo.py +3 -5
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/component/user.py +12 -7
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/core/__init__.py +7 -12
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/core/access_token/scheme.py +7 -12
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/core/access_token/util.py +20 -30
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/core/authorizer/authorizer.py +1 -3
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/core/authorizer/rpc_authorizer.py +5 -12
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/core/password_hasher/bcrypt_password_hasher.py +3 -8
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/core/password_hasher/password_hasher.py +0 -1
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/core/refresh_token/util.py +15 -21
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/group/api.py +42 -49
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/group/model.py +3 -7
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/group/repo.py +18 -16
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/group/rpc.py +26 -41
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/permission/api.py +46 -51
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/permission/model.py +5 -7
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/permission/repo.py +11 -8
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/permission/rpc.py +28 -45
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/table.py +10 -10
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/user/api.py +60 -72
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/user/model.py +32 -61
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/user/repo.py +33 -36
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/entity/user/rpc.py +42 -61
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/event.py +2 -4
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/migrate.py +3 -5
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/register_module.py +11 -12
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/register_permission.py +19 -26
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/rpc.py +5 -13
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/schema/group.py +6 -4
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/schema/permission.py +3 -1
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/schema/request.py +1 -0
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/schema/token.py +2 -2
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/auth/schema/user.py +4 -3
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/api.py +4 -5
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/component/model/activity_model.py +3 -9
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/component/repo/activity_repo.py +3 -7
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/core/historical_repo_model.py +13 -13
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/entity/activity/api.py +22 -23
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/entity/activity/event.py +5 -7
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/entity/activity/model.py +2 -6
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/entity/activity/repo.py +8 -8
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/entity/activity/rpc.py +28 -45
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/entity/table.py +3 -3
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/event.py +4 -8
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/migrate.py +2 -4
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/register_module.py +10 -11
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/rpc.py +3 -5
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/module/log/schema/activity.py +3 -1
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/requirements.txt +12 -12
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/test/auth/test_group_crud.py +76 -106
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/test/auth/test_permission_crud.py +73 -103
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/test/auth/test_user_crud.py +92 -122
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/test/auth/test_user_login.py +107 -134
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/test/conftest.py +2 -2
- zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/test/test_liveness_and_readiness.py +8 -15
- zrb/builtin/generator/fastapp_crud/add.py +74 -79
- zrb/builtin/generator/fastapp_crud/helper.py +51 -48
- zrb/builtin/generator/fastapp_crud/task_factory.py +17 -14
- zrb/builtin/generator/fastapp_crud/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/component/model/snake_zrb_entity_name_model.py +2 -2
- zrb/builtin/generator/fastapp_crud/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/component/repo/snake_zrb_entity_name_repo.py +3 -2
- zrb/builtin/generator/fastapp_crud/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/entity/snake_zrb_entity_name/api.py +58 -40
- zrb/builtin/generator/fastapp_crud/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/entity/snake_zrb_entity_name/model.py +7 -3
- zrb/builtin/generator/fastapp_crud/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/entity/snake_zrb_entity_name/repo.py +9 -4
- zrb/builtin/generator/fastapp_crud/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/entity/snake_zrb_entity_name/rpc.py +32 -39
- zrb/builtin/generator/fastapp_crud/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/schema/snake_zrb_entity_name.py +3 -1
- zrb/builtin/generator/fastapp_crud/template/src/kebab-zrb-app-name/test/snake_zrb_module_name/test_snake_zrb_entity_name.py +68 -98
- zrb/builtin/generator/fastapp_field/add.py +143 -85
- zrb/builtin/generator/fastapp_field/helper.py +184 -125
- zrb/builtin/generator/fastapp_module/add.py +90 -67
- zrb/builtin/generator/fastapp_module/helper.py +141 -155
- zrb/builtin/generator/fastapp_module/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/api.py +3 -2
- zrb/builtin/generator/fastapp_module/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/entity/table.py +3 -3
- zrb/builtin/generator/fastapp_module/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/event.py +3 -5
- zrb/builtin/generator/fastapp_module/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/migrate.py +2 -4
- zrb/builtin/generator/fastapp_module/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/register_module.py +10 -11
- zrb/builtin/generator/fastapp_module/template/src/kebab-zrb-app-name/src/module/snake_zrb_module_name/rpc.py +3 -5
- zrb/builtin/generator/pip_package/add.py +39 -40
- zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/local.py +30 -30
- zrb/builtin/generator/pip_package/template/src/kebab-zrb-package-name/src/snake_zrb_package_name/__init__.py +1 -0
- zrb/builtin/generator/pip_package/template/src/kebab-zrb-package-name/src/snake_zrb_package_name/__main__.py +1 -0
- zrb/builtin/generator/pip_package/template/src/kebab-zrb-package-name/src/snake_zrb_package_name/util.py +2 -2
- zrb/builtin/generator/plugin/create.py +39 -36
- zrb/builtin/generator/plugin/template/src/snake_zrb_package_name/__init__.py +1 -1
- zrb/builtin/generator/plugin/template/src/snake_zrb_package_name/__main__.py +1 -0
- zrb/builtin/generator/plugin/template/src/snake_zrb_package_name/task/example_task.py +6 -4
- zrb/builtin/generator/plugin/template/zrb_init.py +27 -27
- zrb/builtin/generator/project/create.py +38 -46
- zrb/builtin/generator/project/template/.flake8 +3 -0
- zrb/builtin/generator/project/template/project.sh +19 -10
- zrb/builtin/generator/project_task/task_factory.py +60 -61
- zrb/builtin/generator/project_task/template/_automate/_project/__init__.py +2 -2
- zrb/builtin/generator/project_task/template/_automate/_project/build_project_images.py +4 -4
- zrb/builtin/generator/project_task/template/_automate/_project/deploy_project.py +4 -4
- zrb/builtin/generator/project_task/template/_automate/_project/destroy_project.py +4 -4
- zrb/builtin/generator/project_task/template/_automate/_project/push_project_images.py +4 -4
- zrb/builtin/generator/project_task/template/_automate/_project/remove_project_containers.py +4 -4
- zrb/builtin/generator/project_task/template/_automate/_project/start_project.py +4 -4
- zrb/builtin/generator/project_task/template/_automate/_project/start_project_containers.py +4 -4
- zrb/builtin/generator/project_task/template/_automate/_project/stop_project_containers.py +4 -4
- zrb/builtin/generator/python_task/add.py +25 -33
- zrb/builtin/generator/python_task/template/_automate/snake_zrb_task_name.py +8 -7
- zrb/builtin/generator/simple_python_app/add.py +81 -75
- zrb/builtin/generator/simple_python_app/template/_automate/snake_zrb_app_name/_common.py +14 -15
- zrb/builtin/generator/simple_python_app/template/_automate/snake_zrb_app_name/container.py +46 -61
- zrb/builtin/generator/simple_python_app/template/_automate/snake_zrb_app_name/deployment.py +34 -32
- zrb/builtin/generator/simple_python_app/template/_automate/snake_zrb_app_name/image.py +19 -22
- zrb/builtin/generator/simple_python_app/template/_automate/snake_zrb_app_name/local.py +23 -25
- zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/deployment/__main__.py +24 -32
- zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/main.py +18 -14
- zrb/builtin/git.py +46 -46
- zrb/builtin/group.py +13 -34
- zrb/builtin/helper/reccuring_action.py +26 -29
- zrb/builtin/md5.py +17 -30
- zrb/builtin/process.py +19 -19
- zrb/builtin/project.py +13 -15
- zrb/builtin/say.py +69 -88
- zrb/builtin/schedule.py +15 -19
- zrb/builtin/ubuntu.py +44 -35
- zrb/builtin/update.py +5 -5
- zrb/builtin/version.py +3 -7
- zrb/builtin/watch_changes.py +24 -25
- zrb/config/config.py +19 -18
- zrb/helper/accessories/color.py +18 -6
- zrb/helper/accessories/icon.py +24 -3
- zrb/helper/accessories/name.py +120 -28
- zrb/helper/advertisement.py +9 -13
- zrb/helper/callable.py +2 -4
- zrb/helper/cli.py +27 -31
- zrb/helper/codemod/add_argument_to_function.py +3 -4
- zrb/helper/codemod/add_argument_to_function_call.py +4 -7
- zrb/helper/codemod/add_assert_resource.py +7 -7
- zrb/helper/codemod/add_function_call.py +3 -5
- zrb/helper/codemod/add_import_module.py +15 -26
- zrb/helper/codemod/add_key_value_to_dict.py +7 -10
- zrb/helper/codemod/add_property_to_class.py +10 -8
- zrb/helper/codemod/add_upstream_to_task.py +21 -33
- zrb/helper/codemod/append_code_to_function.py +6 -13
- zrb/helper/codemod/format_code.py +2 -1
- zrb/helper/default_env.py +25 -25
- zrb/helper/docker_compose/fetch_external_env.py +18 -18
- zrb/helper/docker_compose/file.py +5 -4
- zrb/helper/docstring.py +44 -47
- zrb/helper/env_map/fetch.py +7 -12
- zrb/helper/file/copy_tree.py +12 -17
- zrb/helper/file/match.py +6 -7
- zrb/helper/file/text.py +8 -6
- zrb/helper/git/detect_changes.py +9 -8
- zrb/helper/loader/load_module.py +14 -13
- zrb/helper/log.py +4 -3
- zrb/helper/map/conversion.py +4 -5
- zrb/helper/python_task.py +2 -4
- zrb/helper/render_data.py +25 -18
- zrb/helper/string/constant.py +2 -2
- zrb/helper/string/conversion.py +17 -16
- zrb/helper/string/jinja.py +2 -2
- zrb/helper/typecheck.py +6 -4
- zrb/helper/typing.py +10 -2
- zrb/helper/util.py +44 -40
- zrb/task/any_task.py +251 -251
- zrb/task/base_remote_cmd_task.py +76 -59
- zrb/task/base_task/base_task.py +95 -108
- zrb/task/base_task/component/base_task_model.py +73 -71
- zrb/task/base_task/component/common_task_model.py +42 -29
- zrb/task/base_task/component/pid_model.py +3 -5
- zrb/task/base_task/component/renderer.py +26 -36
- zrb/task/base_task/component/trackers.py +6 -9
- zrb/task/checker.py +14 -9
- zrb/task/cmd_task.py +102 -100
- zrb/task/decorator.py +19 -13
- zrb/task/docker_compose_task.py +127 -98
- zrb/task/flow_task.py +16 -19
- zrb/task/http_checker.py +40 -36
- zrb/task/notifier.py +50 -38
- zrb/task/parallel.py +3 -3
- zrb/task/path_checker.py +34 -27
- zrb/task/path_watcher.py +49 -40
- zrb/task/port_checker.py +33 -26
- zrb/task/recurring_task.py +36 -42
- zrb/task/remote_cmd_task.py +31 -28
- zrb/task/resource_maker.py +66 -52
- zrb/task/rsync_task.py +24 -21
- zrb/task/task.py +4 -3
- zrb/task/time_watcher.py +36 -31
- zrb/task_env/constant.py +1 -1
- zrb/task_env/env.py +33 -31
- zrb/task_env/env_file.py +24 -23
- zrb/task_group/group.py +27 -30
- zrb/task_input/any_input.py +18 -16
- zrb/task_input/base_input.py +26 -26
- zrb/task_input/bool_input.py +6 -6
- zrb/task_input/choice_input.py +11 -9
- zrb/task_input/constant.py +1 -1
- zrb/task_input/float_input.py +6 -5
- zrb/task_input/int_input.py +8 -8
- zrb/task_input/password_input.py +9 -9
- zrb/task_input/str_input.py +8 -8
- zrb/task_input/task_input.py +4 -2
- {zrb-0.6.0.dist-info → zrb-0.6.1.dist-info}/METADATA +3 -1
- {zrb-0.6.0.dist-info → zrb-0.6.1.dist-info}/RECORD +316 -315
- {zrb-0.6.0.dist-info → zrb-0.6.1.dist-info}/LICENSE +0 -0
- {zrb-0.6.0.dist-info → zrb-0.6.1.dist-info}/WHEEL +0 -0
- {zrb-0.6.0.dist-info → zrb-0.6.1.dist-info}/entry_points.txt +0 -0
zrb/builtin/md5.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
|
1
|
+
import hashlib
|
2
|
+
|
3
|
+
import aiofiles
|
4
|
+
|
2
5
|
from zrb.builtin.group import md5_group
|
6
|
+
from zrb.helper.typing import Any
|
7
|
+
from zrb.runner import runner
|
3
8
|
from zrb.task.decorator import python_task
|
4
9
|
from zrb.task_input.str_input import StrInput
|
5
|
-
from zrb.runner import runner
|
6
|
-
|
7
|
-
import aiofiles
|
8
|
-
import hashlib
|
9
10
|
|
10
11
|
###############################################################################
|
11
12
|
# Task Definitions
|
@@ -13,44 +14,30 @@ import hashlib
|
|
13
14
|
|
14
15
|
|
15
16
|
@python_task(
|
16
|
-
name=
|
17
|
+
name="hash",
|
17
18
|
group=md5_group,
|
18
|
-
inputs=[
|
19
|
-
|
20
|
-
name='text',
|
21
|
-
shortcut='t',
|
22
|
-
description='Text',
|
23
|
-
default=''
|
24
|
-
)
|
25
|
-
],
|
26
|
-
description='Hash md5',
|
19
|
+
inputs=[StrInput(name="text", shortcut="t", description="Text", default="")],
|
20
|
+
description="Hash md5",
|
27
21
|
retry=0,
|
28
|
-
runner=runner
|
22
|
+
runner=runner,
|
29
23
|
)
|
30
24
|
async def hash_text(*args: str, **kwargs: Any):
|
31
|
-
text: str = kwargs.get(
|
25
|
+
text: str = kwargs.get("text", "")
|
32
26
|
hashed_text = hashlib.md5(text.encode()).hexdigest()
|
33
27
|
return hashed_text
|
34
28
|
|
35
29
|
|
36
30
|
@python_task(
|
37
|
-
name=
|
31
|
+
name="sum",
|
38
32
|
group=md5_group,
|
39
|
-
inputs=[
|
40
|
-
|
41
|
-
name='file',
|
42
|
-
shortcut='f',
|
43
|
-
description='File',
|
44
|
-
default=''
|
45
|
-
)
|
46
|
-
],
|
47
|
-
description='Sum md5 file',
|
33
|
+
inputs=[StrInput(name="file", shortcut="f", description="File", default="")],
|
34
|
+
description="Sum md5 file",
|
48
35
|
retry=0,
|
49
|
-
runner=runner
|
36
|
+
runner=runner,
|
50
37
|
)
|
51
38
|
async def sum_file(*args: str, **kwargs: Any):
|
52
|
-
file_path: str = kwargs.get(
|
53
|
-
async with aiofiles.open(file_path, mode=
|
39
|
+
file_path: str = kwargs.get("file", "")
|
40
|
+
async with aiofiles.open(file_path, mode="rb") as file:
|
54
41
|
contents = await file.read()
|
55
42
|
hashed_text = hashlib.md5(contents).hexdigest()
|
56
43
|
return hashed_text
|
zrb/builtin/process.py
CHANGED
@@ -1,45 +1,45 @@
|
|
1
|
-
from zrb.task.cmd_task import CmdTask
|
2
1
|
from zrb.builtin.group import process_group
|
2
|
+
from zrb.runner import runner
|
3
|
+
from zrb.task.cmd_task import CmdTask
|
3
4
|
from zrb.task_input.int_input import IntInput
|
4
5
|
from zrb.task_input.str_input import StrInput
|
5
|
-
from zrb.runner import runner
|
6
6
|
|
7
7
|
###############################################################################
|
8
8
|
# Task Definitions
|
9
9
|
###############################################################################
|
10
10
|
|
11
11
|
get_pid_by_port = CmdTask(
|
12
|
-
name=
|
12
|
+
name="get-pid-by-port",
|
13
13
|
group=process_group,
|
14
|
-
description=
|
14
|
+
description="Get PID by port",
|
15
15
|
inputs=[
|
16
16
|
IntInput(
|
17
|
-
name=
|
18
|
-
shortcut=
|
19
|
-
default=
|
20
|
-
description=
|
21
|
-
prompt=
|
17
|
+
name="port",
|
18
|
+
shortcut="p",
|
19
|
+
default="8080",
|
20
|
+
description="Port to be checked",
|
21
|
+
prompt="Port to be checked",
|
22
22
|
)
|
23
23
|
],
|
24
24
|
cmd="lsof -i :{{ input.port }} -n -P | awk 'NR>1 {print $2}'",
|
25
|
-
checking_interval=3
|
25
|
+
checking_interval=3,
|
26
26
|
)
|
27
27
|
runner.register(get_pid_by_port)
|
28
28
|
|
29
29
|
get_pid_by_name = CmdTask(
|
30
|
-
name=
|
30
|
+
name="get-pid-by-name",
|
31
31
|
group=process_group,
|
32
|
-
description=
|
32
|
+
description="Get PID by name",
|
33
33
|
inputs=[
|
34
34
|
StrInput(
|
35
|
-
name=
|
36
|
-
shortcut=
|
37
|
-
default=
|
38
|
-
description=
|
39
|
-
prompt=
|
35
|
+
name="name",
|
36
|
+
shortcut="n",
|
37
|
+
default="python",
|
38
|
+
description="Process name to be checked",
|
39
|
+
prompt="Process name to be checked",
|
40
40
|
)
|
41
41
|
],
|
42
|
-
cmd=
|
43
|
-
checking_interval=3
|
42
|
+
cmd="pgrep {{ input.name }}",
|
43
|
+
checking_interval=3,
|
44
44
|
)
|
45
45
|
runner.register(get_pid_by_name)
|
zrb/builtin/project.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
from zrb.helper.typing import Any, Mapping
|
2
1
|
from zrb.builtin.group import project_group
|
2
|
+
from zrb.helper.env_map.fetch import fetch_env_map_from_group
|
3
|
+
from zrb.helper.typing import Any, Mapping
|
4
|
+
from zrb.runner import runner
|
3
5
|
from zrb.task.decorator import python_task
|
4
6
|
from zrb.task_input.bool_input import BoolInput
|
5
|
-
from zrb.runner import runner
|
6
|
-
from zrb.helper.env_map.fetch import fetch_env_map_from_group
|
7
7
|
|
8
8
|
###############################################################################
|
9
9
|
# Task Definitions
|
@@ -11,26 +11,24 @@ from zrb.helper.env_map.fetch import fetch_env_map_from_group
|
|
11
11
|
|
12
12
|
|
13
13
|
@python_task(
|
14
|
-
name=
|
15
|
-
description=
|
14
|
+
name="get-default-env",
|
15
|
+
description="Get default values for project environments",
|
16
16
|
inputs=[
|
17
17
|
BoolInput(
|
18
|
-
name=
|
19
|
-
shortcut=
|
20
|
-
description=
|
21
|
-
default=True
|
18
|
+
name="export",
|
19
|
+
shortcut="e",
|
20
|
+
description="Whether add export statement or not",
|
21
|
+
default=True,
|
22
22
|
)
|
23
23
|
],
|
24
24
|
group=project_group,
|
25
|
-
runner=runner
|
25
|
+
runner=runner,
|
26
26
|
)
|
27
27
|
async def get_default_env(*args: Any, **kwargs: Any) -> str:
|
28
28
|
env_map: Mapping[str, str] = {}
|
29
29
|
env_map = fetch_env_map_from_group(env_map, project_group)
|
30
30
|
env_keys = list(env_map.keys())
|
31
31
|
env_keys.sort()
|
32
|
-
should_export = kwargs.get(
|
33
|
-
export_prefix =
|
34
|
-
return
|
35
|
-
f'{export_prefix}{key}={env_map[key]}' for key in env_keys
|
36
|
-
])
|
32
|
+
should_export = kwargs.get("export", True)
|
33
|
+
export_prefix = "export " if should_export else ""
|
34
|
+
return "\n".join([f"{export_prefix}{key}={env_map[key]}" for key in env_keys])
|
zrb/builtin/say.py
CHANGED
@@ -1,138 +1,119 @@
|
|
1
|
-
|
1
|
+
import datetime
|
2
|
+
import random
|
3
|
+
|
2
4
|
from zrb.helper.python_task import show_lines
|
5
|
+
from zrb.helper.typing import Any, List
|
6
|
+
from zrb.runner import runner
|
3
7
|
from zrb.task.decorator import python_task
|
4
|
-
from zrb.task_input.str_input import StrInput
|
5
8
|
from zrb.task_input.int_input import IntInput
|
6
|
-
from zrb.
|
7
|
-
import datetime
|
8
|
-
import random
|
9
|
+
from zrb.task_input.str_input import StrInput
|
9
10
|
|
10
11
|
_MIN_WIDTH = 10
|
11
12
|
_MOTIVATIONAL_QUOTES = [
|
12
13
|
[
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
],
|
17
|
-
[
|
18
|
-
'The only way to do great work is to love what you do.',
|
19
|
-
'~ Steve Jobs'
|
14
|
+
"The best time to plant a tree was 20 years ago.",
|
15
|
+
"The second best time is now.",
|
16
|
+
"~ Chinese Proverb",
|
20
17
|
],
|
18
|
+
["The only way to do great work is to love what you do.", "~ Steve Jobs"],
|
19
|
+
["Believe you can and you're halfway there.", "~ Theodore Roosevelt"],
|
20
|
+
["It does not matter how slowly you go as long as you do not stop.", "~ Confucius"],
|
21
|
+
["Everything you've ever wanted is on the other side of fear.", "~ George Addair"],
|
21
22
|
[
|
22
|
-
|
23
|
-
|
23
|
+
"Success is not final, failure is not fatal:",
|
24
|
+
"It is the courage to continue that counts.",
|
25
|
+
"~ Winston Churchill",
|
24
26
|
],
|
25
27
|
[
|
26
|
-
|
27
|
-
|
28
|
+
"Hardships often prepare ordinary people",
|
29
|
+
"for an extraordinary destiny.",
|
30
|
+
"~ C.S. Lewis",
|
28
31
|
],
|
29
32
|
[
|
30
|
-
|
31
|
-
|
33
|
+
"Your time is limited, don't waste it living someone else's life.",
|
34
|
+
"~ Steve Jobs",
|
32
35
|
],
|
36
|
+
["Don’t watch the clock; do what it does. Keep going.", "~ Sam Levenson"],
|
33
37
|
[
|
34
|
-
|
35
|
-
|
36
|
-
'~ Winston Churchill'
|
38
|
+
"You are never too old to set another goal or to dream a new dream.",
|
39
|
+
"~ C.S. Lewis",
|
37
40
|
],
|
38
41
|
[
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
+
"The only limit to our realization of tomorrow",
|
43
|
+
"will be our doubts of today.",
|
44
|
+
"~ Franklin D. Roosevelt",
|
42
45
|
],
|
43
46
|
[
|
44
|
-
|
45
|
-
|
47
|
+
"Believe in yourself.",
|
48
|
+
"You are braver than you think, more talented than you know,"
|
49
|
+
"and capable of more than you imagine.",
|
50
|
+
"~ Roy T. Bennett",
|
46
51
|
],
|
47
52
|
[
|
48
|
-
'
|
49
|
-
|
53
|
+
"I can't change the direction of the wind,",
|
54
|
+
"but I can adjust my sails to always reach my destination.",
|
55
|
+
"~ Jimmy Dean",
|
50
56
|
],
|
57
|
+
["You are enough just as you are.", "~ Meghan Markle"],
|
51
58
|
[
|
52
|
-
|
53
|
-
|
59
|
+
"The future belongs to those",
|
60
|
+
"who believe in the beauty of their dreams.",
|
61
|
+
"~ Eleanor Roosevelt",
|
54
62
|
],
|
55
|
-
[
|
56
|
-
'The only limit to our realization of tomorrow',
|
57
|
-
'will be our doubts of today.',
|
58
|
-
'~ Franklin D. Roosevelt'
|
59
|
-
],
|
60
|
-
[
|
61
|
-
'Believe in yourself.',
|
62
|
-
'You are braver than you think, more talented than you know,'
|
63
|
-
'and capable of more than you imagine.',
|
64
|
-
'~ Roy T. Bennett'
|
65
|
-
],
|
66
|
-
[
|
67
|
-
'I can\'t change the direction of the wind,',
|
68
|
-
'but I can adjust my sails to always reach my destination.',
|
69
|
-
'~ Jimmy Dean'
|
70
|
-
],
|
71
|
-
[
|
72
|
-
'You are enough just as you are.',
|
73
|
-
'~ Meghan Markle'
|
74
|
-
],
|
75
|
-
[
|
76
|
-
'The future belongs to those',
|
77
|
-
'who believe in the beauty of their dreams.',
|
78
|
-
'~ Eleanor Roosevelt'
|
79
|
-
]
|
80
63
|
]
|
81
64
|
|
82
65
|
|
83
66
|
@python_task(
|
84
|
-
name=
|
85
|
-
inputs=[
|
86
|
-
|
87
|
-
|
88
|
-
],
|
89
|
-
description='Say anything, https://www.youtube.com/watch?v=MbPr1oHO4Hw',
|
90
|
-
runner=runner
|
67
|
+
name="say",
|
68
|
+
inputs=[StrInput(name="text", default=""), IntInput(name="width", default=80)],
|
69
|
+
description="Say anything, https://www.youtube.com/watch?v=MbPr1oHO4Hw",
|
70
|
+
runner=runner,
|
91
71
|
)
|
92
72
|
def say(*args: Any, **kwargs: Any):
|
93
|
-
width: int = kwargs.get(
|
73
|
+
width: int = kwargs.get("width", 80)
|
94
74
|
if width < _MIN_WIDTH:
|
95
75
|
width = _MIN_WIDTH
|
96
|
-
text: str = kwargs.get(
|
97
|
-
top_border =
|
98
|
-
content = [
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
76
|
+
text: str = kwargs.get("text", "")
|
77
|
+
top_border = "┌" + "─" * (width + 2) + "┐"
|
78
|
+
content = ["| " + line + " |" for line in _get_content(text, width)]
|
79
|
+
bottom_border = "└" + "─" * (width + 2) + "┘"
|
80
|
+
lines = (
|
81
|
+
[top_border]
|
82
|
+
+ content
|
83
|
+
+ [bottom_border]
|
84
|
+
+ [
|
85
|
+
" \\",
|
86
|
+
" \\",
|
87
|
+
" o ___ o",
|
88
|
+
" | ┌-------┐ |",
|
89
|
+
" |(| o o |)|",
|
90
|
+
" | └---┘ |",
|
91
|
+
" └-------┘",
|
92
|
+
]
|
93
|
+
)
|
94
|
+
show_lines(kwargs["_task"], *lines)
|
112
95
|
|
113
96
|
|
114
97
|
def _get_content(text: str, width: int) -> List[str]:
|
115
|
-
if text ==
|
98
|
+
if text == "":
|
116
99
|
now = datetime.datetime.now()
|
117
|
-
today =
|
118
|
-
current_time =
|
100
|
+
today = "Today is " + now.strftime("%A, %B %d, %Y")
|
101
|
+
current_time = "Current time is " + now.strftime("%I:%M %p")
|
119
102
|
motivational_quote = random.choice(_MOTIVATIONAL_QUOTES)
|
120
103
|
return [
|
121
104
|
today.ljust(width),
|
122
105
|
current_time.ljust(width),
|
123
|
-
|
124
|
-
] + [
|
125
|
-
line.ljust(width) for line in motivational_quote
|
126
|
-
]
|
106
|
+
"".ljust(width),
|
107
|
+
] + [line.ljust(width) for line in motivational_quote]
|
127
108
|
return _split_text_by_width(text, width)
|
128
109
|
|
129
110
|
|
130
111
|
def _split_text_by_width(text: str, width: int) -> List[str]:
|
131
|
-
original_lines = text.split(
|
112
|
+
original_lines = text.split("\n")
|
132
113
|
new_lines = []
|
133
114
|
for original_line in original_lines:
|
134
115
|
new_lines += [
|
135
|
-
original_line[i:i+width].ljust(width)
|
116
|
+
original_line[i : i + width].ljust(width)
|
136
117
|
for i in range(0, len(original_line), width)
|
137
118
|
]
|
138
119
|
return new_lines
|
zrb/builtin/schedule.py
CHANGED
@@ -1,35 +1,31 @@
|
|
1
|
+
from zrb.builtin.helper.reccuring_action import create_recurring_action
|
2
|
+
from zrb.runner import runner
|
1
3
|
from zrb.task.recurring_task import RecurringTask
|
2
4
|
from zrb.task.time_watcher import TimeWatcher
|
3
5
|
from zrb.task_input.str_input import StrInput
|
4
|
-
from zrb.runner import runner
|
5
|
-
from zrb.builtin.helper.reccuring_action import create_recurring_action
|
6
|
-
|
7
6
|
|
8
7
|
schedule = RecurringTask(
|
9
|
-
name=
|
10
|
-
icon=
|
11
|
-
color=
|
12
|
-
description=
|
8
|
+
name="schedule",
|
9
|
+
icon="📅",
|
10
|
+
color="yellow",
|
11
|
+
description="Show message/run command periodically",
|
13
12
|
inputs=[
|
14
13
|
StrInput(
|
15
|
-
name=
|
16
|
-
default=
|
17
|
-
prompt=
|
18
|
-
description=
|
14
|
+
name="schedule",
|
15
|
+
default="* * * * *",
|
16
|
+
prompt="Schedule cron pattern (minute hour day(month) month day(week)", # noqa
|
17
|
+
description="Schedule cron pattern to show the message",
|
19
18
|
),
|
20
19
|
],
|
21
20
|
triggers=[
|
22
21
|
TimeWatcher(
|
23
|
-
name=
|
24
|
-
color='cyan',
|
25
|
-
icon='⏰',
|
26
|
-
schedule='{{input.schedule}}'
|
22
|
+
name="watch-time", color="cyan", icon="⏰", schedule="{{input.schedule}}"
|
27
23
|
)
|
28
24
|
],
|
29
25
|
task=create_recurring_action(
|
30
|
-
notif_title=
|
31
|
-
trigger_caption=
|
32
|
-
trigger_xcom_key=
|
33
|
-
)
|
26
|
+
notif_title="Schedule",
|
27
|
+
trigger_caption="Schedule",
|
28
|
+
trigger_xcom_key="watch-time.scheduled-time",
|
29
|
+
),
|
34
30
|
)
|
35
31
|
runner.register(schedule)
|
zrb/builtin/ubuntu.py
CHANGED
@@ -1,12 +1,21 @@
|
|
1
|
+
from zrb.builtin.devtool.devtool_install import (
|
2
|
+
install_aws,
|
3
|
+
install_docker,
|
4
|
+
install_gcloud,
|
5
|
+
install_gvm,
|
6
|
+
install_helix,
|
7
|
+
install_helm,
|
8
|
+
install_kubectl,
|
9
|
+
install_nvm,
|
10
|
+
install_pyenv,
|
11
|
+
install_sdkman,
|
12
|
+
install_tmux,
|
13
|
+
install_zsh,
|
14
|
+
)
|
1
15
|
from zrb.builtin.group import ubuntu_group, ubuntu_install_group
|
16
|
+
from zrb.runner import runner
|
2
17
|
from zrb.task.cmd_task import CmdTask
|
3
18
|
from zrb.task.flow_task import FlowTask
|
4
|
-
from zrb.runner import runner
|
5
|
-
from zrb.builtin.devtool.devtool_install import (
|
6
|
-
install_tmux, install_zsh, install_gvm, install_nvm, install_pyenv,
|
7
|
-
install_sdkman, install_aws, install_gcloud, install_docker,
|
8
|
-
install_kubectl, install_helm, install_helix
|
9
|
-
)
|
10
19
|
|
11
20
|
###############################################################################
|
12
21
|
# Task Definitions
|
@@ -14,72 +23,72 @@ from zrb.builtin.devtool.devtool_install import (
|
|
14
23
|
|
15
24
|
|
16
25
|
update = CmdTask(
|
17
|
-
name=
|
26
|
+
name="update",
|
18
27
|
group=ubuntu_group,
|
19
|
-
description=
|
28
|
+
description="Update ubuntu",
|
20
29
|
cmd=[
|
21
|
-
|
22
|
-
|
30
|
+
"sudo apt update",
|
31
|
+
"sudo apt upgrade -y",
|
23
32
|
],
|
24
33
|
retry_interval=3,
|
25
|
-
preexec_fn=None
|
34
|
+
preexec_fn=None,
|
26
35
|
)
|
27
36
|
runner.register(update)
|
28
37
|
|
29
38
|
install_toys = CmdTask(
|
30
|
-
name=
|
39
|
+
name="toys",
|
31
40
|
group=ubuntu_install_group,
|
32
|
-
description=
|
41
|
+
description="Install ubuntu toy packages",
|
33
42
|
cmd=[
|
34
|
-
|
43
|
+
"sudo apt install -y lolcat cowsay figlet neofetch",
|
35
44
|
],
|
36
45
|
retry_interval=3,
|
37
|
-
preexec_fn=None
|
46
|
+
preexec_fn=None,
|
38
47
|
)
|
39
48
|
update_and_install_toys: CmdTask = install_toys.copy()
|
40
49
|
update_and_install_toys.add_upstream(update)
|
41
50
|
runner.register(update_and_install_toys)
|
42
51
|
|
43
52
|
install_essentials = CmdTask(
|
44
|
-
name=
|
53
|
+
name="essentials",
|
45
54
|
group=ubuntu_install_group,
|
46
|
-
description=
|
55
|
+
description="Install ubuntu essential packages",
|
47
56
|
cmd=[
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
57
|
+
"sudo apt install -y \\",
|
58
|
+
"build-essential python3-distutils libssl-dev zlib1g-dev \\"
|
59
|
+
"libbz2-dev libreadline-dev libsqlite3-dev libpq-dev python3-dev \\",
|
60
|
+
"llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev \\",
|
61
|
+
"liblzma-dev python3-openssl libblas-dev liblapack-dev rustc \\",
|
62
|
+
"golang gfortran fd-find ripgrep wget curl git ncat zip unzip \\",
|
63
|
+
"cmake make tree tmux zsh neovim xdotool xsel",
|
55
64
|
],
|
56
65
|
retry_interval=3,
|
57
|
-
preexec_fn=None
|
66
|
+
preexec_fn=None,
|
58
67
|
)
|
59
68
|
update_and_install_essentials: CmdTask = install_essentials.copy()
|
60
69
|
update_and_install_essentials.add_upstream(update)
|
61
70
|
runner.register(update_and_install_essentials)
|
62
71
|
|
63
72
|
install_tex = CmdTask(
|
64
|
-
name=
|
73
|
+
name="tex",
|
65
74
|
group=ubuntu_install_group,
|
66
|
-
description=
|
75
|
+
description="Install ubuntu tex packages",
|
67
76
|
cmd=[
|
68
|
-
|
69
|
-
|
70
|
-
|
77
|
+
"sudo apt install -y \\",
|
78
|
+
"texlive-full texlive-latex-base texlive-fonts-recommended \\",
|
79
|
+
"texlive-fonts-extra texlive-latex-extra",
|
71
80
|
],
|
72
81
|
retry_interval=3,
|
73
|
-
preexec_fn=None
|
82
|
+
preexec_fn=None,
|
74
83
|
)
|
75
84
|
update_and_install_tex: CmdTask = install_tex.copy()
|
76
85
|
update_and_install_tex.add_upstream(update)
|
77
86
|
runner.register(update_and_install_tex)
|
78
87
|
|
79
88
|
install_all = FlowTask(
|
80
|
-
name=
|
89
|
+
name="all",
|
81
90
|
group=ubuntu_install_group,
|
82
|
-
description=
|
91
|
+
description="Install all ubuntu packages",
|
83
92
|
steps=[
|
84
93
|
update,
|
85
94
|
install_essentials,
|
@@ -96,7 +105,7 @@ install_all = FlowTask(
|
|
96
105
|
install_docker,
|
97
106
|
install_kubectl,
|
98
107
|
install_helm,
|
99
|
-
install_helix
|
100
|
-
]
|
108
|
+
install_helix,
|
109
|
+
],
|
101
110
|
)
|
102
111
|
runner.register(install_all)
|
zrb/builtin/update.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
from zrb.task.cmd_task import CmdTask
|
2
1
|
from zrb.runner import runner
|
2
|
+
from zrb.task.cmd_task import CmdTask
|
3
3
|
|
4
4
|
###############################################################################
|
5
5
|
# Task Definitions
|
6
6
|
###############################################################################
|
7
7
|
|
8
8
|
update = CmdTask(
|
9
|
-
name=
|
10
|
-
description=
|
11
|
-
cmd=
|
12
|
-
checking_interval=3
|
9
|
+
name="update",
|
10
|
+
description="Update zrb",
|
11
|
+
cmd="pip install zrb -U",
|
12
|
+
checking_interval=3,
|
13
13
|
)
|
14
14
|
runner.register(update)
|
zrb/builtin/version.py
CHANGED
@@ -1,17 +1,13 @@
|
|
1
|
+
from zrb.config.config import version
|
1
2
|
from zrb.helper.typing import Any
|
2
|
-
from zrb.task.decorator import python_task
|
3
3
|
from zrb.runner import runner
|
4
|
-
from zrb.
|
4
|
+
from zrb.task.decorator import python_task
|
5
5
|
|
6
6
|
###############################################################################
|
7
7
|
# Task Definitions
|
8
8
|
###############################################################################
|
9
9
|
|
10
10
|
|
11
|
-
@python_task(
|
12
|
-
name='version',
|
13
|
-
description='Get Zrb version',
|
14
|
-
runner=runner
|
15
|
-
)
|
11
|
+
@python_task(name="version", description="Get Zrb version", runner=runner)
|
16
12
|
async def get_version(*args: Any, **kwargs: Any) -> str:
|
17
13
|
return version
|