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:
@@ -110,20 +110,22 @@ live-play websocket lives.
|
||||
|
||||
## Development
|
||||
|
||||
Backend (from `server/`):
|
||||
Backend (from `server/`), using [uv](https://docs.astral.sh/uv/):
|
||||
|
||||
```sh
|
||||
cd server
|
||||
python3 -m venv .venv
|
||||
.venv/bin/pip install -r requirements.txt
|
||||
.venv/bin/pip install -e ./packages/tavolo-platform -e ./packages/tavolo-scopone -e ./packages/tavolo-scopa -e ./packages/tavolo-briscola -e './packages/tavolo-app[dev]'
|
||||
.venv/bin/python -m unittest discover -s tests -t .
|
||||
.venv/bin/python -m unittest discover -s packages/tavolo-platform/tests
|
||||
.venv/bin/python -m unittest discover -s packages/tavolo-scopone/tests
|
||||
.venv/bin/python -m unittest discover -s packages/tavolo-scopa/tests
|
||||
.venv/bin/python -m unittest discover -s packages/tavolo-briscola/tests
|
||||
uv sync --package tavolo-app --extra otel
|
||||
uv run python -m unittest discover -s tests -t .
|
||||
uv run python -m unittest discover -s packages/tavolo-platform/tests
|
||||
uv run python -m unittest discover -s packages/tavolo-scopone/tests
|
||||
uv run python -m unittest discover -s packages/tavolo-scopa/tests
|
||||
uv run python -m unittest discover -s packages/tavolo-briscola/tests
|
||||
```
|
||||
|
||||
The `otel` extra is optional; without it the telemetry integration tests
|
||||
skip. Development tools (`mypy`, `httpx-ws`) are installed by default from
|
||||
the workspace's `dev` dependency group.
|
||||
|
||||
Frontend (from `web/`), with the backend running on :8080:
|
||||
|
||||
```sh
|
||||
@@ -142,7 +144,7 @@ OIDC_0_CLIENT_ID=tavolo \
|
||||
OIDC_0_REDIRECT_URI=http://localhost:8080/auth/default/callback \
|
||||
OIDC_0_POST_LOGIN_REDIRECT=http://localhost:8000/ \
|
||||
OIDC_0_POST_LOGOUT_REDIRECT=http://localhost:8000/ \
|
||||
.venv/bin/granian --host 127.0.0.1 --port 8080 tavolo.app:app
|
||||
uv run granian --host 127.0.0.1 --port 8080 tavolo.app:app
|
||||
```
|
||||
|
||||
Card images are committed under `web/assets/cards/`; `web/fetch-cards.sh`
|
||||
|
||||
Reference in New Issue
Block a user