zrb 1.0.0a5__tar.gz → 1.0.0a7__tar.gz

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 (196) hide show
  1. {zrb-1.0.0a5 → zrb-1.0.0a7}/PKG-INFO +1 -1
  2. {zrb-1.0.0a5 → zrb-1.0.0a7}/pyproject.toml +1 -1
  3. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/git.py +16 -10
  4. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/git_subtree.py +19 -4
  5. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/group.py +9 -0
  6. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/todo.py +0 -1
  7. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/config.py +1 -1
  8. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_app.py +0 -6
  9. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/any_task.py +38 -2
  10. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/base_task.py +71 -4
  11. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/git.py +31 -17
  12. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/git_subtree.py +11 -10
  13. {zrb-1.0.0a5 → zrb-1.0.0a7}/README.md +0 -0
  14. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/__init__.py +0 -0
  15. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/__main__.py +0 -0
  16. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/attr/__init__.py +0 -0
  17. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/attr/type.py +0 -0
  18. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/__init__.py +0 -0
  19. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/base64.py +0 -0
  20. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/llm/llm_chat.py +0 -0
  21. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/llm/tool/cli.py +0 -0
  22. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/llm/tool/rag.py +0 -0
  23. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/llm/tool/web.py +0 -0
  24. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/md5.py +0 -0
  25. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/__init__.py +0 -0
  26. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/__init__.py +0 -0
  27. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp.py +0 -0
  28. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/.gitignore +0 -0
  29. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/README.md +0 -0
  30. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/__init__.py +0 -0
  31. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/_zrb/config.py +0 -0
  32. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/_zrb/group.py +0 -0
  33. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/_zrb/helper.py +0 -0
  34. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/_zrb/main.py +0 -0
  35. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/_zrb/venv_task.py +0 -0
  36. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/common/__init__.py +0 -0
  37. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/common/app.py +0 -0
  38. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/common/db_engine.py +0 -0
  39. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/common/db_repository.py +0 -0
  40. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/common/error.py +0 -0
  41. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/common/schema.py +0 -0
  42. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/common/usecase.py +0 -0
  43. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/config.py +0 -0
  44. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/main.py +0 -0
  45. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/migrate.py +0 -0
  46. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/__init__.py +0 -0
  47. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/alembic.ini +0 -0
  48. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/client/api_client.py +0 -0
  49. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/client/base_client.py +0 -0
  50. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/client/direct_client.py +0 -0
  51. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/client/factory.py +0 -0
  52. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/migration/README +0 -0
  53. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/migration/env.py +0 -0
  54. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/migration/script.py.mako +0 -0
  55. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/migration/versions/3093c7336477_add_user_table.py +0 -0
  56. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/migration_metadata.py +0 -0
  57. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/route.py +0 -0
  58. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/__init__.py +0 -0
  59. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/__init__.py +0 -0
  60. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/repository/__init__.py +0 -0
  61. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/repository/db_repository.py +0 -0
  62. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/repository/factory.py +0 -0
  63. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/repository/repository.py +0 -0
  64. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/usecase.py +0 -0
  65. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/gateway/alembic.ini +0 -0
  66. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration/README +0 -0
  67. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration/env.py +0 -0
  68. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration/script.py.mako +0 -0
  69. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration/versions/.gitkeep +0 -0
  70. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration_metadata.py +0 -0
  71. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/module/gateway/route.py +0 -0
  72. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/requirements.txt +0 -0
  73. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/schema/__init__.py +0 -0
  74. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/schema/role.py +0 -0
  75. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/schema/user.py +0 -0
  76. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/add/fastapp_template/template.env +0 -0
  77. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/create/__init__.py +0 -0
  78. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/create/create.py +0 -0
  79. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/create/project-template/README.md +0 -0
  80. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/project/create/project-template/zrb_init.py +0 -0
  81. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/python.py +0 -0
  82. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/shell/__init__.py +0 -0
  83. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/shell/autocomplete/__init__.py +0 -0
  84. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/shell/autocomplete/bash.py +0 -0
  85. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/shell/autocomplete/subcmd.py +0 -0
  86. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/builtin/shell/autocomplete/zsh.py +0 -0
  87. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/callback/__init__.py +0 -0
  88. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/callback/any_callback.py +0 -0
  89. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/callback/callback.py +0 -0
  90. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/cmd/__init__.py +0 -0
  91. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/cmd/cmd_result.py +0 -0
  92. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/cmd/cmd_val.py +0 -0
  93. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/content_transformer/__init__.py +0 -0
  94. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/content_transformer/any_content_transformer.py +0 -0
  95. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/content_transformer/content_transformer.py +0 -0
  96. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/context/__init__.py +0 -0
  97. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/context/any_context.py +0 -0
  98. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/context/any_shared_context.py +0 -0
  99. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/context/context.py +0 -0
  100. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/context/shared_context.py +0 -0
  101. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/dot_dict/__init__.py +0 -0
  102. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/dot_dict/dot_dict.py +0 -0
  103. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/env/__init__.py +0 -0
  104. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/env/any_env.py +0 -0
  105. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/env/env.py +0 -0
  106. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/env/env_file.py +0 -0
  107. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/env/env_map.py +0 -0
  108. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/group/__init__.py +0 -0
  109. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/group/any_group.py +0 -0
  110. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/group/group.py +0 -0
  111. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/input/__init__.py +0 -0
  112. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/input/any_input.py +0 -0
  113. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/input/base_input.py +0 -0
  114. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/input/bool_input.py +0 -0
  115. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/input/float_input.py +0 -0
  116. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/input/int_input.py +0 -0
  117. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/input/option_input.py +0 -0
  118. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/input/password_input.py +0 -0
  119. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/input/str_input.py +0 -0
  120. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/input/text_input.py +0 -0
  121. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/__init__.py +0 -0
  122. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/cli.py +0 -0
  123. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/__init__.py +0 -0
  124. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/group_info_ui/__init__.py +0 -0
  125. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/group_info_ui/controller.py +0 -0
  126. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/group_info_ui/partial/group_info.html +0 -0
  127. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/group_info_ui/partial/group_li.html +0 -0
  128. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/group_info_ui/partial/task_info.html +0 -0
  129. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/group_info_ui/partial/task_li.html +0 -0
  130. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/group_info_ui/view.html +0 -0
  131. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/home_page/__init__.py +0 -0
  132. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/home_page/controller.py +0 -0
  133. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/home_page/partial/group_info.html +0 -0
  134. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/home_page/partial/group_li.html +0 -0
  135. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/home_page/partial/task_info.html +0 -0
  136. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/home_page/partial/task_li.html +0 -0
  137. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/home_page/view.html +0 -0
  138. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/static/favicon-32x32.png +0 -0
  139. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/static/pico.min.css +0 -0
  140. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/task_ui/__init__.py +0 -0
  141. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/task_ui/controller.py +0 -0
  142. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/task_ui/partial/common-util.js +0 -0
  143. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/task_ui/partial/input.html +0 -0
  144. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/task_ui/partial/main.js +0 -0
  145. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/task_ui/partial/show-existing-session.js +0 -0
  146. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/task_ui/partial/visualize-history.js +0 -0
  147. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_controller/task_ui/view.html +0 -0
  148. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/runner/web_util.py +0 -0
  149. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/session/__init__.py +0 -0
  150. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/session/any_session.py +0 -0
  151. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/session/session.py +0 -0
  152. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/session_state_log/__init__.py +0 -0
  153. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/session_state_log/session_state_log.py +0 -0
  154. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/session_state_logger/__init__.py +0 -0
  155. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/session_state_logger/any_session_state_logger.py +0 -0
  156. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/session_state_logger/default_session_state_logger.py +0 -0
  157. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/session_state_logger/file_session_state_logger.py +0 -0
  158. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/__init__.py +0 -0
  159. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/base_trigger.py +0 -0
  160. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/cmd_task.py +0 -0
  161. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/http_check.py +0 -0
  162. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/llm_task.py +0 -0
  163. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/make_task.py +0 -0
  164. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/rsync_task.py +0 -0
  165. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/scaffolder.py +0 -0
  166. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/scheduler.py +0 -0
  167. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/task.py +0 -0
  168. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task/tcp_check.py +0 -0
  169. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task_status/__init__.py +0 -0
  170. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/task_status/task_status.py +0 -0
  171. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/__init__.py +0 -0
  172. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/attr.py +0 -0
  173. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/cli/__init__.py +0 -0
  174. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/cli/style.py +0 -0
  175. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/cli/subcommand.py +0 -0
  176. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/cmd/__init__.py +0 -0
  177. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/cmd/remote.py +0 -0
  178. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/codemod/__init__.py +0 -0
  179. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/codemod/add_code_to_class.py +0 -0
  180. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/codemod/add_code_to_function.py +0 -0
  181. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/codemod/add_code_to_method.py +0 -0
  182. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/codemod/add_key_to_dict.py +0 -0
  183. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/codemod/add_param_to_function_call.py +0 -0
  184. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/codemod/add_property_to_class.py +0 -0
  185. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/cron.py +0 -0
  186. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/group.py +0 -0
  187. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/llm/tool.py +0 -0
  188. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/load.py +0 -0
  189. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/run.py +0 -0
  190. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/string/__init__.py +0 -0
  191. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/string/conversion.py +0 -0
  192. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/string/format.py +0 -0
  193. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/string/name.py +0 -0
  194. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/util/todo.py +0 -0
  195. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/xcom/__init__.py +0 -0
  196. {zrb-1.0.0a5 → zrb-1.0.0a7}/src/zrb/xcom/xcom.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zrb
