zrb 0.6.1__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. zrb/builtin/devtool/aws/install.sh +13 -19
  2. zrb/builtin/devtool/devtool_install.py +100 -31
  3. zrb/builtin/devtool/docker/install.sh +17 -27
  4. zrb/builtin/devtool/gcloud/install.sh +4 -14
  5. zrb/builtin/devtool/gvm/download.sh +6 -9
  6. zrb/builtin/devtool/helix/install.sh +24 -21
  7. zrb/builtin/devtool/pyenv/download.sh +12 -18
  8. zrb/builtin/devtool/selenium/install.sh +8 -13
  9. zrb/builtin/devtool/tmux/install.sh +11 -17
  10. zrb/builtin/devtool/zsh/install.sh +13 -19
  11. zrb/builtin/generator/common/task_input.py +76 -13
  12. zrb/builtin/generator/docker_compose_task/template/src/kebab-zrb-task-name/image/Dockerfile +4 -2
  13. zrb/builtin/generator/docker_compose_task/template/src/kebab-zrb-task-name/image/pyproject.toml +25 -0
  14. zrb/builtin/generator/fastapp/add.py +9 -0
  15. zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/cmd/activate-venv.sh +5 -0
  16. zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/cmd/app-prepare-backend.sh +1 -1
  17. zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/cmd/app-prepare-load-test.sh +1 -2
  18. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/loadtest/pyproject.toml +21 -0
  19. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/Dockerfile +4 -2
  20. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/pyproject.toml +44 -0
  21. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/start.sh +2 -2
  22. zrb/builtin/generator/pip_package/add.py +8 -4
  23. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/activate-venv.sh +5 -0
  24. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/build.sh +1 -1
  25. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/install-symlink.sh +1 -1
  26. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/prepare-venv.sh +1 -2
  27. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/publish.sh +1 -1
  28. zrb/builtin/generator/pip_package/template/src/kebab-zrb-package-name/pyproject.toml +22 -27
  29. zrb/builtin/generator/plugin/create.py +6 -3
  30. zrb/builtin/generator/plugin/template/_cmd/activate-venv.sh +6 -2
  31. zrb/builtin/generator/plugin/template/_cmd/build.sh +1 -1
  32. zrb/builtin/generator/plugin/template/_cmd/install-symlink.sh +1 -1
  33. zrb/builtin/generator/plugin/template/_cmd/prepare-venv.sh +1 -2
  34. zrb/builtin/generator/plugin/template/_cmd/publish.sh +1 -1
  35. zrb/builtin/generator/plugin/template/project.sh +24 -20
  36. zrb/builtin/generator/plugin/template/pyproject.toml +22 -29
  37. zrb/builtin/generator/plugin/template/src/snake_zrb_package_name/__main__.py +5 -0
  38. zrb/builtin/generator/project/create.py +13 -1
  39. zrb/builtin/generator/project/template/project.sh +24 -35
  40. zrb/builtin/generator/project/template/pyproject.toml +21 -0
  41. zrb/builtin/generator/simple_python_app/add.py +9 -0
  42. zrb/builtin/generator/simple_python_app/template/_automate/snake_zrb_app_name/cmd/app-activate-venv.sh +6 -1
  43. zrb/builtin/generator/simple_python_app/template/_automate/snake_zrb_app_name/cmd/app-start.sh +2 -2
  44. zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/Dockerfile +4 -2
  45. zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/pyproject.toml +27 -0
  46. zrb/shell-scripts/_common-util.sh +15 -3
  47. zrb/shell-scripts/ensure-docker-is-installed.sh +17 -17
  48. zrb/shell-scripts/ensure-rsync-is-installed.sh +10 -6
  49. zrb/shell-scripts/ensure-ssh-is-installed.sh +20 -12
  50. zrb/task/notifier.py +16 -0
  51. {zrb-0.6.1.dist-info → zrb-0.7.0.dist-info}/METADATA +26 -28
  52. {zrb-0.6.1.dist-info → zrb-0.7.0.dist-info}/RECORD +220 -222
  53. {zrb-0.6.1.dist-info → zrb-0.7.0.dist-info}/WHEEL +1 -1
  54. zrb/builtin/generator/docker_compose_task/template/src/kebab-zrb-task-name/image/requirements.txt +0 -1
  55. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/loadtest/requirements.txt +0 -1
  56. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/requirements.txt +0 -24
  57. zrb/builtin/generator/pip_package/template/src/kebab-zrb-package-name/requirements.txt +0 -4
  58. zrb/builtin/generator/plugin/template/requirements.txt +0 -4
  59. zrb/builtin/generator/project/template/requirements.txt +0 -1
  60. zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/requirements.txt +0 -1
  61. {zrb-0.6.1.dist-info → zrb-0.7.0.dist-info}/LICENSE +0 -0
  62. {zrb-0.6.1.dist-info → zrb-0.7.0.dist-info}/entry_points.txt +0 -0
