zrb 0.6.2__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 (48) hide show
  1. zrb/builtin/generator/common/task_input.py +76 -13
  2. zrb/builtin/generator/docker_compose_task/template/src/kebab-zrb-task-name/image/Dockerfile +4 -2
  3. zrb/builtin/generator/docker_compose_task/template/src/kebab-zrb-task-name/image/pyproject.toml +25 -0
  4. zrb/builtin/generator/fastapp/add.py +9 -0
  5. zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/cmd/activate-venv.sh +5 -0
  6. zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/cmd/app-prepare-backend.sh +1 -1
  7. zrb/builtin/generator/fastapp/template/_automate/snake_zrb_app_name/cmd/app-prepare-load-test.sh +1 -2
  8. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/loadtest/pyproject.toml +21 -0
  9. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/Dockerfile +4 -2
  10. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/pyproject.toml +44 -0
  11. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/start.sh +2 -2
  12. zrb/builtin/generator/pip_package/add.py +8 -4
  13. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/activate-venv.sh +5 -0
  14. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/build.sh +1 -1
  15. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/install-symlink.sh +1 -1
  16. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/prepare-venv.sh +1 -2
  17. zrb/builtin/generator/pip_package/template/_automate/snake_zrb_package_name/cmd/publish.sh +1 -1
  18. zrb/builtin/generator/pip_package/template/src/kebab-zrb-package-name/pyproject.toml +22 -27
  19. zrb/builtin/generator/plugin/create.py +6 -3
  20. zrb/builtin/generator/plugin/template/_cmd/activate-venv.sh +6 -2
  21. zrb/builtin/generator/plugin/template/_cmd/build.sh +1 -1
  22. zrb/builtin/generator/plugin/template/_cmd/install-symlink.sh +1 -1
  23. zrb/builtin/generator/plugin/template/_cmd/prepare-venv.sh +1 -2
  24. zrb/builtin/generator/plugin/template/_cmd/publish.sh +1 -1
  25. zrb/builtin/generator/plugin/template/project.sh +24 -20
  26. zrb/builtin/generator/plugin/template/pyproject.toml +22 -29
  27. zrb/builtin/generator/plugin/template/src/snake_zrb_package_name/__main__.py +5 -0
  28. zrb/builtin/generator/project/create.py +13 -1
  29. zrb/builtin/generator/project/template/project.sh +24 -35
  30. zrb/builtin/generator/project/template/pyproject.toml +21 -0
  31. zrb/builtin/generator/simple_python_app/add.py +9 -0
  32. zrb/builtin/generator/simple_python_app/template/_automate/snake_zrb_app_name/cmd/app-activate-venv.sh +6 -1
  33. zrb/builtin/generator/simple_python_app/template/_automate/snake_zrb_app_name/cmd/app-start.sh +2 -2
  34. zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/Dockerfile +4 -2
  35. zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/pyproject.toml +27 -0
  36. zrb/shell-scripts/_common-util.sh +5 -1
  37. {zrb-0.6.2.dist-info → zrb-0.7.0.dist-info}/METADATA +26 -28
  38. {zrb-0.6.2.dist-info → zrb-0.7.0.dist-info}/RECORD +207 -209
  39. {zrb-0.6.2.dist-info → zrb-0.7.0.dist-info}/WHEEL +1 -1
  40. zrb/builtin/generator/docker_compose_task/template/src/kebab-zrb-task-name/image/requirements.txt +0 -1
  41. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/loadtest/requirements.txt +0 -1
  42. zrb/builtin/generator/fastapp/template/src/kebab-zrb-app-name/src/requirements.txt +0 -24
  43. zrb/builtin/generator/pip_package/template/src/kebab-zrb-package-name/requirements.txt +0 -4
  44. zrb/builtin/generator/plugin/template/requirements.txt +0 -4
  45. zrb/builtin/generator/project/template/requirements.txt +0 -1
  46. zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/requirements.txt +0 -1
  47. {zrb-0.6.2.dist-info → zrb-0.7.0.dist-info}/LICENSE +0 -0
  48. {zrb-0.6.2.dist-info → zrb-0.7.0.dist-info}/entry_points.txt +0 -0
@@ -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}}
@@ -1,40 +1,43 @@
1
1
  #!/bin/bash
2
2
 
3
- PROJECT_DIR=$(pwd)
4
- echo "🤖 Set project directory to ${PROJECT_DIR}"
3
+ log_progress() {
4
+ echo -e "🤖 \e[0;33m${1}\e[0;0m"
5
+ }
6
+
5
7
 
8
+ init() {
9
+ export PROJECT_DIR=$(pwd)
10
+ log_progress "Setting project directory to ${PROJECT_DIR}"
6
11
 
7
- if [ -z "$PROJECT_USE_VENV" ] || [ "$PROJECT_USE_VENV" = 1 ]
8
- then
9
- if [ ! -d .venv ]
12
+ _IS_EMPTY_VENV=0
13
+ if [ ! -d "${PROJECT_DIR}/.venv" ]
10
14
  then
11
- echo '🤖 Create virtual environment'
15
+ log_progress 'Creating virtual environment'
12
16
  python -m venv "${PROJECT_DIR}/.venv"
13
- echo '🤖 Activate virtual environment'
14
17
  source "${PROJECT_DIR}/.venv/bin/activate"
18
+ pip install --upgrade pip
19
+ pip install "poetry==1.7.1"
20
+ _IS_EMPTY_VENV=1
15
21
  fi
16
22
 
17
- echo '🤖 Activate virtual environment'
23
+ log_progress 'Activating virtual environment'
18
24
  source "${PROJECT_DIR}/.venv/bin/activate"
19
- fi
25
+ }
26
+
20
27
 