3
- Version: 1.0.0a5
3
+ Version: 1.0.0a7
4
4
  Summary: Your Automation Powerhouse
5
5
  Home-page: https://github.com/state-alchemists/zrb
6
6
  License: AGPL-3.0-or-later
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "zrb"
3
- version = "1.0.0a5"
3
+ version = "1.0.0a7"
4
4
  description = "Your Automation Powerhouse"
5
5
  authors = ["Go Frendi Gunawan <gofrendiasgard@gmail.com>"]
6
6
  license = "AGPL-3.0-or-later"
@@ -11,6 +11,7 @@ from zrb.util.git import (
11
11
  get_branches,
12
12
  get_current_branch,
13
13
  get_diff,
14
+ get_repo_dir,
14
15
  pull,
15
16
  push,
16
17
  )
@@ -55,7 +56,8 @@ from zrb.util.git import (
55
56
  alias="diff",
56
57
  )
57
58
  def get_git_diff(ctx: AnyContext):
58
- diff = get_diff(ctx.input.source, ctx.input.current)
59
+ repo_dir = get_repo_dir()
60
+ diff = get_diff(repo_dir, ctx.input.source, ctx.input.current)
59
61
  result = []
60
62
  decorated = []
61
63
  if ctx.input.created and diff.created:
@@ -82,14 +84,15 @@ def get_git_diff(ctx: AnyContext):
82
84
  alias="prune",