@@ -1,13 +1,3 @@
1
- set -e
2
-
3
- # Determine OS type
4
- OS_TYPE=$(uname)
5
-
6
- # Function to check if a command exists
7
- command_exists() {
8
- command -v "$1" &> /dev/null
9
- }
10
-
11
1
  # Install Tmux
12
2
  if command_exists tmux
13
3
  then
@@ -25,22 +15,26 @@ else
25
15
  fi
26
16
  elif [ "$OS_TYPE" = "Linux" ]
27
17
  then
28
- if command_exists apt
18
+ if command_exists pkg
29
19
  then
30
- sudo apt update
31
- sudo apt install -y tmux
20
+ try_sudo pkg update
21
+ try_sudo pkg install -y tmux
22
+ elif command_exists apt
23
+ then
24
+ try_sudo apt update
25
+ try_sudo apt install -y tmux
32
26
  elif command_exists yum
33
27
  then
34
- sudo yum install -y tmux
28
+ try_sudo yum install -y tmux
35
29
  elif command_exists dnf
36
30
  then
37
- sudo dnf install -y tmux
31
+ try_sudo dnf install -y tmux
38
32
  elif command_exists pacman
39
33
  then
40
- sudo pacman -Syu --noconfirm tmux
34
+ try_sudo pacman -Syu --noconfirm tmux
41
35
  elif command_exists snap
42
36
  then
43
- sudo snap install tmux
37
+ try_sudo snap install tmux
44
38
  else
45
39
  echo "No known package manager found. Please install tmux manually."
46
40
  exit 1
@@ -1,13 +1,3 @@
1
- set -e
2
-
3
- # Determine OS type
4
- OS_TYPE=$(uname)
5
-
6
- # Function to check if a command exists
7
- command_exists() {
8
- command -v "$1" &> /dev/null
9
- }
10
-
11
1
  # Install Zsh
12
2
  if command_exists zsh
13
3
  then
@@ -25,22 +15,26 @@ else
25
15
  fi
26
16
  elif [ "$OS_TYPE" = "Linux" ]
27
17
  then
28
- if command_exists apt
18
+ if command_exists pkg
19
+ then
20
+ try_sudo pkg update
21
+ try_sudo pkg install -y zsh
22
+ elif command_exists apt
29
23
  then
30
- sudo apt update
31
- sudo apt install -y zsh
24
+ try_sudo apt update
25
+ try_sudo apt install -y zsh
32
26
  elif command_exists yum
33
27
  then
34
- sudo yum install -y zsh
28
+ try_sudo yum install -y zsh
35
29
  elif command_exists dnf
36
30
  then
37
- sudo dnf install -y zsh
31
+ try_sudo dnf install -y zsh
38
32
  elif command_exists pacman
39
33
  then
40
- sudo pacman -Syu --noconfirm zsh
34
+ try_sudo pacman -Syu --noconfirm zsh
41
35
  elif command_exists snap
42
36
  then
43
- sudo snap install zsh
37
+ try_sudo snap install zsh
44
38
  else
45
39
  echo "No known package manager found. Please install zsh manually."
46
40
  exit 1
@@ -54,7 +48,7 @@ fi
54
48
  if command_exists chsh
55
49
  then
56
50
  echo "Changing default shell to zsh..."
57
- sudo chsh -s "$(command -v zsh)"
51
+ try_sudo chsh -s "$(command -v zsh)"
58
52
  else
59
53
  echo "chsh command not found. Please change the default shell manually."