21
28
  reload() {
22
29
 
23
30
  if [ ! -f "${PROJECT_DIR}/.env" ]
24
31
  then
25
- echo '🤖 Create project configuration (.env)'
32
+ log_progress 'Creating project configuration (.env)'
26
33
  cp "${PROJECT_DIR}/template.env" "${PROJECT_DIR}/.env"
27
34
  fi
28
35
 
29
- echo '🤖 Load project configuration (.env)'
36
+ log_progress 'Loading project configuration (.env)'
30
37
  source "${PROJECT_DIR}/.env"
31
38
 
32
- if [ -z "$PROJECT_AUTO_INSTALL_PIP" ] || [ "$PROJECT_AUTO_INSTALL_PIP" = 1 ]
33
- then
34
- echo '🤖 Install requirements'
35
- pip install --upgrade pip
36
- pip install -r "${PROJECT_DIR}/requirements.txt"
37
- fi
39
+ log_progress 'Install'
40
+ poetry install
38
41
 
39
42
  _CURRENT_SHELL=$(ps -p $$ | awk 'NR==2 {print $4}')
40
43
  case "$_CURRENT_SHELL" in
@@ -47,12 +50,13 @@ reload() {
47
50
  esac
48
51
  if [ "$_CURRENT_SHELL" = "zsh" ] || [ "$_CURRENT_SHELL" = "bash" ]
49
52
  then
50
- echo "🤖 Set up shell completion for $_CURRENT_SHELL"
53
+ log_progress "Setting up shell completion for $_CURRENT_SHELL"
51
54
  eval "$(_ZRB_COMPLETE=${_CURRENT_SHELL}_source zrb)"
52
55
  else
53
- echo "🤖 Cannot set up shell completion for $_CURRENT_SHELL"
56
+ log_progress "Cannot set up shell completion for $_CURRENT_SHELL"
54
57
  fi
55
58
  }
56
59
 
60
+ init
57
61
  reload
58
- echo '🤖 Happy Coding :)'
62
+ log_progress 'Happy Coding :)'
@@ -1,38 +1,31 @@
1
- [build-system]
2
- requires = ["flit_core>=3.4"]
3
- build-backend = "flit_core.buildapi"
4
-
5
- [project]
1
+ [tool.poetry]
6
2
  name = "kebab-zrb-package-name"
7
3
  version = "0.0.1"
8
- authors = [
9
- { name="zrbPackageAuthorName", email="zrbPackageAuthorEmail" },
10
- ]
11
4
  description = "zrbPackageDescription"
5
+ authors = ["zrbPackageAuthorName <zrbPackageAuthorEmail>"]
6
+ license = "AGPL-3.0-or-later"
12
7
  readme = "README.md"
13
- requires-python = ">=3.8"
14
- classifiers = [
15
- "Programming Language :: Python :: 3",
16
- "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
17
- "Operating System :: OS Independent",
18
- ]
19
- dependencies = [
20
- "zrb>=zrbVersion"
21
- ]
22
-
8
+ homepage = "zrbPackageHomepage"
9
+ repository = "zrbPackageRepository"
10
+ documentation = "zrbPackageDocumentation"
11
+ keywords = []
23
12
 
24
- [project.optional-dependencies]
25
- dev = []
26
- test = []
13
+ [tool.poetry.dependencies]
14
+ python = ">=3.10.0,<4.0.0"
15
+ zrb = ">=zrbVersion"
27
16
 
28
- [project.urls]
29
- "Homepage" = "zrbPackageHomepage"
30
- "Bug Tracker" = "zrbPackageBugTracker"
17
+ [tool.poetry.dev-dependencies]
18
+ flake8 = "~6.0.0"
19
+ black = "~23.12.1"
20
+ isort = "~5.13.2"
21
+ pytest = "~7.4.0"
22
+ pytest-cov = "~4.1.0"
23
+ pytest-asyncio = "~0.21.0"
24
+ flameprof = "~0.4"
31
25
 
32
- [project.scripts]
26
+ [tool.poetry.scripts]
33
27
  kebab-zrb-package-name = "snake_zrb_package_name.__main__:main"
34
28
 
35
- [tool.pytest.ini_options]
36
- pythonpath = [
37
- "src"
38
- ]
29
+ [build-system]
30
+ requires = ["poetry-core>=1.0.0"]
31
+ build-backend = "poetry.core.masonry.api"
@@ -1,3 +1,8 @@
1
1
  from .task.example_task import ExampleTask
2
2
 
3
3
  assert ExampleTask
4
+
5
+
6
+ def main():
7
+ fn = ExampleTask.to_function()
8
+ fn()