83
85
  )
84
86
  def prune_local_branches(ctx: AnyContext):
85
- branches = get_branches()
86
- current_branch = get_current_branch()
87
+ repo_dir = get_repo_dir()
88
+ branches = get_branches(repo_dir)
89
+ current_branch = get_current_branch(repo_dir)
87
90
  for branch in branches:
88
91
  if branch == current_branch or branch == "main" or branch == "master":
89
92
  continue
90
93
  ctx.print(stylize_yellow(f"Removing local branch: {branch}"))
91
94
  try:
92
- delete_branch(branch)
95
+ delete_branch(repo_dir, branch)
93
96
  except Exception as e:
94
97
  ctx.log_error(e)
95
98
 
@@ -107,11 +110,12 @@ def prune_local_branches(ctx: AnyContext):
107
110
  alias="commit",
108
111
  )
109
112
  def git_commit(ctx: AnyContext):
113
+ repo_dir = get_repo_dir()
110
114
  ctx.print("Add changes to staging")
111
- add()
115
+ add(repo_dir)
112
116
  ctx.print("Commit changes")
113
117
  try:
114
- commit(ctx.input.message)
118
+ commit(repo_dir, ctx.input.message)
115
119
  except Exception as e:
116
120
  ctx.log_error(e)
117
121
 
@@ -130,10 +134,11 @@ def git_commit(ctx: AnyContext):
130
134
  alias="pull",
131
135
  )
132
136
  def git_pull(ctx: AnyContext):
137
+ repo_dir = get_repo_dir()
133
138
  remote = ctx.input.remote
134
- current_branch = get_current_branch()
139
+ current_branch = get_current_branch(repo_dir)
135
140
  ctx.print(f"Pulling from {remote}/{current_branch}")
136
- pull(remote, current_branch)
141
+ pull(repo_dir, remote, current_branch)
137
142
 
138
143
 
139
144
  @make_task(
@@ -150,7 +155,8 @@ def git_pull(ctx: AnyContext):
150
155
  alias="push",
151
156
  )
152
157
  def git_push(ctx: AnyContext):
158
+ repo_dir = get_repo_dir()
153
159
  remote = ctx.input.remote
154
- current_branch = get_current_branch()
160
+ current_branch = get_current_branch(repo_dir)
155
161
  ctx.print(f"Pushing to {remote}/{current_branch}")
156
- push(remote, current_branch)
162
+ push(repo_dir, remote, current_branch)
@@ -3,6 +3,7 @@ from zrb.builtin.group import git_subtree_group
3
3
  from zrb.context.any_context import AnyContext
4
4
  from zrb.input.str_input import StrInput
5
5
  from zrb.task.make_task import make_task
