Move code directly into backend and cli src
This commit is contained in:
@@ -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`.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
"""whisper-remote backend package."""
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
"""whisper-remote CLI package."""
|
||||
Reference in New Issue
Block a user