60
54
  fi
@@ -68,4 +62,4 @@ else
68
62
  fi
69
63
 
70
64
  echo "Installing zinit"
71
- bash -c "$(curl -fsSL https://git.io/zinit-install)"
65
+ bash -c "$(curl -fsSL https://git.io/zinit-install)"
@@ -22,6 +22,27 @@ project_name_input = StrInput(
22
22
  default="",
23
23
  )
24
24
 
25
+ project_author_name_input = StrInput(
26
+ name="project-author-name",
27
+ prompt="Project author name",
28
+ description="Project author name",
29
+ default=SYSTEM_USER,
30
+ )
31
+
32
+ project_author_email_input = StrInput(
33
+ name="project-author-email",
34
+ prompt="Project author email",
35
+ description="Project author email",
36
+ default=f"{SYSTEM_USER}@gmail.com",
37
+ )
38
+
39
+ project_description_input = StrInput(
40
+ name="project-description",
41
+ description="Project description",
42
+ prompt="Project description",
43
+ default="Just another Zrb project",
44
+ )
45
+
25
46
  app_name_input = StrInput(
26
47
  name="app-name",
27
48
  shortcut="a",
@@ -30,6 +51,27 @@ app_name_input = StrInput(
30
51
  default="app",
31
52
  )
32
53
 
54
+ app_author_name_input = StrInput(
55
+ name="app-author-name",
56
+ prompt="App author name",
57
+ description="App author name",
58
+ default=SYSTEM_USER,
59
+ )
60
+
61
+ app_author_email_input = StrInput(
62
+ name="app-author-email",
63
+ prompt="App author email",
64
+ description="App author email",
65
+ default=f"{SYSTEM_USER}@gmail.com",
66
+ )
67
+
68
+ app_description_input = StrInput(
69
+ name="app-description",
70
+ description="App description",
71
+ prompt="App description",
72
+ default="Just another app",
73
+ )
74
+
33
75
  app_image_default_namespace = os.getenv(
34
76
  "PROJECT_IMAGE_DEFAULT_NAMESPACE", "docker.io/" + SYSTEM_USER
35
77
  )
@@ -124,25 +166,46 @@ package_description_input = StrInput(
124
166
  name="package-description",
125
167
  description="Package description",
126
168
  prompt="Package description",
127
- default="My super package",
169
+ default="Just another package",
128
170
  )
129
171
 
130
172
  package_homepage_input = StrInput(
131
173
  name="package-homepage",
132
174
  description="Package homepage",
133
175
  prompt="Package homepage",
134
- default="https://github.com/"
135
- + SYSTEM_USER
136
- + "/{{util.to_kebab_case(input.package_name)}}", # noqa
137
- )
138
-
139
- package_bug_tracker_input = StrInput(
140
- name="package-bug-tracker",
141
- description="Package bug tracker",
142
- prompt="Package bug tracker",
143
- default="https://github.com/"
144
- + SYSTEM_USER
145
- + "/{{util.to_kebab_case(input.package_name)}}/issues", # noqa
176
+ default="".join(
177
+ [
178
+ "https://github.com/",
179
+ SYSTEM_USER,
180
+ "/{{util.to_kebab_case(input.package_name)}}",
181
+ ]
182
+ ),
183
+ )
184
+
185
+ package_repository_input = StrInput(
186
+ name="package-repository",
187
+ description="Package repository",
188
+ prompt="Package homepage",
189
+ default="".join(
190
+ [
191
+ "https://github.com/",
192
+ SYSTEM_USER,
193
+ "/{{util.to_kebab_case(input.package_name)}}",
194
+ ]
195
+ ),
196
+ )
197
+
198
+ package_documentation_input = StrInput(
199
+ name="package-documentation",
200
+ description="Package documentation",
201
+ prompt="Package homepage",
202
+ default="".join(
203
+ [
204
+ "https://github.com/",
205
+ SYSTEM_USER,
206
+ "/{{util.to_kebab_case(input.package_name)}}",
207
+ ]
208
+ ),
146
209
  )
147
210
 
148
211
  package_author_name_input = StrInput(
@@ -2,6 +2,8 @@ FROM python:3.10-slim
2
2
  ENV APP_MESSAGE "Hello, world!"
3
3
  ENV APP_PORT 8080
4
4
  WORKDIR /home
5
+ COPY ./pyproject.toml ./pyproject.toml
6
+ RUN pip install "poetry==1.7.1"
7
+ RUN poetry install --only main --no-root
5
8
  COPY . .
6
- RUN pip install -r requirements.txt
7
- CMD uvicorn main:app --host "0.0.0.0" --port "$APP_PORT"
9
+ CMD poetry run uvicorn main:app --host "0.0.0.0" --port "$APP_PORT"
@@ -0,0 +1,25 @@
1
+ [tool.poetry]
2
+ name = "kebab-zrb-task-name"
3
+ version = "0.0.1"
4
+ description = "A docker compose task"
5
+ authors = ["zrb"]
6
+ packages = [
7
+ {include = "kebab-zrb-task-name", from = "../.."},
8
+ ]
9
+
10
+ [tool.poetry.dependencies]
11
+ python = ">=3.10.0,<4.0.0"
12
+ uvicorn = "==0.20.0"
13
+
14
+ [tool.poetry.dev-dependencies]
15
+ flake8 = "~6.0.0"
16
+ black = "~23.12.1"
17
+ isort = "~5.13.2"
18
+ pytest = "~7.4.0"
19
+ pytest-cov = "~4.1.0"
20
+ pytest-asyncio = "~0.21.0"
21
+ flameprof = "~0.4"
22
+
23
+ [build-system]
24
+ requires = ["poetry-core>=1.0.0"]
25
+ build-backend = "poetry.core.masonry.api"
@@ -6,6 +6,9 @@ from zrb.builtin.generator.common.helper import (
6
6
  )
7
7
  from zrb.builtin.generator.common.task_factory import create_register_module
8
8
  from zrb.builtin.generator.common.task_input import (
9
+ app_author_email_input,
10
+ app_author_name_input,
11
+ app_description_input,
9
12
  app_image_name_input,
10
13
  app_name_input,
11
14
  env_prefix_input,
@@ -58,6 +61,9 @@ copy_resource = ResourceMaker(
58
61
  inputs=[
59
62
  project_dir_input,
60
63
  app_name_input,
64
+ app_description_input,
65
+ app_author_name_input,
66
+ app_author_email_input,
61
67
  app_image_name_input,
62
68
  http_port_input,
63
69
  env_prefix_input,
@@ -65,6 +71,9 @@ copy_resource = ResourceMaker(
65
71
  upstreams=[validate],
66
72
  replacements={
67
73
  "zrbAppName": "{{input.app_name}}",
74
+ "zrbAppDescription": "{{input.app_description}}",
75
+ "zrbAppAuthorName": "{{input.app_author_name}}",
76
+ "zrbAppAuthorEmail": "{{input.app_author_email}}",
68
77
  "zrbAppHttpPort": '{{util.coalesce(input.http_port, "3001")}}',
69
78
  "ZRB_ENV_PREFIX": '{{util.coalesce(input.env_prefix, "MY").upper()}}',
70
79
  "zrb-app-image-name": "{{input.app_image_name}}",
@@ -2,6 +2,11 @@ if [ ! -d .venv ]
2
2
  then
3
3
  echo "Init virtual environment"
4
4
  python -m venv .venv
5
+ source .venv/bin/activate
6
+ echo "Upgrade Pip"
7
+ pip install -U pip
8
+ echo "Install Poetry"
9
+ pip install "poetry==1.7.1"
5
10
  fi
6
11
  echo "Activate virtual environment"
7
12
  source .venv/bin/activate
@@ -1,2 +1,2 @@
1
1
  echo "Install packages"
2
- pip install -r requirements.txt
2
+ poetry install --no-root
@@ -1,3 +1,2 @@
1
1
  echo "Install packages"
2
- pip install -r requirements.txt
3
-
2
+ poetry install --no-root
@@ -0,0 +1,21 @@
1
+ [tool.poetry]
2
+ name = "kebab-zrb-app-name-loadtest"
3
+ version = "0.0.1"
4
+ description = "Load test for zrbPackageName"
5
+ authors = ["zrbAppAuthorName <zrbAppAuthorEmail>"]
6
+ packages = [
7
+ {include = "kebab-zrb-app-name-loadtest", from = "../.."},
8
+ ]
9
+
10
+ [tool.poetry.dependencies]
11
+ python = ">=3.10.0,<4.0.0"
12
+ locust = "==2.16.1"
13
+
14
+ [tool.poetry.dev-dependencies]
15
+ flake8 = "~6.0.0"
16
+ black = "~23.12.1"
17
+ isort = "~5.13.2"
18
+
19
+ [build-system]
20
+ requires = ["poetry-core>=1.0.0"]
21
+ build-backend = "poetry.core.masonry.api"
@@ -9,9 +9,11 @@ FROM python:3.10-slim
9
9
  ENV APP_HOST 0.0.0.0
10
10
  ENV APP_PORT 8080
11
11
  WORKDIR /home
12
- COPY requirements.txt .
13
12
  RUN apt update && apt install curl psmisc -y
14
- RUN pip install -r requirements.txt
13
+ RUN pip install -U pip
14
+ RUN pip install "poetry==1.7.1"
15
+ COPY ./pyproject.toml ./pyproject.toml
16
+ RUN poetry install --only main --no-root
15
17
  COPY . .
16
18
  COPY --from=frontend-builder /frontend/build /home/frontend/build
17
19
  CMD ./start.sh
@@ -0,0 +1,44 @@
1
+ [tool.poetry]
2
+ name = "kebab-zrb-app-name"
3
+ version = "0.0.1"
4
+ description = "zrbAppDescription"
5
+ authors = ["zrbAppAuthorName <zrbAppAuthorEmail>"]
6
+ packages = [
7
+ {include = "kebab-zrb-app-name", from = "../.."},
8
+ ]
9
+
10
+ [tool.poetry.dependencies]
11
+ python = ">=3.10.0,<4.0.0"
12
+ SQLAlchemy= "==2.0.25"
13
+ aiormq= "==6.8.0"
14
+ aiokafka= "==0.10.0"
15
+ alembic= "==1.13.1"
16
+ bcrypt= "==4.1.2"
17
+ fastapi= "==0.109.0"
18
+ jsons= "==1.6.3"
19
+ pydantic= "==2.5.3"
20
+ psycopg2-binary= "==2.9.9"
21
+ python-jose= "==3.3.0"
22
+ uvicorn= "==0.27.0"
23
+ watchfiles= "==0.21.0"
24
+ python-multipart= "==0.0.6"
25
+ python-ulid= "==2.2.0"
26
+ opentelemetry-distro= "==0.40b0"
27
+ opentelemetry-exporter-otlp= "==1.19.0"
28
+ opentelemetry-instrumentation-fastapi= "==0.40b0"
29
+
30
+
31
+ [tool.poetry.dev-dependencies]
32
+ flake8 = "~6.0.0"
33
+ black = "~23.12.1"
34
+ isort = "~5.13.2"
35
+ pytest = "~7.4.0"
36
+ pytest-cov = "~4.1.0"
37
+ pytest-asyncio = "~0.21.0"
38
+ httpx = "~0.24.1"
39
+ asgi-lifespan = "~2.1.0"
40
+ flameprof = "~0.4"
41
+
42
+ [build-system]
43
+ requires = ["poetry-core>=1.0.0"]
44
+ build-backend = "poetry.core.masonry.api"
@@ -44,7 +44,7 @@ then
44
44
  echo "Start uvicorn with instrumentation, service name: ${APP_NAME}"
45
45
  OTEL_RESOURCE_ATTRIBUTES="service.name=${APP_NAME}" \
46
46
  OTEL_EXPORTER_OTLP_ENDPOINT="$APP_OTEL_EXPORTER_OTLP_ENDPOINT" \
47
- opentelemetry-instrument uvicorn main:app --host "$APP_HOST" --port "$APP_PORT"
47
+ poetry run opentelemetry-instrument uvicorn main:app --host "$APP_HOST" --port "$APP_PORT"
48
48
  else
49
49
  # reload should only performed if otel is disabled
50
50
  _RELOAD=""
@@ -54,5 +54,5 @@ else
54
54
  fi
55
55
  # Run uvicorn
56
56
  echo "Start uvicorn"
57
- uvicorn main:app --host "$APP_HOST" --port "$APP_PORT" $_RELOAD
57
+ poetry run uvicorn main:app --host "$APP_HOST" --port "$APP_PORT" $_RELOAD
58
58
  fi
@@ -8,10 +8,11 @@ from zrb.builtin.generator.common.task_factory import create_register_module
8
8
  from zrb.builtin.generator.common.task_input import (
9
9
  package_author_email_input,
10
10
  package_author_name_input,
11
- package_bug_tracker_input,
12
11
  package_description_input,
12
+ package_documentation_input,
13
13
  package_homepage_input,
14
14
  package_name_input,
15
+ package_repository_input,
15
16
  project_dir_input,
16
17
  )
17
18
  from zrb.builtin.group import project_add_group
@@ -44,7 +45,8 @@ copy_resource = ResourceMaker(
44
45
  package_name_input,
45
46
  package_description_input,
46
47
  package_homepage_input,
47
- package_bug_tracker_input,
48
+ package_repository_input,
49
+ package_documentation_input,
48
50
  package_author_name_input,
49
51
  package_author_email_input,
50
52
  ],
@@ -53,7 +55,8 @@ copy_resource = ResourceMaker(
53
55
  "zrbPackageName": "{{input.package_name}}",
54
56
  "zrbPackageDescription": "{{input.package_description}}",
55
57
  "zrbPackageHomepage": "{{input.package_homepage}}",
56
- "zrbPackageBugTracker": "{{input.package_bug_tracker}}",
58
+ "zrbPackageRepository": "{{input.package_repository}}",
59
+ "zrbPackageDocumentation": "{{input.package_documentation}}",
57
60
  "zrbPackageAuthorName": "{{input.package_author_name}}",
58
61
  "zrbPackageAuthorEmail": "{{input.package_author_email}}",
59
62
  },
@@ -81,7 +84,8 @@ register_module = create_register_module(
81
84
  package_name_input,
82
85
  package_description_input,
83
86
  package_homepage_input,
84
- package_bug_tracker_input,
87
+ package_repository_input,
88
+ package_documentation_input,
85
89
  package_author_name_input,
86
90
  package_author_email_input,
87
91
  ],
@@ -2,6 +2,11 @@ if [ ! -d .venv ]
2
2
  then
3
3
  echo "Init virtual environment"
4
4
  python -m venv .venv
5
+ source .venv/bin/activate
6
+ echo "Upgrade Pip"
7
+ pip install -U pip
8
+ echo "Install Poetry"
9
+ pip install "poetry==1.7.1"
5
10
  fi
6
11
  echo "Activate virtual environment"
7
12
  source .venv/bin/activate
@@ -5,4 +5,4 @@ echo "Remove dist"
5
5
  rm -Rf dist
6
6
 
7
7
  echo "Build"
8
- flit build
8
+ poetry build
@@ -1,2 +1,2 @@
1
1
  echo "Install symlink"
2
- flit install --symlink
2
+ poetry install
@@ -1,3 +1,2 @@
1
1
  echo "Install packages"
2
- pip install -r requirements.txt
3
-
2
+ poetry install
@@ -1,2 +1,2 @@
1
1
  echo "Publish"
2
- flit publish --repository {{input.snake_zrb_package_name_repo}}
2
+ poetry publish --repository {{input.snake_zrb_package_name_repo}}
@@ -1,36 +1,31 @@
1
- [build-system]
2
- requires = ["flit_core>=3.4"]
3
- build-backend = "flit_core.buildapi"
4
-
5
- [project]
1
+ [tool.poetry]
6
2
  name = "kebab-zrb-package-name"
7
3
  version = "0.0.1"
8
- authors = [
9
- { name="zrbPackageAuthorName", email="zrbPackageAuthorEmail" },
10
- ]
11
4
  description = "zrbPackageDescription"
5
+ authors = ["zrbPackageAuthorName <zrbPackageAuthorEmail>"]
6
+ license = "AGPL-3.0-or-later"
12
7
  readme = "README.md"
13
- requires-python = ">=3.8"
14
- classifiers = [
15
- "Programming Language :: Python :: 3",
16
- "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
17
- "Operating System :: OS Independent",
18
- ]
19
- dependencies = []
20
-
8
+ homepage = "zrbPackageHomepage"
9
+ repository = "zrbPackageRepository"
10
+ documentation = "zrbPackageDocumentation"
11
+ keywords = []
21
12
 
22
- [project.optional-dependencies]
23
- dev = []
24
- test = []
13
+ [tool.poetry.dependencies]
14
+ python = ">=3.10.0,<4.0.0"
15
+ zrb = ">=zrbVersion"
25
16
 
26
- [project.urls]
27
- "Homepage" = "zrbPackageHomepage"
28
- "Bug Tracker" = "zrbPackageBugTracker"
17
+ [tool.poetry.dev-dependencies]
18
+ flake8 = "~6.0.0"
19
+ black = "~23.12.1"
20
+ isort = "~5.13.2"
21
+ pytest = "~7.4.0"
22
+ pytest-cov = "~4.1.0"
23
+ pytest-asyncio = "~0.21.0"
24
+ flameprof = "~0.4"
29
25
 
30
- [project.scripts]
26
+ [tool.poetry.scripts]
31
27
  kebab-zrb-package-name = "snake_zrb_package_name.__main__:hello"
32
28
 
33
- [tool.pytest.ini_options]
34
- pythonpath = [
35
- "src"
36
- ]
29
+ [build-system]
30
+ requires = ["poetry-core>=1.0.0"]
31
+ build-backend = "poetry.core.masonry.api"
@@ -3,9 +3,10 @@ import os
3
3
  from zrb.builtin.generator.common.task_input import (
4
4
  package_author_email_input,
5
5
  package_author_name_input,
6
- package_bug_tracker_input,
7
6
  package_description_input,
7
+ package_documentation_input,
8
8
  package_homepage_input,
9
+ package_repository_input,
9
10
  project_dir_input,
10
11
  )
11
12
  from zrb.builtin.group import plugin_group
@@ -37,7 +38,8 @@ copy_resource = ResourceMaker(
37
38
  plugin_package_name_input,
38
39
  package_description_input,
39
40
  package_homepage_input,
40
- package_bug_tracker_input,
41
+ package_repository_input,
42
+ package_documentation_input,
41
43
  package_author_name_input,
42
44
  package_author_email_input,
43
45
  ],
@@ -45,7 +47,8 @@ copy_resource = ResourceMaker(
45
47
  "zrbPackageName": "{{input.package_name}}",
46
48
  "zrbPackageDescription": "{{input.package_description}}",
47
49
  "zrbPackageHomepage": "{{input.package_homepage}}",
48
- "zrbPackageBugTracker": "{{input.package_bug_tracker}}",
50
+ "zrbPackageRepository": "{{input.package_repository}}",
51
+ "zrbPackageDocumentation": "{{input.package_documentation}}",
49
52
  "zrbPackageAuthorName": "{{input.package_author_name}}",
50
53
  "zrbPackageAuthorEmail": "{{input.package_author_email}}",
51
54
  "zrbVersion": version,
@@ -2,7 +2,11 @@ if [ ! -d .venv ]
2
2
  then
3
3
  echo "Init virtual environment"
4
4
  python -m venv .venv
5
+ source .venv/bin/activate
6
+ echo "Upgrade Pip"
7
+ pip install -U pip
8
+ echo "Install Poetry"
9
+ pip install "poetry==1.7.1"
5
10
  fi
6
11
  echo "Activate virtual environment"
7
- source .venv/bin/activate
8
-
12
+ source .venv/bin/activate
@@ -5,4 +5,4 @@ echo "Remove dist"
5
5
  rm -Rf dist
6
6
 
7
7
  echo "Build"
8
- flit build
8
+ poetry build
@@ -1,2 +1,2 @@
1
1
  echo "Install symlink"
2
- flit install --symlink
2
+ poetry install
@@ -1,3 +1,2 @@
1
1
  echo "Install packages"
2
- pip install -r requirements.txt
3
-
2
+ poetry install
@@ -1,2 +1,2 @@
1
1
  echo "Publish"
2
- flit publish --repository {{input.plugin_repo}}
2
+ poetry publish --repository {{input.plugin_repo}}