paststack 0.1.0__tar.gz → 0.1.2__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.
- paststack-0.1.2/PKG-INFO +47 -0
- paststack-0.1.2/README.md +31 -0
- paststack-0.1.2/paststack/__init__.py +1 -0
- paststack-0.1.2/paststack/__main__.py +3 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/cli.py +36 -6
- paststack-0.1.2/paststack.egg-info/PKG-INFO +47 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack.egg-info/SOURCES.txt +1 -0
- {paststack-0.1.0 → paststack-0.1.2}/pyproject.toml +2 -2
- {paststack-0.1.0 → paststack-0.1.2}/tests/test_cli_generation.py +5 -1
- paststack-0.1.0/PKG-INFO +0 -129
- paststack-0.1.0/README.md +0 -113
- paststack-0.1.0/paststack/__init__.py +0 -1
- paststack-0.1.0/paststack.egg-info/PKG-INFO +0 -129
- {paststack-0.1.0 → paststack-0.1.2}/LICENSE +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/banner.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/combinations.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/models.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/prompts.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/.env.example +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/.gitignore +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/README.md +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/pyproject.toml +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/src/app/__init__.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/src/app/api/__init__.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/src/app/api/deps.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/src/app/api/router.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/src/app/api/routes/__init__.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/src/app/api/routes/health.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/src/app/core/__init__.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/src/app/core/config.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/src/app/database.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/src/app/main.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/src/app/models/__init__.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/base/src/app/schemas/__init__.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/postgres/docker-compose.yml +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/postgres/none/database.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/postgres/sqlmodel/api/deps.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/postgres/sqlmodel/database.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/postgres/sqlmodel/models/__init__.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/sqlite/none/database.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/sqlite/sqlmodel/api/deps.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/sqlite/sqlmodel/database.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/sqlite/sqlmodel/models/__init__.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack/templates/rate_limiting/src/app/core/rate_limit.py +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack.egg-info/dependency_links.txt +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack.egg-info/entry_points.txt +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack.egg-info/requires.txt +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/paststack.egg-info/top_level.txt +0 -0
- {paststack-0.1.0 → paststack-0.1.2}/setup.cfg +0 -0
paststack-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: paststack
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Opinionated CLI to generate production-ready FastAPI boilerplate with typing and linting.
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Repository, https://github.com/initd-fr/paststack
|
|
7
|
+
Requires-Python: >=3.12
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: click>=8.1.0
|
|
11
|
+
Requires-Dist: pydantic>=2.12.5
|
|
12
|
+
Requires-Dist: questionary>=2.1.1
|
|
13
|
+
Requires-Dist: rich>=13.0.0
|
|
14
|
+
Requires-Dist: typer>=0.24.1
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# paststack
|
|
18
|
+
|
|
19
|
+
CLI to generate production-ready FastAPI backends (uv, SQLite/Postgres, optional SQLModel, slowapi).
|
|
20
|
+
|
|
21
|
+
## Install (PyPI)
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install -U paststack
|
|
25
|
+
paststack
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Si le terminal intégré **VS Code** n’affiche pas les questions, utilise **Terminal.app** / **iTerm**, ou : `python -m paststack` (même venv).
|
|
29
|
+
|
|
30
|
+
## Develop
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clone https://github.com/initd-fr/paststack.git
|
|
34
|
+
cd paststack
|
|
35
|
+
uv sync
|
|
36
|
+
uv pip install -e .
|
|
37
|
+
paststack
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Tests
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
uv sync --group dev
|
|
44
|
+
uv run pytest tests/ -q
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
MIT License.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# paststack
|
|
2
|
+
|
|
3
|
+
CLI to generate production-ready FastAPI backends (uv, SQLite/Postgres, optional SQLModel, slowapi).
|
|
4
|
+
|
|
5
|
+
## Install (PyPI)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install -U paststack
|
|
9
|
+
paststack
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Si le terminal intégré **VS Code** n’affiche pas les questions, utilise **Terminal.app** / **iTerm**, ou : `python -m paststack` (même venv).
|
|
13
|
+
|
|
14
|
+
## Develop
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
git clone https://github.com/initd-fr/paststack.git
|
|
18
|
+
cd paststack
|
|
19
|
+
uv sync
|
|
20
|
+
uv pip install -e .
|
|
21
|
+
paststack
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Tests
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
uv sync --group dev
|
|
28
|
+
uv run pytest tests/ -q
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
MIT License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.2"
|
|
@@ -69,6 +69,13 @@ def _subprocess_env_without_venv() -> dict[str, str]:
|
|
|
69
69
|
return env
|
|
70
70
|
|
|
71
71
|
|
|
72
|
+
def _uv_env_for_generated_project(project_root: Path) -> dict[str, str]:
|
|
73
|
+
"""Force uv à cibler le projet généré (évite de sync le mauvais pyproject en remontant l’arborescence)."""
|
|
74
|
+
env = _subprocess_env_without_venv()
|
|
75
|
+
env["UV_PROJECT"] = str(project_root.resolve())
|
|
76
|
+
return env
|
|
77
|
+
|
|
78
|
+
|
|
72
79
|
def _docker_compose_up_postgres(project_root: Path) -> bool:
|
|
73
80
|
"""Démarre le conteneur Postgres du projet. Retourne False si Docker indisponible ou échec."""
|
|
74
81
|
if not (project_root / "docker-compose.yml").is_file():
|
|
@@ -126,10 +133,24 @@ def _uv_extras(project: Project) -> list[str]:
|
|
|
126
133
|
return extras
|
|
127
134
|
|
|
128
135
|
|
|
129
|
-
@click.command()
|
|
130
136
|
def main() -> None:
|
|
137
|
+
# Ne pas bloquer sur isatty() : le terminal intégré VS Code peut le signaler à tort.
|
|
138
|
+
if not (sys.stdin.isatty() and sys.stdout.isatty()):
|
|
139
|
+
click.echo(
|
|
140
|
+
click.style(
|
|
141
|
+
"Note : stdin/stdout ne semblent pas être un TTY — si les questions ne "
|
|
142
|
+
"s’affichent pas, lance paststack dans Terminal.app / iTerm ou "
|
|
143
|
+
"`python -m paststack`.",
|
|
144
|
+
fg="yellow",
|
|
145
|
+
),
|
|
146
|
+
err=True,
|
|
147
|
+
)
|
|
131
148
|
try:
|
|
132
149
|
display_banner()
|
|
150
|
+
sys.stdout.flush()
|
|
151
|
+
sys.stderr.flush()
|
|
152
|
+
click.echo(click.style("Configuration du projet (réponds aux questions ci-dessous)…\n", fg="cyan"))
|
|
153
|
+
sys.stdout.flush()
|
|
133
154
|
while True:
|
|
134
155
|
project = ask_questions()
|
|
135
156
|
show_summary(project)
|
|
@@ -240,8 +261,9 @@ def setup_project(project: Project) -> None:
|
|
|
240
261
|
if project.rate_limiting:
|
|
241
262
|
_copy_template_tree(RATE_LIMITING, main_directory, project, extra)
|
|
242
263
|
|
|
243
|
-
venv_path = (main_directory /
|
|
264
|
+
venv_path = (main_directory / ".venv").resolve()
|
|
244
265
|
py_exe = _venv_python(venv_path).resolve()
|
|
266
|
+
uv_env = _uv_env_for_generated_project(main_directory)
|
|
245
267
|
|
|
246
268
|
with Progress(
|
|
247
269
|
SpinnerColumn(),
|
|
@@ -261,7 +283,14 @@ def setup_project(project: Project) -> None:
|
|
|
261
283
|
|
|
262
284
|
if project.run_install:
|
|
263
285
|
uv_extras = _uv_extras(project)
|
|
264
|
-
cmd = [
|
|
286
|
+
cmd = [
|
|
287
|
+
"uv",
|
|
288
|
+
"sync",
|
|
289
|
+
"--project",
|
|
290
|
+
str(main_directory.resolve()),
|
|
291
|
+
"-p",
|
|
292
|
+
str(py_exe),
|
|
293
|
+
]
|
|
265
294
|
for e in uv_extras:
|
|
266
295
|
cmd.append(f"--extra={e}")
|
|
267
296
|
t_sync = progress.add_task("uv sync (dépendances)…", total=1)
|
|
@@ -269,13 +298,12 @@ def setup_project(project: Project) -> None:
|
|
|
269
298
|
cmd,
|
|
270
299
|
cwd=main_directory,
|
|
271
300
|
check=True,
|
|
272
|
-
env=
|
|
301
|
+
env=uv_env,
|
|
273
302
|
)
|
|
274
303
|
progress.update(t_sync, completed=1)
|
|
275
304
|
|
|
276
305
|
if project.git_z:
|
|
277
306
|
subprocess.run(["git", "init"], cwd=main_directory, check=True)
|
|
278
|
-
# --default : config git-z sans wizard interactif (sinon le CLI semble « figé »)
|
|
279
307
|
result = subprocess.run(
|
|
280
308
|
["git", "z", "init", "--default"],
|
|
281
309
|
cwd=main_directory,
|
|
@@ -340,6 +368,8 @@ def setup_project(project: Project) -> None:
|
|
|
340
368
|
[
|
|
341
369
|
"uv",
|
|
342
370
|
"run",
|
|
371
|
+
"--project",
|
|
372
|
+
str(main_directory.resolve()),
|
|
343
373
|
"--python",
|
|
344
374
|
str(py_exe),
|
|
345
375
|
"uvicorn",
|
|
@@ -349,5 +379,5 @@ def setup_project(project: Project) -> None:
|
|
|
349
379
|
"src",
|
|
350
380
|
],
|
|
351
381
|
cwd=main_directory,
|
|
352
|
-
env=
|
|
382
|
+
env=uv_env,
|
|
353
383
|
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: paststack
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Opinionated CLI to generate production-ready FastAPI boilerplate with typing and linting.
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Repository, https://github.com/initd-fr/paststack
|
|
7
|
+
Requires-Python: >=3.12
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: click>=8.1.0
|
|
11
|
+
Requires-Dist: pydantic>=2.12.5
|
|
12
|
+
Requires-Dist: questionary>=2.1.1
|
|
13
|
+
Requires-Dist: rich>=13.0.0
|
|
14
|
+
Requires-Dist: typer>=0.24.1
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# paststack
|
|
18
|
+
|
|
19
|
+
CLI to generate production-ready FastAPI backends (uv, SQLite/Postgres, optional SQLModel, slowapi).
|
|
20
|
+
|
|
21
|
+
## Install (PyPI)
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install -U paststack
|
|
25
|
+
paststack
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Si le terminal intégré **VS Code** n’affiche pas les questions, utilise **Terminal.app** / **iTerm**, ou : `python -m paststack` (même venv).
|
|
29
|
+
|
|
30
|
+
## Develop
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clone https://github.com/initd-fr/paststack.git
|
|
34
|
+
cd paststack
|
|
35
|
+
uv sync
|
|
36
|
+
uv pip install -e .
|
|
37
|
+
paststack
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Tests
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
uv sync --group dev
|
|
44
|
+
uv run pytest tests/ -q
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
MIT License.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "paststack"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.2"
|
|
8
8
|
description = "Opinionated CLI to generate production-ready FastAPI boilerplate with typing and linting."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -48,5 +48,5 @@ dev = [
|
|
|
48
48
|
"mypy>=1.19.1",
|
|
49
49
|
"pytest>=8.0.0",
|
|
50
50
|
"ruff>=0.15.7",
|
|
51
|
-
"twine>=6.
|
|
51
|
+
"twine>=6.0.0",
|
|
52
52
|
]
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"""Tests de génération du projet pour chaque combinaison (fichiers + cohérence)."""
|
|
2
|
+
|
|
1
3
|
from __future__ import annotations
|
|
2
4
|
|
|
3
5
|
import subprocess
|
|
@@ -39,7 +41,9 @@ def no_server_prompt(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
|
39
41
|
|
|
40
42
|
|
|
41
43
|
def test_combination_count_matches_iter() -> None:
|
|
42
|
-
assert combination_count() == sum(
|
|
44
|
+
assert combination_count() == sum(
|
|
45
|
+
1 for _ in iter_database_orm_rate_limit_triples()
|
|
46
|
+
)
|
|
43
47
|
assert combination_count() == 10
|
|
44
48
|
|
|
45
49
|
|
paststack-0.1.0/PKG-INFO
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: paststack
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: Opinionated CLI to generate production-ready FastAPI boilerplate with typing and linting.
|
|
5
|
-
License-Expression: MIT
|
|
6
|
-
Project-URL: Repository, https://github.com/initd-fr/paststack
|
|
7
|
-
Requires-Python: >=3.12
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Requires-Dist: click>=8.1.0
|
|
11
|
-
Requires-Dist: pydantic>=2.12.5
|
|
12
|
-
Requires-Dist: questionary>=2.1.1
|
|
13
|
-
Requires-Dist: rich>=13.0.0
|
|
14
|
-
Requires-Dist: typer>=0.24.1
|
|
15
|
-
Dynamic: license-file
|
|
16
|
-
|
|
17
|
-
# paststack
|
|
18
|
-
|
|
19
|
-

|
|
20
|
-
|
|
21
|
-
A CLI to generate production-ready FastAPI backends with a clean, opinionated architecture.
|
|
22
|
-
|
|
23
|
-

|
|
24
|
-

|
|
25
|
-

|
|
26
|
-

|
|
27
|
-

|
|
28
|
-

|
|
29
|
-

|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Vue d’ensemble
|
|
34
|
-
|
|
35
|
-
**paststack** génère un projet prêt au développement : arborescence `src/app/` (core, api, routes, models, schemas), configuration **pydantic-settings**, CORS, santé `/health` et `/ready`.
|
|
36
|
-
|
|
37
|
-
Décisions actuelles de la v1 :
|
|
38
|
-
|
|
39
|
-
| Sujet | Choix |
|
|
40
|
-
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
41
|
-
| Gestionnaire de paquets | **uv** |
|
|
42
|
-
| Base de données | **none**, **SQLite**, **PostgreSQL** |
|
|
43
|
-
| Couche données | **sans ORM** (driver async) ou **SQLModel** (ORM unique) |
|
|
44
|
-
| Rate limiting | **slowapi** (optionnel), limite par IP |
|
|
45
|
-
| PostgreSQL | **docker-compose** fourni ; URL alignée sur le conteneur |
|
|
46
|
-
| Dépendances | **extras** dans le `pyproject.toml` généré (`sqlite-none`, `sqlite-sqlmodel`, `postgres-none`, `postgres-sqlmodel`, `rate-limit`) |
|
|
47
|
-
| Git | `git init` optionnel |
|
|
48
|
-
| Messages de commit | **[git-z](https://github.com/ejpcmac/git-z)** optionnel (`git z init` dans le projet généré) |
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Fonctionnalités
|
|
53
|
-
|
|
54
|
-
- Assistant interactif (`questionary`) : nom du projet, CORS, base, ORM, rate limiting, installation `uv`, git, git-z
|
|
55
|
-
- Copie des templates embarqués dans le package (`templates/**/*`)
|
|
56
|
-
- Création d’un venv + `uv sync` avec les bons `--extra` si demandé
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Utilisation
|
|
61
|
-
|
|
62
|
-
Une fois le package installé (`pip install paststack` depuis PyPI, ou `uv pip install -e .` depuis ce dépôt) :
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
paststack
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Puis ouvrir le dossier créé, copier `.env.example` vers `.env`, lancer l’API (voir le `README.md` généré dans le projet).
|
|
69
|
-
|
|
70
|
-
### Développement (ce dépôt)
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
git clone https://github.com/initd-fr/paststack.git
|
|
74
|
-
cd paststack
|
|
75
|
-
uv sync
|
|
76
|
-
uv pip install -e .
|
|
77
|
-
paststack
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Qualité (ce dépôt)
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
uv run ruff check .
|
|
84
|
-
uv run mypy .
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Tests (ce dépôt)
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
uv sync --group dev
|
|
91
|
-
uv run pytest tests/ -v
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Les combinaisons valides (SGBD × ORM × rate limiting) sont exposées dans `paststack.combinations` pour les tests ou un usage programmatique.
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## Conventions de commit (ce dépôt)
|
|
99
|
-
|
|
100
|
-
Format décrit dans `git-z.toml` : `TYPE description (scope)` (types et scopes listés dans le fichier).
|
|
101
|
-
|
|
102
|
-
Pour utiliser l’assistant [git-z](https://github.com/ejpcmac/git-z) en local : `git z init` (après installation de l’outil). Le générateur peut lancer `git z init` dans le **nouveau** projet si tu coches l’option correspondante.
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
## Feuille de route (indicative)
|
|
107
|
-
|
|
108
|
-
### v0.x — générateur actuel
|
|
109
|
-
|
|
110
|
-
- [x] CLI interactive + modèle `Project` typé
|
|
111
|
-
- [x] Template FastAPI (`core`, `api`, routes, models, schemas)
|
|
112
|
-
- [x] SQLite / Postgres × ORM ou driver seul
|
|
113
|
-
- [x] Rate limiting (slowapi) en option
|
|
114
|
-
- [x] Venv + `uv sync` avec extras
|
|
115
|
-
- [x] `git init` / `git z init` en option
|
|
116
|
-
|
|
117
|
-
### Plus tard
|
|
118
|
-
|
|
119
|
-
- Variantes d’architecture (minimal / modulable avancée), autres SGBD, observabilité, etc.
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## Pourquoi ce projet
|
|
124
|
-
|
|
125
|
-
Poser une base FastAPI propre (structure, typing, lint, DB) prend du temps. Ce CLI applique les mêmes défauts à chaque nouveau service.
|
|
126
|
-
|
|
127
|
-
## Licence
|
|
128
|
-
|
|
129
|
-
MIT
|
paststack-0.1.0/README.md
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# paststack
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
A CLI to generate production-ready FastAPI backends with a clean, opinionated architecture.
|
|
6
|
-
|
|
7
|
-

|
|
8
|
-

|
|
9
|
-

|
|
10
|
-

|
|
11
|
-

|
|
12
|
-

|
|
13
|
-

|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Vue d’ensemble
|
|
18
|
-
|
|
19
|
-
**paststack** génère un projet prêt au développement : arborescence `src/app/` (core, api, routes, models, schemas), configuration **pydantic-settings**, CORS, santé `/health` et `/ready`.
|
|
20
|
-
|
|
21
|
-
Décisions actuelles de la v1 :
|
|
22
|
-
|
|
23
|
-
| Sujet | Choix |
|
|
24
|
-
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
25
|
-
| Gestionnaire de paquets | **uv** |
|
|
26
|
-
| Base de données | **none**, **SQLite**, **PostgreSQL** |
|
|
27
|
-
| Couche données | **sans ORM** (driver async) ou **SQLModel** (ORM unique) |
|
|
28
|
-
| Rate limiting | **slowapi** (optionnel), limite par IP |
|
|
29
|
-
| PostgreSQL | **docker-compose** fourni ; URL alignée sur le conteneur |
|
|
30
|
-
| Dépendances | **extras** dans le `pyproject.toml` généré (`sqlite-none`, `sqlite-sqlmodel`, `postgres-none`, `postgres-sqlmodel`, `rate-limit`) |
|
|
31
|
-
| Git | `git init` optionnel |
|
|
32
|
-
| Messages de commit | **[git-z](https://github.com/ejpcmac/git-z)** optionnel (`git z init` dans le projet généré) |
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Fonctionnalités
|
|
37
|
-
|
|
38
|
-
- Assistant interactif (`questionary`) : nom du projet, CORS, base, ORM, rate limiting, installation `uv`, git, git-z
|
|
39
|
-
- Copie des templates embarqués dans le package (`templates/**/*`)
|
|
40
|
-
- Création d’un venv + `uv sync` avec les bons `--extra` si demandé
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Utilisation
|
|
45
|
-
|
|
46
|
-
Une fois le package installé (`pip install paststack` depuis PyPI, ou `uv pip install -e .` depuis ce dépôt) :
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
paststack
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Puis ouvrir le dossier créé, copier `.env.example` vers `.env`, lancer l’API (voir le `README.md` généré dans le projet).
|
|
53
|
-
|
|
54
|
-
### Développement (ce dépôt)
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
git clone https://github.com/initd-fr/paststack.git
|
|
58
|
-
cd paststack
|
|
59
|
-
uv sync
|
|
60
|
-
uv pip install -e .
|
|
61
|
-
paststack
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Qualité (ce dépôt)
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
uv run ruff check .
|
|
68
|
-
uv run mypy .
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Tests (ce dépôt)
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
uv sync --group dev
|
|
75
|
-
uv run pytest tests/ -v
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Les combinaisons valides (SGBD × ORM × rate limiting) sont exposées dans `paststack.combinations` pour les tests ou un usage programmatique.
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Conventions de commit (ce dépôt)
|
|
83
|
-
|
|
84
|
-
Format décrit dans `git-z.toml` : `TYPE description (scope)` (types et scopes listés dans le fichier).
|
|
85
|
-
|
|
86
|
-
Pour utiliser l’assistant [git-z](https://github.com/ejpcmac/git-z) en local : `git z init` (après installation de l’outil). Le générateur peut lancer `git z init` dans le **nouveau** projet si tu coches l’option correspondante.
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## Feuille de route (indicative)
|
|
91
|
-
|
|
92
|
-
### v0.x — générateur actuel
|
|
93
|
-
|
|
94
|
-
- [x] CLI interactive + modèle `Project` typé
|
|
95
|
-
- [x] Template FastAPI (`core`, `api`, routes, models, schemas)
|
|
96
|
-
- [x] SQLite / Postgres × ORM ou driver seul
|
|
97
|
-
- [x] Rate limiting (slowapi) en option
|
|
98
|
-
- [x] Venv + `uv sync` avec extras
|
|
99
|
-
- [x] `git init` / `git z init` en option
|
|
100
|
-
|
|
101
|
-
### Plus tard
|
|
102
|
-
|
|
103
|
-
- Variantes d’architecture (minimal / modulable avancée), autres SGBD, observabilité, etc.
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## Pourquoi ce projet
|
|
108
|
-
|
|
109
|
-
Poser une base FastAPI propre (structure, typing, lint, DB) prend du temps. Ce CLI applique les mêmes défauts à chaque nouveau service.
|
|
110
|
-
|
|
111
|
-
## Licence
|
|
112
|
-
|
|
113
|
-
MIT
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.0"
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: paststack
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: Opinionated CLI to generate production-ready FastAPI boilerplate with typing and linting.
|
|
5
|
-
License-Expression: MIT
|
|
6
|
-
Project-URL: Repository, https://github.com/initd-fr/paststack
|
|
7
|
-
Requires-Python: >=3.12
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Requires-Dist: click>=8.1.0
|
|
11
|
-
Requires-Dist: pydantic>=2.12.5
|
|
12
|
-
Requires-Dist: questionary>=2.1.1
|
|
13
|
-
Requires-Dist: rich>=13.0.0
|
|
14
|
-
Requires-Dist: typer>=0.24.1
|
|
15
|
-
Dynamic: license-file
|
|
16
|
-
|
|
17
|
-
# paststack
|
|
18
|
-
|
|
19
|
-

|
|
20
|
-
|
|
21
|
-
A CLI to generate production-ready FastAPI backends with a clean, opinionated architecture.
|
|
22
|
-
|
|
23
|
-

|
|
24
|
-

|
|
25
|
-

|
|
26
|
-

|
|
27
|
-

|
|
28
|
-

|
|
29
|
-

|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Vue d’ensemble
|
|
34
|
-
|
|
35
|
-
**paststack** génère un projet prêt au développement : arborescence `src/app/` (core, api, routes, models, schemas), configuration **pydantic-settings**, CORS, santé `/health` et `/ready`.
|
|
36
|
-
|
|
37
|
-
Décisions actuelles de la v1 :
|
|
38
|
-
|
|
39
|
-
| Sujet | Choix |
|
|
40
|
-
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
41
|
-
| Gestionnaire de paquets | **uv** |
|
|
42
|
-
| Base de données | **none**, **SQLite**, **PostgreSQL** |
|
|
43
|
-
| Couche données | **sans ORM** (driver async) ou **SQLModel** (ORM unique) |
|
|
44
|
-
| Rate limiting | **slowapi** (optionnel), limite par IP |
|
|
45
|
-
| PostgreSQL | **docker-compose** fourni ; URL alignée sur le conteneur |
|
|
46
|
-
| Dépendances | **extras** dans le `pyproject.toml` généré (`sqlite-none`, `sqlite-sqlmodel`, `postgres-none`, `postgres-sqlmodel`, `rate-limit`) |
|
|
47
|
-
| Git | `git init` optionnel |
|
|
48
|
-
| Messages de commit | **[git-z](https://github.com/ejpcmac/git-z)** optionnel (`git z init` dans le projet généré) |
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Fonctionnalités
|
|
53
|
-
|
|
54
|
-
- Assistant interactif (`questionary`) : nom du projet, CORS, base, ORM, rate limiting, installation `uv`, git, git-z
|
|
55
|
-
- Copie des templates embarqués dans le package (`templates/**/*`)
|
|
56
|
-
- Création d’un venv + `uv sync` avec les bons `--extra` si demandé
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Utilisation
|
|
61
|
-
|
|
62
|
-
Une fois le package installé (`pip install paststack` depuis PyPI, ou `uv pip install -e .` depuis ce dépôt) :
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
paststack
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Puis ouvrir le dossier créé, copier `.env.example` vers `.env`, lancer l’API (voir le `README.md` généré dans le projet).
|
|
69
|
-
|
|
70
|
-
### Développement (ce dépôt)
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
git clone https://github.com/initd-fr/paststack.git
|
|
74
|
-
cd paststack
|
|
75
|
-
uv sync
|
|
76
|
-
uv pip install -e .
|
|
77
|
-
paststack
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Qualité (ce dépôt)
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
uv run ruff check .
|
|
84
|
-
uv run mypy .
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Tests (ce dépôt)
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
uv sync --group dev
|
|
91
|
-
uv run pytest tests/ -v
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Les combinaisons valides (SGBD × ORM × rate limiting) sont exposées dans `paststack.combinations` pour les tests ou un usage programmatique.
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## Conventions de commit (ce dépôt)
|
|
99
|
-
|
|
100
|
-
Format décrit dans `git-z.toml` : `TYPE description (scope)` (types et scopes listés dans le fichier).
|
|
101
|
-
|
|
102
|
-
Pour utiliser l’assistant [git-z](https://github.com/ejpcmac/git-z) en local : `git z init` (après installation de l’outil). Le générateur peut lancer `git z init` dans le **nouveau** projet si tu coches l’option correspondante.
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
## Feuille de route (indicative)
|
|
107
|
-
|
|
108
|
-
### v0.x — générateur actuel
|
|
109
|
-
|
|
110
|
-
- [x] CLI interactive + modèle `Project` typé
|
|
111
|
-
- [x] Template FastAPI (`core`, `api`, routes, models, schemas)
|
|
112
|
-
- [x] SQLite / Postgres × ORM ou driver seul
|
|
113
|
-
- [x] Rate limiting (slowapi) en option
|
|
114
|
-
- [x] Venv + `uv sync` avec extras
|
|
115
|
-
- [x] `git init` / `git z init` en option
|
|
116
|
-
|
|
117
|
-
### Plus tard
|
|
118
|
-
|
|
119
|
-
- Variantes d’architecture (minimal / modulable avancée), autres SGBD, observabilité, etc.
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## Pourquoi ce projet
|
|
124
|
-
|
|
125
|
-
Poser une base FastAPI propre (structure, typing, lint, DB) prend du temps. Ce CLI applique les mêmes défauts à chaque nouveau service.
|
|
126
|
-
|
|
127
|
-
## Licence
|
|
128
|
-
|
|
129
|
-
MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/postgres/docker-compose.yml
RENAMED
|
File without changes
|
|
File without changes
|
{paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/postgres/sqlmodel/api/deps.py
RENAMED
|
File without changes
|
{paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/postgres/sqlmodel/database.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/sqlite/sqlmodel/api/deps.py
RENAMED
|
File without changes
|
{paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/sqlite/sqlmodel/database.py
RENAMED
|
File without changes
|
{paststack-0.1.0 → paststack-0.1.2}/paststack/templates/database/sqlite/sqlmodel/models/__init__.py
RENAMED
|
File without changes
|
{paststack-0.1.0 → paststack-0.1.2}/paststack/templates/rate_limiting/src/app/core/rate_limit.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|