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
|
```bash
|
||||||
cd backend
|
cd backend
|
||||||
pip install -e .
|
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`.
|
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`.
|
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
|
## Run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install -e .
|
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
|
## API
|
||||||
|
|||||||
@@ -15,10 +15,16 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
whisper-remote-server = "whisper_remote_backend.server:main"
|
whisper-remote-server = "server:main"
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
dev = [
|
dev = [
|
||||||
"httpx>=0.28.0,<1.0.0",
|
"httpx>=0.28.0,<1.0.0",
|
||||||
"pytest>=8.3.0,<9.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
|
from pathlib import Path
|
||||||
|
import sys
|
||||||
|
|
||||||
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
|
||||||
|
|
||||||
from fastapi.testclient import TestClient
|
from fastapi.testclient import TestClient
|
||||||
|
|
||||||
from whisper_remote_backend import server
|
import server
|
||||||
|
|
||||||
|
|
||||||
client = TestClient(server.app)
|
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.
|
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
|
## Run
|
||||||
|
|
||||||
|
|||||||
@@ -18,4 +18,10 @@ dev = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[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
|
import os
|
||||||
from argparse import Namespace
|
from argparse import Namespace
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import sys
|
||||||
|
|
||||||
import pytest
|
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:
|
def test_resolve_server_from_env(monkeypatch) -> None:
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
"""whisper-remote CLI package."""
|
|
||||||
Reference in New Issue
Block a user