From cdad6a5dcaa529772294f90121dca6e91cc7637b Mon Sep 17 00:00:00 2001 From: Lucas Vivo Date: Sat, 21 Nov 2026 14:57:30 +0100 Subject: [PATCH] chore(audiobook_library): add project files --- audiobook_library/.vscode/launch.json | 26 ++++++++++++++++++++++ audiobook_library/.vscode/tasks.json | 32 +++++++++++++++++++++++++++ audiobook_library/README.md | 12 ++++++++++ audiobook_library/main.py | 8 +++++++ audiobook_library/pyproject.toml | 24 ++++++++++++++++++++ 5 files changed, 102 insertions(+) create mode 100644 audiobook_library/.vscode/launch.json create mode 100644 audiobook_library/.vscode/tasks.json create mode 100644 audiobook_library/README.md create mode 100755 audiobook_library/main.py create mode 100644 audiobook_library/pyproject.toml diff --git a/audiobook_library/.vscode/launch.json b/audiobook_library/.vscode/launch.json new file mode 100644 index 0000000..46384e2 --- /dev/null +++ b/audiobook_library/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "audiobook_library: Run sample command", + "type": "debugpy", + "request": "launch", + "program": "${workspaceFolder}/main.py", + "args": [], + "cwd": "${workspaceFolder}", + "python": "${workspaceFolder}/.venv/bin/python3", + "console": "integratedTerminal", + "justMyCode": true + }, + { + "name": "audiobook_library: Run tests", + "type": "debugpy", + "request": "launch", + "program": "${workspaceFolder}/run_tests.py", + "cwd": "${workspaceFolder}", + "python": "${workspaceFolder}/.venv/bin/python3", + "console": "integratedTerminal", + "justMyCode": true + } + ] +} diff --git a/audiobook_library/.vscode/tasks.json b/audiobook_library/.vscode/tasks.json new file mode 100644 index 0000000..012b605 --- /dev/null +++ b/audiobook_library/.vscode/tasks.json @@ -0,0 +1,32 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "audiobook_library: Run tests", + "type": "process", + "command": "${workspaceFolder}/.venv/bin/python3", + "args": [ + "run_tests.py" + ], + "options": { + "cwd": "${workspaceFolder}" + }, + "group": "test", + "problemMatcher": [] + }, + { + "label": "audiobook_library: Build package", + "type": "process", + "command": "uv", + "args": ["build"], + "options": { + "cwd": "${workspaceFolder}" + }, + "group": { + "kind": "build", + "isDefault": false + }, + "problemMatcher": [] + } + ] +} diff --git a/audiobook_library/README.md b/audiobook_library/README.md new file mode 100644 index 0000000..e766301 --- /dev/null +++ b/audiobook_library/README.md @@ -0,0 +1,12 @@ +## CI + +The Gitea workflow runs the test suite with generated synthetic media and +database fixtures, and lints with Ruff. On pushes to `main`, it builds a +standalone executable and installs it to `~/tools/audiobook_library` on the +same runners used by ffmpeg_handling. FFmpeg and ffprobe must be available +on the target host. + +To run the suite locally, use `python run_tests.py`. It uses `test/assets` by +default; set `AUDIOBOOK_TEST_ASSETS` to use another fixture directory. CI +fixtures can be generated with `python test/create_ci_fixtures.py `. +Do not commit private audiobook or database fixtures. \ No newline at end of file diff --git a/audiobook_library/main.py b/audiobook_library/main.py new file mode 100755 index 0000000..d5f13b8 --- /dev/null +++ b/audiobook_library/main.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +import sys + +from audiobook_library.cli import main + +if __name__ == "__main__": + sys.exit(main()) diff --git a/audiobook_library/pyproject.toml b/audiobook_library/pyproject.toml new file mode 100644 index 0000000..7de73f4 --- /dev/null +++ b/audiobook_library/pyproject.toml @@ -0,0 +1,24 @@ +[project] +name = "audiobook-library" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +authors = [ + { name = "Lucas Vivo", email = "lucas@mediahost" } +] +requires-python = ">=3.12" +dependencies = [ + "mutagen>=1.47.0", + "requests>=2.33.1", + "serverlibrary", +] + +[project.scripts] +audiobook-library = "audiobook_library:main" + +[build-system] +requires = ["uv_build>=0.12.19,<0.13.0"] +build-backend = "uv_build" + +[tool.uv.sources] +serverlibrary = { path = "../serverlibrary" }