arclith-cli 0.14.0__tar.gz → 0.16.0__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.
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/PKG-INFO +2 -2
- arclith_cli-0.16.0/arclith_cli/__init__.py +1 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/adapter_templates.py +46 -4
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/add_adapter.py +546 -46
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/capabilities.py +483 -42
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/main.py +56 -14
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/pyproject.toml +2 -2
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/tests/e2e_manual.sh +1 -1
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/tests/test_add_adapter.py +754 -216
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/tests/test_capabilities.py +268 -65
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/tests/test_core_scaffold.py +1 -1
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/uv.lock +22 -7
- arclith_cli-0.14.0/arclith_cli/__init__.py +0 -1
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/.gitignore +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/LICENSE +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/Makefile +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/README.md +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/core_scaffold.py +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/entity_scanner.py +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/export_config.py +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/init_project.py +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/project_paths.py +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/rename.py +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/runtime_templates.py +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/scaffold.py +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/arclith_cli/updater.py +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/tests/__init__.py +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/tests/test_e2e_scaffold.py +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/tests/test_project_paths.py +0 -0
- {arclith_cli-0.14.0 → arclith_cli-0.16.0}/tests/test_rename.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: arclith-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0
|
|
4
4
|
Summary: CLI scaffolding tool for arclith — hexagonal architecture framework
|
|
5
5
|
Author-email: Killian KOPP <killiankopp@gmail.com>
|
|
6
6
|
License: Apache License
|
|
@@ -186,7 +186,7 @@ License: Apache License
|
|
|
186
186
|
License-File: LICENSE
|
|
187
187
|
Keywords: arclith,cli,ddd,hexagonal-architecture,scaffold
|
|
188
188
|
Requires-Python: >=3.13
|
|
189
|
-
Requires-Dist: arclith>=0.
|
|
189
|
+
Requires-Dist: arclith>=0.19.0
|
|
190
190
|
Requires-Dist: httpx>=0.27.0
|
|
191
191
|
Requires-Dist: rich>=13.0.0
|
|
192
192
|
Requires-Dist: typer>=0.15.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.16.0"
|
|
@@ -66,6 +66,20 @@ class MariaDB{pascal}Repository(MariaDBRepository[{pascal}], {pascal}Repository)
|
|
|
66
66
|
|
|
67
67
|
# TODO: add custom query methods here
|
|
68
68
|
""",
|
|
69
|
+
"postgresql": """\
|
|
70
|
+
from arclith.adapters.outbound.postgresql.config import PostgreSQLConfig
|
|
71
|
+
from arclith.adapters.outbound.postgresql.repository import PostgreSQLRepository
|
|
72
|
+
from arclith.domain.ports.outbound.logger import Logger
|
|
73
|
+
from {domain_import}.models.{snake} import {pascal}
|
|
74
|
+
from {domain_import}.ports.outbound.{snake}_repository import {pascal}Repository
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class PostgreSQL{pascal}Repository(PostgreSQLRepository[{pascal}], {pascal}Repository):
|
|
78
|
+
def __init__(self, config: PostgreSQLConfig, logger: Logger) -> None:
|
|
79
|
+
super().__init__(config, {pascal}, logger)
|
|
80
|
+
|
|
81
|
+
# TODO: add custom query methods here
|
|
82
|
+
""",
|
|
69
83
|
}
|
|
70
84
|
|
|
71
85
|
# ── repository.py re-export template ─────────────────────────────────────────
|
|
@@ -90,6 +104,11 @@ __all__ = ["DuckDB{pascal}Repository"]
|
|
|
90
104
|
from {adapters_import}.outbound.mariadb.repositories.{snake}_repository import MariaDB{pascal}Repository
|
|
91
105
|
|
|
92
106
|
__all__ = ["MariaDB{pascal}Repository"]
|
|
107
|
+
""",
|
|
108
|
+
"postgresql": """\
|
|
109
|
+
from {adapters_import}.outbound.postgresql.repositories.{snake}_repository import PostgreSQL{pascal}Repository
|
|
110
|
+
|
|
111
|
+
__all__ = ["PostgreSQL{pascal}Repository"]
|
|
93
112
|
""",
|
|
94
113
|
}
|
|
95
114
|
|
|
@@ -152,6 +171,29 @@ def _build_mariadb(cfg: AppConfig, _entity_class: type[{pascal}], log: Logger) -
|
|
|
152
171
|
log,
|
|
153
172
|
)
|
|
154
173
|
|
|
174
|
+
""",
|
|
175
|
+
"postgresql": """\
|
|
176
|
+
def _build_postgresql(cfg: AppConfig, _entity_class: type[{pascal}], log: Logger) -> {pascal}Repository:
|
|
177
|
+
from {adapters_import}.outbound.postgresql.repository import PostgreSQL{pascal}Repository
|
|
178
|
+
from arclith.adapters.outbound.postgresql.config import PostgreSQLConfig
|
|
179
|
+
postgresql = cfg.adapters.postgresql
|
|
180
|
+
if postgresql is None:
|
|
181
|
+
raise ValueError("PostgreSQL settings are required when repository=postgresql")
|
|
182
|
+
return PostgreSQL{pascal}Repository(
|
|
183
|
+
PostgreSQLConfig(
|
|
184
|
+
url=postgresql.url,
|
|
185
|
+
host=postgresql.host,
|
|
186
|
+
port=postgresql.port,
|
|
187
|
+
database=postgresql.database,
|
|
188
|
+
user=postgresql.user,
|
|
189
|
+
password=postgresql.password,
|
|
190
|
+
schema=postgresql.schema_name,
|
|
191
|
+
driver=postgresql.driver,
|
|
192
|
+
table_prefix=postgresql.table_prefix,
|
|
193
|
+
),
|
|
194
|
+
log,
|
|
195
|
+
)
|
|
196
|
+
|
|
155
197
|
""",
|
|
156
198
|
}
|
|
157
199
|
|
|
@@ -169,7 +211,9 @@ def build_{snake}_service(arclith: Arclith) -> tuple[{pascal}Service, Logger]:
|
|
|
169
211
|
"""
|
|
170
212
|
|
|
171
213
|
|
|
172
|
-
def render_container(
|
|
214
|
+
def render_container(
|
|
215
|
+
pascal: str, snake: str, installed_adapters: list[str], import_vars: dict[str, str]
|
|
216
|
+
) -> str:
|
|
173
217
|
"""Generate the full container file content for a given entity and its adapters."""
|
|
174
218
|
# memory is always included (arclith built-in, needs no extra files)
|
|
175
219
|
adapters = list(dict.fromkeys(["memory"] + installed_adapters))
|
|
@@ -182,9 +226,7 @@ def render_container(pascal: str, snake: str, installed_adapters: list[str], imp
|
|
|
182
226
|
if a in _CONTAINER_FACTORY
|
|
183
227
|
)
|
|
184
228
|
registrations = "\n".join(
|
|
185
|
-
f
|
|
186
|
-
for a in adapters
|
|
187
|
-
if a in _CONTAINER_FACTORY
|
|
229
|
+
f' .register("{a}", _build_{a})' for a in adapters if a in _CONTAINER_FACTORY
|
|
188
230
|
)
|
|
189
231
|
footer = _CONTAINER_FOOTER.format(**vars, registrations=registrations)
|
|
190
232
|
return header + factories + footer
|