Move tavolo-app under packages/ for a uniform monorepo layout
CI / Build and push docker image (push) Successful in 2m29s
CI / Build and push docker image (push) Successful in 2m29s
Relocate the composition root (app, config, static, logging_config, aerich_config) from server/src/tavolo/ to packages/tavolo-app/src/tavolo/, with its own pyproject.toml and README like the sibling distributions. Module paths and the granian entrypoint are unchanged. server/pyproject.toml remains as a tooling shim ([tool.aerich] next to ./migrations, [tool.mypy] for runs from server/); the Dockerfile installs all three distributions from ./packages. Verified: all suites green, mypy clean per package, aerich resolves the moved config identically, wheel builds.
This commit is contained in:
+11
-12
@@ -13,7 +13,7 @@ and [`packages/tavolo-scopone/README.md`](packages/tavolo-scopone/README.md)):
|
||||
- **`tavolo-scopone`** (`packages/tavolo-scopone/`) — scopone
|
||||
scientifico, the four-player, fixed-partnership variant of the classic
|
||||
Italian card game: pure rules plus the platform adapter.
|
||||
- **`tavolo-app`** (`src/tavolo/`, this `pyproject.toml`) — the
|
||||
- **`tavolo-app`** (`packages/tavolo-app/`) — the
|
||||
composition root wiring the platform to the scopone game, with the
|
||||
environment-driven settings and the SPA shell.
|
||||
|
||||
@@ -279,18 +279,15 @@ must dismiss. A play attempted in this phase is rejected with an
|
||||
```sh
|
||||
python3 -m venv .venv
|
||||
.venv/bin/pip install -r requirements.txt
|
||||
.venv/bin/pip install -e ./packages/tavolo-platform -e ./packages/tavolo-scopone -e '.[dev]'
|
||||
.venv/bin/pip install -e ./packages/tavolo-platform -e ./packages/tavolo-scopone -e './packages/tavolo-app[dev]'
|
||||
# app integration suite:
|
||||
.venv/bin/python -m unittest discover -s tests -t .
|
||||
# per-package suites (each package is self-contained):
|
||||
.venv/bin/python -m unittest discover -s packages/tavolo-platform/tests
|
||||
.venv/bin/python -m unittest discover -s packages/tavolo-scopone/tests
|
||||
# type checks:
|
||||
# type checks (see packages/tavolo-app/README.md for the app modules):
|
||||
.venv/bin/python -m mypy -p tavolo.platform
|
||||
.venv/bin/python -m mypy -p tavolo.scopone
|
||||
.venv/bin/python -m mypy --namespace-packages --explicit-package-bases \
|
||||
src/tavolo/app.py src/tavolo/config.py src/tavolo/static.py \
|
||||
src/tavolo/aerich_config.py src/tavolo/logging_config.py
|
||||
```
|
||||
|
||||
Tests run fully in-process: in-memory sqlite for Postgres, in-memory stores
|
||||
@@ -348,12 +345,14 @@ packages/tavolo-scopone/ # scopone scientifico game (own pyproject + tests)
|
||||
├── engine.py # pure scopone scientifico rules
|
||||
├── errors.py # scopone-specific rule violations
|
||||
└── plugin.py # ScoponeEngine: the GameEngine adapter
|
||||
src/tavolo/ # tavolo-app: composition root (this pyproject.toml)
|
||||
├── app.py # session/OIDC/Tortoise/OpenAPI/Platform/DeadlineScheduler mixins
|
||||
├── config.py # env -> frozen Settings
|
||||
├── aerich_config.py # aerich CLI configuration
|
||||
├── logging_config.py # logging setup
|
||||
└── static.py # SPA shell hosting
|
||||
packages/tavolo-app/ # deployable app: composition root (own pyproject)
|
||||
src/tavolo/
|
||||
├── app.py # session/OIDC/Tortoise/OpenAPI/Platform/DeadlineScheduler mixins
|
||||
├── config.py # env -> frozen Settings
|
||||
├── aerich_config.py # aerich CLI configuration
|
||||
├── logging_config.py # logging setup
|
||||
└── static.py # SPA shell hosting
|
||||
pyproject.toml # tooling shim: [tool.aerich] + [tool.mypy] for server/ CWD
|
||||
migrations/ # aerich migrations for the platform models
|
||||
tests/ # app integration suite (platform + scopone wired together)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user