Migrate the backend from pip to uv
Replace requirements.txt with a uv workspace and lockfile, install the five tavolo packages from packages/* in development and non-editable in the image, and build the Docker image with uv. Move dev tools to a PEP 735 dependency group and refresh the locked dependency versions.
This commit is contained in:
@@ -29,7 +29,7 @@ The deployable tavolo application: the composition root wiring
|
||||
## Development (from `packages/tavolo-app/`)
|
||||
|
||||
```sh
|
||||
.venv/bin/python -m mypy --namespace-packages --explicit-package-bases \
|
||||
uv run mypy --namespace-packages --explicit-package-bases \
|
||||
src/tavolo/app.py \
|
||||
src/tavolo/config.py \
|
||||
src/tavolo/telemetry.py \
|
||||
|
||||
@@ -31,10 +31,6 @@ dependencies = [
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"mypy",
|
||||
"httpx-ws",
|
||||
]
|
||||
otel = [
|
||||
"kaya-otel>=0.0.7",
|
||||
"opentelemetry-instrumentation-asyncpg>=0.66b0",
|
||||
@@ -42,6 +38,12 @@ otel = [
|
||||
"opentelemetry-instrumentation-system-metrics>=0.66b0",
|
||||
]
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"mypy",
|
||||
"httpx-ws",
|
||||
]
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["src"]
|
||||
namespaces = true
|
||||
|
||||
@@ -92,8 +92,8 @@ the match), so the hand-ack timeout is accepted but unused.
|
||||
## Development (from `server/`)
|
||||
|
||||
```sh
|
||||
.venv/bin/python -m unittest discover -s packages/tavolo-briscola/tests
|
||||
.venv/bin/python -m mypy -p tavolo.briscola
|
||||
uv run python -m unittest discover -s packages/tavolo-briscola/tests
|
||||
uv run mypy -p tavolo.briscola
|
||||
```
|
||||
|
||||
`test_engine.py`/`test_plugin.py` cover the two classic variants;
|
||||
|
||||
@@ -58,8 +58,8 @@ examples are [`tavolo-scopone`](../tavolo-scopone/README.md),
|
||||
## Development (from `server/`)
|
||||
|
||||
```sh
|
||||
.venv/bin/python -m unittest discover -s packages/tavolo-platform/tests
|
||||
.venv/bin/python -m mypy -p tavolo.platform
|
||||
uv run python -m unittest discover -s packages/tavolo-platform/tests
|
||||
uv run mypy -p tavolo.platform
|
||||
```
|
||||
|
||||
Tests run fully in-process against a `DummyEngine` (a two-player toy game
|
||||
|
||||
@@ -36,8 +36,8 @@ application composition root.
|
||||
## Development (from `server/`)
|
||||
|
||||
```sh
|
||||
.venv/bin/python -m unittest discover -s packages/tavolo-scopa/tests
|
||||
.venv/bin/python -m mypy -p tavolo.scopa
|
||||
uv run python -m unittest discover -s packages/tavolo-scopa/tests
|
||||
uv run mypy -p tavolo.scopa
|
||||
```
|
||||
|
||||
`test_engine.py` covers the pure rules; `test_plugin.py` covers the
|
||||
|
||||
@@ -31,8 +31,8 @@ application composition root.
|
||||
## Development (from `server/`)
|
||||
|
||||
```sh
|
||||
.venv/bin/python -m unittest discover -s packages/tavolo-scopone/tests
|
||||
.venv/bin/python -m mypy -p tavolo.scopone
|
||||
uv run python -m unittest discover -s packages/tavolo-scopone/tests
|
||||
uv run mypy -p tavolo.scopone
|
||||
```
|
||||
|
||||
`test_engine.py` covers the pure rules; `test_plugin.py` covers the
|
||||
|
||||
Reference in New Issue
Block a user