6
+ from zrb.util.git import get_repo_dir
6
7
  from zrb.util.git_subtree import add_subtree, load_config, pull_subtree, push_subtree
7
8
 
8
9
 
@@ -32,7 +33,9 @@ from zrb.util.git_subtree import add_subtree, load_config, pull_subtree, push_su
32
33
  alias="add",
33
34
  )
34
35
  def git_add_subtree(ctx: AnyContext):
36
+ repo_dir = get_repo_dir()
35
37
  add_subtree(
38
+ repo_dir=repo_dir,
36
39
  name=ctx.input.name,
37
40
  repo_url=ctx.input["repo-url"],
38
41
  branch=ctx.input["repo-branch"],
@@ -48,14 +51,20 @@ def git_add_subtree(ctx: AnyContext):
48
51
  alias="pull",
49
52
  )
50
53
  def git_pull_subtree(ctx: AnyContext):
51
- config = load_config()
54
+ repo_dir = get_repo_dir()
55
+ config = load_config(repo_dir)
52
56
  if not config.data:
53
57
  raise ValueError("No subtree config found")
54
58
  first_err: Exception | None = None
55
59
  for name, detail in config.data.items():
56
60
  try:
57
61
  ctx.print(f"Pull from subtree {name}")
58
- pull_subtree(detail.prefix, detail.repo_url, detail.branch)
62
+ pull_subtree(
63
+ repo_dir=repo_dir,
64
+ prefix=detail.prefix,
65
+ repo_url=detail.repo_url,
66
+ branch=detail.branch,
67
+ )
59
68
  except Exception as e:
60
69
  if first_err is None:
61
70
  first_err = e
@@ -72,14 +81,20 @@ def git_pull_subtree(ctx: AnyContext):
72
81
  alias="push",
73
82
  )
74
83
  def git_push_subtree(ctx: AnyContext):
75
- config = load_config()
84
+ repo_dir = get_repo_dir()
85
+ config = load_config(repo_dir)
76
86
  if not config.data:
77
87
  raise ValueError("No subtree config found")
78
88
  first_err: Exception | None = None
79
89
  for name, detail in config.data.items():
80
90
  try:
81
91
  ctx.print(f"Push to subtree {name}")
82
- push_subtree(detail.prefix, detail.repo_url, detail.branch)
92
+ push_subtree(
93
+ repo_dir=repo_dir,
94
+ prefix=detail.prefix,
95
+ repo_url=detail.repo_url,
96
+ branch=detail.branch,
97
+ )
83
98
  except Exception as e:
84
99
  if first_err is None:
85
100
  first_err = e
