ci(ffmpeg_handling): add main restriction for build task #2
No files matched your search
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "ffmpeg_handling: Run sample command",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/main.py",
|
||||
"args": [
|
||||
"info",
|
||||
"${workspaceFolder}/testfiles/test_auto.mkv"
|
||||
],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${workspaceFolder}/.venv/bin/python3",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": true
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg_handling: Run tests",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/main.py",
|
||||
"args": [
|
||||
"test"
|
||||
],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${workspaceFolder}/.venv/bin/python3",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "ffmpeg_handling: Run tests",
|
||||
"type": "process",
|
||||
"command": "${workspaceFolder}/.venv/bin/python3",
|
||||
"args": [
|
||||
"main.py",
|
||||
"test"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
},
|
||||
"group": "test",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "ffmpeg_handling: Build one-file binary",
|
||||
"type": "process",
|
||||
"command": "${workspaceFolder}/.venv/bin/python3",
|
||||
"args": [
|
||||
"-m",
|
||||
"PyInstaller",
|
||||
"--clean",
|
||||
"--noconfirm",
|
||||
"ffmpeg_handling.spec"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
},
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": false
|
||||
},
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
# Running, testing, and building
|
||||
|
||||
From the repository root, install the build extra and run the test suite:
|
||||
|
||||
```sh
|
||||
uv sync --group build
|
||||
.venv/bin/python3 main.py test
|
||||
```
|
||||
|
||||
In VS Code, use **ffmpeg_handling: Run sample command** or
|
||||
**ffmpeg_handling: Run tests** from Run and Debug. The corresponding test task
|
||||
and **ffmpeg_handling: Build one-file binary** are available from the task
|
||||
picker.
|
||||
|
||||
The one-file build is configured by `ffmpeg_handling/ffmpeg_handling.spec`.
|
||||
Build with:
|
||||
|
||||
```sh
|
||||
.venv/bin/python3 -m PyInstaller --clean --noconfirm \
|
||||
ffmpeg_handling/ffmpeg_handling.spec
|
||||
```
|
||||
|
||||
The executable is written to `ffmpeg_handling/dist/ffmpeg_handling`. It is a
|
||||
single-file Python application; `ffmpeg` and `ffprobe` must still be installed
|
||||
and available on `PATH`. Build separately on each target OS and architecture;
|
||||
PyInstaller does not cross-compile.
|
||||
|
||||
The Gitea workflow in `.gitea/workflows/ffmpeg_handling.yaml` runs tests,
|
||||
Ruff, and the executable build for changes to this project. A successful push
|
||||
to `main` installs the executable as `~/tools/ffmpeg_handling` on the
|
||||
self-hosted Linux x64 runner.
|
||||
Whitespace-only changes.
@@ -0,0 +1,45 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
project_dir = Path(SPECPATH).resolve()
|
||||
repository_dir = project_dir.parent
|
||||
|
||||
analysis = Analysis(
|
||||
[str(project_dir / "src" / "ffmpeg_handling" / "__main__.py")],
|
||||
pathex=[
|
||||
str(project_dir),
|
||||
str(project_dir / "src"),
|
||||
str(repository_dir / "serverlibrary" / "src"),
|
||||
],
|
||||
binaries=[],
|
||||
datas=[],
|
||||
hiddenimports=[],
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
noarchive=False,
|
||||
optimize=0,
|
||||
)
|
||||
pyz = PYZ(analysis.pure)
|
||||
|
||||
exe = EXE(
|
||||
pyz,
|
||||
analysis.scripts,
|
||||
analysis.binaries,
|
||||
analysis.datas,
|
||||
[],
|
||||
name="ffmpeg_handling",
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
upx=False,
|
||||
runtime_tmpdir=None,
|
||||
console=True,
|
||||
disable_windowed_traceback=False,
|
||||
argv_emulation=False,
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
)
|
||||
@@ -0,0 +1,22 @@
|
||||
[project]
|
||||
name = "ffmpeg-handling"
|
||||
version = "0.1.0"
|
||||
description = "Add your description here"
|
||||
readme = "README.md"
|
||||
authors = [
|
||||
{ name = "Lucas Vivo", email = "lucas@mediahost" }
|
||||
]
|
||||
requires-python = ">=3.12"
|
||||
dependencies = [
|
||||
"serverlibrary",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
ffmpeg-handling = "ffmpeg_handling:main"
|
||||
|
||||
[build-system]
|
||||
requires = ["uv_build>=0.12.19,<0.13.0"]
|
||||
build-backend = "uv_build"
|
||||
|
||||
[tool.uv.sources]
|
||||
serverlibrary = { workspace = true }
|
||||
+6
-1
@@ -17,7 +17,6 @@ dependencies = [
|
||||
"cryptography==46.0.7",
|
||||
"cycler==0.12.1",
|
||||
"distro==1.9.0",
|
||||
"ffmpeg-python>=0.2.0",
|
||||
"filelock==3.25.2",
|
||||
"fonttools==4.62.1",
|
||||
"fsspec==2026.3.0",
|
||||
@@ -75,7 +74,13 @@ members = [
|
||||
"serverlibrary",
|
||||
"wallpaper_changer/python",
|
||||
"immich-scripts",
|
||||
"ffmpeg_handling",
|
||||
]
|
||||
|
||||
[tool.uv.sources]
|
||||
serverlibrary = { workspace = true }
|
||||
|
||||
[dependency-groups]
|
||||
build = [
|
||||
"pyinstaller>=6.22.3",
|
||||
]
|
||||
Reference in new issue
Block a user