Move code directly into backend and cli src
All checks were successful
CI / Backend (push) Successful in 28s
CI / CLI (push) Successful in 16s

This commit is contained in:
2026-05-24 12:46:40 +02:00
parent 9fd0e707f0
commit c7eda49769
11 changed files with 26 additions and 10 deletions

View File

@@ -14,7 +14,7 @@ The repo also includes a Gitea Actions workflow at `.gitea/workflows/ci.yml` tha
```bash
cd backend
pip install -e .
uvicorn whisper_remote_backend.server:app --host 0.0.0.0 --port 8000
uvicorn server:app --app-dir src --host 0.0.0.0 --port 8000
```
The backend machine must already have the upstream `whisper` CLI available on `PATH`.

View File

@@ -2,13 +2,13 @@
FastAPI wrapper around the upstream `whisper` CLI from `openai/whisper`.
Package layout is flat in this folder: `whisper_remote_backend/server.py`.
Package layout is flat in this folder: `src/server.py`.
## Run
```bash
pip install -e .
uvicorn whisper_remote_backend.server:app --host 0.0.0.0 --port 8000
uvicorn server:app --app-dir src --host 0.0.0.0 --port 8000
```
## API

View File

@@ -15,10 +15,16 @@ dependencies = [
]
[project.scripts]
whisper-remote-server = "whisper_remote_backend.server:main"
whisper-remote-server = "server:main"
[project.optional-dependencies]
dev = [
"httpx>=0.28.0,<1.0.0",
"pytest>=8.3.0,<9.0.0",
]
[tool.setuptools]
py-modules = ["server"]
[tool.setuptools.package-dir]
"" = "src"

View File

@@ -1,8 +1,11 @@
from pathlib import Path
import sys
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
from fastapi.testclient import TestClient
from whisper_remote_backend import server
import server
client = TestClient(server.app)

View File

@@ -1 +0,0 @@
"""whisper-remote backend package."""

View File

@@ -2,7 +2,7 @@
Local CLI that forwards media files to a remote `whisper-remote-backend` server.
Package layout is flat in this folder: `whisper_remote_cli/main.py`.
Package layout is flat in this folder: `src/main.py`.
## Run

View File

@@ -18,4 +18,10 @@ dev = [
]
[project.scripts]
whisper-remote = "whisper_remote_cli.main:main"
whisper-remote = "main:main"
[tool.setuptools]
py-modules = ["main"]
[tool.setuptools.package-dir]
"" = "src"

View File

@@ -1,10 +1,13 @@
import os
from argparse import Namespace
from pathlib import Path
import sys
import pytest
from whisper_remote_cli import main
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
import main
def test_resolve_server_from_env(monkeypatch) -> None:

View File

@@ -1 +0,0 @@
"""whisper-remote CLI package."""