@@ -32,3 +32,12 @@ add_to_project_group = project_group.add_group(
32
32
  add_fastapp_to_project_group = add_to_project_group.add_group(
33
33
  Group(name="fastapp", description="🚀 Add Fastapp resources")
34
34
  )
35
+
36
+ setup_group = cli.add_group(Group(name="setup", description="🛠️ Setup"))
37
+ setup_system_group = setup_group.add_group(
38
+ Group(name="system", description="🛠️ Setup system")
39
+ )
40
+ setup_dev_group = setup_group.add_group(Group(name="dev", description="🧑‍💻 Setup dev"))
41
+ setup_service_group = setup_group.add_group(
42
+ Group(name="services", description="🌐 Setup services")
43
+ )
@@ -156,7 +156,6 @@ def todo_log(ctx: AnyContext):
156
156
  todo_task = cascade_todo_task(todo_task)
157
157
  current_duration = todo_task.keyval.get("duration", "0")
158
158
  todo_task.keyval["duration"] = add_durations(current_duration, ctx.input.duration)
159
- print(current_duration, todo_task.keyval)
160
159
  # Save todo list
161
160
  save_todo_list(todo_file_path, todo_list)
162
161
  # Add log work
@@ -77,7 +77,7 @@ BANNER = f"""
77
77
  zzzzz rr bbbbbb {VERSION} Janggala
78
78
  _ _ . . . _ . _ . . .
79
79
 
80
- A Framework to Enhance Your Workflow
80
+ Your Automation Powerhouse
81
81
 
82
82
  ☕ Donate at: https://stalchmst.com/donation
83
83
  🐙 Submit issues/PR at: https://github.com/state-alchemists/zrb
@@ -142,9 +142,3 @@ def create_app(root_group: AnyGroup, port: int = WEB_HTTP_PORT):
142
142
  raise HTTPException(status_code=500, detail=str(e))
143
143
 
144
144
  return app
145
-
146
-
147
- # async def run_web_server(app: FastAPI, port: int = WEB_HTTP_PORT):
148
- # config = Config(app=app, host="0.0.0.0", port=port, loop="asyncio")
149
- # server = Server(config)
150
- # await server.serve()
@@ -74,6 +74,12 @@ class AnyTask(ABC):
74
74
  """Task fallbacks"""
75
75
  pass
76
76
 
77
+ @property
78
+ @abstractmethod
79
+ def successors(self) -> list["AnyTask"]:
80
+ """Task successors"""
81
+ pass
82
+
77
83
  @property
78
84
  @abstractmethod
79
85
  def readiness_checks(self) -> list["AnyTask"]:
@@ -81,8 +87,38 @@ class AnyTask(ABC):
81
87
  pass
82
88
 
83
89
  @abstractmethod
84
- def append_upstreams(self, upstreams: "AnyTask" | list["AnyTask"]):
85
- """Sets the upstream tasks that this task depends on.
90
+ def append_fallback(self, fallbacks: "AnyTask" | list["AnyTask"]):
91
+ """Add the fallback tasks.
92
+
93
+ Args:
94
+ fallbacks (AnyTask | list[AnyTask]): A single fallback task or
95
+ a list of fallback tasks.
96
+ """
97
+ pass
98
+
99
+ @abstractmethod
100
+ def append_successor(self, successors: "AnyTask" | list["AnyTask"]):
101
+ """Add the successor tasks.
102
+
103
+ Args:
104
+ successors (AnyTask | list[AnyTask]): A single successor task or
105
+ a list of successor tasks.
106
+ """
107
+ pass
108
+
109
+ @abstractmethod
110
+ def append_readiness_check(self, readiness_checks: "AnyTask" | list["AnyTask"]):
111
+ """Add the readiness_check tasks.
112
+
113
+ Args:
114
+ readiness_checks (AnyTask | list[AnyTask]): A single readiness_check task or
115
+ a list of readiness_check tasks.
116
+ """
117
+ pass
118
+
119
+ @abstractmethod
120
+ def append_upstream(self, upstreams: "AnyTask" | list["AnyTask"]):
121
+ """Add the upstream tasks that this task depends on.
86
122
 
87
123
  Args:
88
124
  upstreams (AnyTask | list[AnyTask]): A single upstream task or
@@ -38,6 +38,7 @@ class BaseTask(AnyTask):
38
38
  monitor_readiness: bool = False,
39
39
  upstream: list[AnyTask] | AnyTask | None = None,
40
40
  fallback: list[AnyTask] | AnyTask | None = None,
41
+ successor: list[AnyTask] | AnyTask | None = None,
41
42
  ):
42
43
  self._name = name
43
44
  self._color = color
@@ -50,6 +51,7 @@ class BaseTask(AnyTask):
50
51
  self._retry_period = retry_period
51
52
  self._upstreams = upstream
52
53
  self._fallbacks = fallback
54
+ self._successors = successor
53
55
  self._readiness_checks = readiness_check
54
56
  self._readiness_check_delay = readiness_check_delay
55
57
  self._readiness_check_period = readiness_check_period
@@ -65,17 +67,17 @@ class BaseTask(AnyTask):
65
67
  def __rshift__(self, other: AnyTask | list[AnyTask]) -> AnyTask:
66
68
  try:
67
69
  if isinstance(other, AnyTask):
68
- other.append_upstreams(self)
70
+ other.append_upstream(self)
69
71
  elif isinstance(other, list):
70
72
  for task in other:
71
- task.append_upstreams(self)
73
+ task.append_upstream(self)
72
74
  return other
73
75
  except Exception as e:
74
76
  raise ValueError(f"Invalid operation {self} >> {other}: {e}")
75
77
 
76
78
  def __lshift__(self, other: AnyTask | list[AnyTask]) -> AnyTask:
77
79
  try:
78
- self.append_upstreams(other)
80
+ self.append_upstream(other)
79
81
  return self
80
82
  except Exception as e:
81
83
  raise ValueError(f"Invalid operation {self} << {other}: {e}")
@@ -142,6 +144,44 @@ class BaseTask(AnyTask):
142
144
  return [self._fallbacks]
143
145
  return self._fallbacks
144
146
 
147
+ def append_fallback(self, fallbacks: AnyTask | list[AnyTask]):
148
+ fallback_list = [fallbacks] if isinstance(fallbacks, AnyTask) else fallbacks
149
+ for fallback in fallback_list:
150
+ self.__append_fallback(fallback)
151
+
152
+ def __append_fallback(self, fallback: AnyTask):
153
+ # Make sure self._fallbacks is a list
154
+ if self._fallbacks is None:
155
+ self._fallbacks = []
156
+ elif isinstance(self._fallbacks, AnyTask):
157
+ self._fallbacks = [self._fallbacks]
158
+ # Add fallback if it was not on self._fallbacks
159
+ if fallback not in self._fallbacks:
160
+ self._fallbacks.append(fallback)
161
+
162
+ @property
163
+ def successors(self) -> list[AnyTask]:
164
+ if self._successors is None:
165
+ return []
166
+ elif isinstance(self._successors, AnyTask):
167
+ return [self._successors]
168
+ return self._successors
169
+
170
+ def append_successor(self, successors: AnyTask | list[AnyTask]):
171
+ successor_list = [successors] if isinstance(successors, AnyTask) else successors
172
+ for successor in successor_list:
173
+ self.__append_successor(successor)
174
+
175
+ def __append_successor(self, successor: AnyTask):
176
+ # Make sure self._successors is a list
177
+ if self._successors is None:
178
+ self._successors = []
179
+ elif isinstance(self._successors, AnyTask):
180
+ self._successors = [self._successors]
181
+ # Add successor if it was not on self._successors
182
+ if successor not in self._successors:
183
+ self._successors.append(successor)
184
+
145
185
  @property
146
186
  def readiness_checks(self) -> list[AnyTask]:
147
187
  if self._readiness_checks is None:
@@ -150,6 +190,25 @@ class BaseTask(AnyTask):
150
190
  return [self._readiness_checks]
151
191
  return self._readiness_checks
152
192
 
193
+ def append_readiness_check(self, readiness_checks: AnyTask | list[AnyTask]):
194
+ readiness_check_list = (
195
+ [readiness_checks]
196
+ if isinstance(readiness_checks, AnyTask)
197
+ else readiness_checks
198
+ )
199
+ for readiness_check in readiness_check_list:
200
+ self.__append_readiness_check(readiness_check)
201
+
202
+ def __append_readiness_check(self, readiness_check: AnyTask):
203
+ # Make sure self._readiness_checks is a list
204
+ if self._readiness_checks is None:
205
+ self._readiness_checks = []
206
+ elif isinstance(self._readiness_checks, AnyTask):
207
+ self._readiness_checks = [self._readiness_checks]
208
+ # Add readiness_check if it was not on self._readiness_checks
209
+ if readiness_check not in self._readiness_checks:
210
+ self._readiness_checks.append(readiness_check)
211
+
153
212
  @property
154
213
  def upstreams(self) -> list[AnyTask]:
155
214
  if self._upstreams is None:
@@ -158,7 +217,7 @@ class BaseTask(AnyTask):
158
217
  return [self._upstreams]
159
218
  return self._upstreams
160
219
 
161
- def append_upstreams(self, upstreams: AnyTask | list[AnyTask]):
220
+ def append_upstream(self, upstreams: AnyTask | list[AnyTask]):
162
221
  upstream_list = [upstreams] if isinstance(upstreams, AnyTask) else upstreams
163
222
  for upstream in upstream_list:
164
223
  self.__append_upstream(upstream)
@@ -374,6 +433,7 @@ class BaseTask(AnyTask):
374
433
  # Put result on xcom
375
434
  task_xcom: Xcom = ctx.xcom.get(self.name)
376
435
  task_xcom.push(result)
436
+ await run_async(self.__exec_successors(session))
377
437
  return result
378
438
  except (asyncio.CancelledError, KeyboardInterrupt):
379
439
  ctx.log_info("Marked as failed")
@@ -390,6 +450,13 @@ class BaseTask(AnyTask):
390
450
  await run_async(self.__exec_fallbacks(session))
391
451
  raise e
392
452
 
453
+ async def __exec_successors(self, session: AnySession) -> Any:
454
+ successors: list[AnyTask] = self.successors
455
+ successor_coros = [
456
+ run_async(successor.exec_chain(session)) for successor in successors
457
+ ]
458
+ await asyncio.gather(*successor_coros)
459
+
393
460
  async def __exec_fallbacks(self, session: AnySession) -> Any:
394
461
  fallbacks: list[AnyTask] = self.fallbacks
395
462
  fallback_coros = [
@@ -1,3 +1,4 @@
1
+ import os
1
2
  import subprocess
2
3
 
3
4
  from pydantic import BaseModel
@@ -9,14 +10,19 @@ class DiffResult(BaseModel):
9
10
  updated: list[str]
10
11
 
11
12
 
12
- def get_diff(source_commit: str, current_commit: str) -> DiffResult:
13
- # git show b176b5a main
14
- exit_status, output = subprocess.getstatusoutput(
15
- f"git diff {source_commit} {current_commit}"
16
- )
17
- if exit_status != 0:
18
- raise Exception(output)
19
- lines = output.split("\n")
13
+ def get_diff(repo_dir: str, source_commit: str, current_commit: str) -> DiffResult:
14
+ try:
15
+ result = subprocess.run(
16
+ ["git", "diff", source_commit, current_commit],
17
+ stdout=subprocess.PIPE,
18
+ stderr=subprocess.PIPE,
19
+ cwd=repo_dir,
20
+ text=True,
21
+ check=True,
22
+ )
23
+ except subprocess.CalledProcessError as e:
24
+ raise Exception(e.stderr or e.stdout)
25
+ lines = result.stdout.strip().split("\n")
20
26
  diff: dict[str, dict[str, bool]] = {}
21
27
  for line in lines:
22
28
  if not line.startswith("---") and not line.startswith("+++"):
@@ -55,17 +61,18 @@ def get_repo_dir() -> str:
55
61
  check=True,
56
62
  )
57
63
  # Return the directory path
58
- return result.stdout.strip()
64
+ return os.path.abspath(result.stdout.strip())
59
65
  except subprocess.CalledProcessError as e:
60
66
  raise Exception(e.stderr or e.stdout)
61
67
 
62
68
 
63
- def get_current_branch() -> str:
69
+ def get_current_branch(repo_dir: str) -> str:
64
70
  try:
65
71
  result = subprocess.run(
66
72
  ["git", "rev-parse", "--abbrev-ref", "HEAD"],
67
73
  stdout=subprocess.PIPE,
68
74
  stderr=subprocess.PIPE,
75
+ cwd=repo_dir,
69
76
  text=True,
70
77
  check=True,
71
78
  )
@@ -74,12 +81,13 @@ def get_current_branch() -> str:
74
81
  raise Exception(e.stderr or e.stdout)
75
82
 
76
83
 
77
- def get_branches() -> list[str]:
84
+ def get_branches(repo_dir: str) -> list[str]:
78
85
  try:
79
86
  result = subprocess.run(
80
87
  ["git", "branch"],
81
88
  stdout=subprocess.PIPE,
82
89
  stderr=subprocess.PIPE,
90
+ cwd=repo_dir,
83
91
  text=True,
84
92
  check=True,
85
93
  )
@@ -90,12 +98,13 @@ def get_branches() -> list[str]:
90
98
  raise Exception(e.stderr or e.stdout)
91
99
 
92
100
 
93
- def delete_branch(branch_name: str) -> str:
101
+ def delete_branch(repo_dir: str, branch_name: str) -> str:
94
102
  try:
95
103
  result = subprocess.run(
96
104
  ["git", "branch", "-D", branch_name],
97
105
  stdout=subprocess.PIPE,
98
106
  stderr=subprocess.PIPE,
107
+ cwd=repo_dir,
99
108
  text=True,
100
109
  check=True,
101
110
  )
@@ -104,12 +113,13 @@ def delete_branch(branch_name: str) -> str:
104
113
  raise Exception(e.stderr or e.stdout)
105
114
 
106
115
 
107
- def add() -> str:
116
+ def add(repo_dir: str) -> str:
108
117
  try:
109
118
  subprocess.run(
110
119
  ["git", "add", ".", "-A"],
111
120
  stdout=subprocess.PIPE,
112
121
  stderr=subprocess.PIPE,
122
+ cwd=repo_dir,
113
123
  text=True,
114
124
  check=True,
115
125
  )
@@ -117,25 +127,28 @@ def add() -> str:
117
127
  raise Exception(e.stderr or e.stdout)
118
128
 
119
129
 
120
- def commit(message: str) -> str:
130
+ def commit(repo_dir: str, message: str) -> str:
121
131
  try:
122
132
  subprocess.run(
123
133
  ["git", "commit", "-m", message],
124
134
  stdout=subprocess.PIPE,
125
135
  stderr=subprocess.PIPE,
136
+ cwd=repo_dir,
126
137
  text=True,
127
138
  check=True,
128
139
  )
129
140
  except subprocess.CalledProcessError as e:
130
- raise Exception(e.stderr or e.stdout)
141
+ if "nothing to commit, working tree clean" not in e.stderr:
142
+ raise Exception(e.stderr or e.stdout)
131
143
 
132
144
 
133
- def pull(remote: str, branch: str) -> str:
145
+ def pull(repo_dir: str, remote: str, branch: str) -> str:
134
146
  try:
135
147
  subprocess.run(
136
148
  ["git", "pull", remote, branch],
137
149
  stdout=subprocess.PIPE,
138
150
  stderr=subprocess.PIPE,
151
+ cwd=repo_dir,
139
152
  text=True,
140
153
  check=True,
141
154
  )
@@ -143,12 +156,13 @@ def pull(remote: str, branch: str) -> str:
143
156
  raise Exception(e.stderr or e.stdout)
144
157
 
145
158
 
146
- def push(remote: str, branch: str) -> str:
159
+ def push(repo_dir: str, remote: str, branch: str) -> str:
147
160
  try:
148
161
  subprocess.run(
149
162
  ["git", "push", "-u", remote, branch],
150
163
  stdout=subprocess.PIPE,
151
164
  stderr=subprocess.PIPE,
165
+ cwd=repo_dir,
152
166
  text=True,
153
167
  check=True,
154
168
  )
@@ -3,8 +3,6 @@ import subprocess
3
3
 
4
4
  from pydantic import BaseModel
5
5
 
6
- from zrb.util.git import get_repo_dir
7
-
8
6
 
9
7
  class SingleSubTreeConfig(BaseModel):
10
8
  repo_url: str
@@ -16,21 +14,21 @@ class SubTreeConfig(BaseModel):
16
14
  data: dict[str, SingleSubTreeConfig]
17
15
 
18
16
 
19
- def load_config() -> SubTreeConfig:
20
- file_path = os.path.join(get_repo_dir(), "subtrees.json")
17
+ def load_config(repo_dir: str) -> SubTreeConfig:
18
+ file_path = os.path.join(repo_dir, "subtrees.json")
21
19
  if not os.path.exists(file_path):
22
20
  return SubTreeConfig(data={})
23
21
  with open(file_path, "r") as f:
24
22
  return SubTreeConfig.model_validate_json(f.read())
25
23
 
26
24
 
27
- def save_config(config: SubTreeConfig):
28
- file_path = os.path.join(get_repo_dir(), "subtrees.json")
25
+ def save_config(repo_dir: str, config: SubTreeConfig):
26
+ file_path = os.path.join(repo_dir, "subtrees.json")
29
27
  with open(file_path, "w") as f:
30
28
  f.write(config.model_dump_json(indent=2))
31
29
 
32
30
 
33
- def add_subtree(name: str, repo_url: str, branch: str, prefix: str):
31
+ def add_subtree(repo_dir: str, name: str, repo_url: str, branch: str, prefix: str):
34
32
  config = load_config()
35
33
  if os.path.isdir(prefix):
36
34
  raise ValueError(f"Directory exists: {prefix}")
@@ -41,6 +39,7 @@ def add_subtree(name: str, repo_url: str, branch: str, prefix: str):
41
39
  ["git", "subtree", "add", "--prefix", prefix, repo_url, branch],
42
40
  stdout=subprocess.PIPE,
43
41
  stderr=subprocess.PIPE,
42
+ cwd=repo_dir,
44
43
  text=True,
45
44
  check=True,
46
45
  )
@@ -49,10 +48,10 @@ def add_subtree(name: str, repo_url: str, branch: str, prefix: str):
49
48
  config.data[name] = SingleSubTreeConfig(
50
49
  repo_url=repo_url, branch=branch, prefix=prefix
51
50
  )
52
- save_config(config)
51
+ save_config(repo_dir, config)
53
52
 
54
53
 
55
- def pull_subtree(prefix: str, repo_url: str, branch: str):
54
+ def pull_subtree(repo_dir: str, prefix: str, repo_url: str, branch: str):
56
55
  try:
57
56
  subprocess.run(
58
57
  [
@@ -66,6 +65,7 @@ def pull_subtree(prefix: str, repo_url: str, branch: str):
66
65
  ],
67
66
  stdout=subprocess.PIPE,
68
67
  stderr=subprocess.PIPE,
68
+ cwd=repo_dir,
69
69
  text=True,
70
70
  check=True,
71
71
  )
@@ -73,7 +73,7 @@ def pull_subtree(prefix: str, repo_url: str, branch: str):
73
73
  raise Exception(e.stderr or e.stdout)
74
74
 
75
75
 
76
- def push_subtree(prefix: str, repo_url: str, branch: str):
76
+ def push_subtree(repo_dir: str, prefix: str, repo_url: str, branch: str):
77
77
  try:
78
78
  subprocess.run(
79
79
  [
@@ -87,6 +87,7 @@ def push_subtree(prefix: str, repo_url: str, branch: str):
87
87
  ],
88
88
  stdout=subprocess.PIPE,
89
89
  stderr=subprocess.PIPE,
90
+ cwd=repo_dir,
90
91
  text=True,
91
92
  check=True,
92
93
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes