Skip to content

Commit 4a9c98b

Browse files
committed
migrate to uv and modern package structure
1 parent 2dcf1f1 commit 4a9c98b

19 files changed

+788
-143
lines changed
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Package
1+
name: Test Package
22

33
on:
44
push:
@@ -11,21 +11,28 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["3.8", "3.9", "3.10", "3.11"]
14+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v3
1820
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v4
20-
with:
21-
python-version: ${{ matrix.python-version }}
21+
run: uv python install ${{ matrix.python-version }}
2222
- name: Install ffmpeg
2323
run: |
2424
sudo apt-get update -y
2525
sudo apt-get install -y ffmpeg
2626
- name: Install dependencies
2727
run: |
28-
python -m pip install --upgrade pip
29-
python -m pip install tox tox-gh-actions
30-
- name: Test with tox
31-
run: tox
28+
uv sync --group dev
29+
- name: Lint with ruff
30+
run: |
31+
uv run ruff check .
32+
uv run ruff format --check .
33+
- name: Type check with mypy
34+
run: |
35+
uv run mypy .
36+
- name: Test with pytest
37+
run: |
38+
uv run pytest

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.12.11
4+
hooks:
5+
- id: ruff
6+
args: [--fix]
7+
- id: ruff-format

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,25 @@ Contents:
2828

2929
## Requirements
3030

31-
- Python 3.8 or higher
31+
- Python 3.9 or higher
3232
- FFmpeg:
33-
- download a static build from [their website](http://ffmpeg.org/download.html)
34-
- put the `ffprobe` executable in your `$PATH`
33+
- download a static build from [their website](http://ffmpeg.org/download.html)
34+
- put the `ffprobe` executable in your `$PATH`
3535

3636
## Installation
3737

38+
Simply run it via [uv](https://docs.astral.sh/uv/getting-started/installation/):
39+
3840
```bash
39-
pip3 install ffmpeg_bitrate_stats
41+
uvx ffmpeg-bitrate-stats
4042
```
4143

42-
Or clone this repository, then run the tool with `python -m ffmpeg_bitrate_stats`
44+
Or install via [pipx](https://pipx.pypa.io/latest/installation/).
45+
Or with pip:
46+
47+
```bash
48+
pip3 install --user ffmpeg_bitrate_stats
49+
```
4350

4451
## Usage
4552

@@ -120,6 +127,7 @@ ffmpeg-bitrate-stats -a time -c 30 -of json BigBuckBunny.mp4
120127
```
121128

122129
This returns:
130+
123131
```json
124132
{
125133
"input_file": "BigBuckBunny.mp4",

docs/ffmpeg_bitrate_stats.html

Lines changed: 32 additions & 30 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[build-system]
2+
requires = ["uv_build>=0.8.14,<0.9.0"]
3+
build-backend = "uv_build"
4+
5+
[project]
6+
name = "ffmpeg_bitrate_stats"
7+
version = "1.1.2"
8+
description = "Calculate bitrate statistics using FFmpeg"
9+
readme = "README.md"
10+
authors = [
11+
{ name = "Werner Robitza", email = "[email protected]" }
12+
]
13+
license = "MIT"
14+
license-files = ["LICENSE.md"]
15+
requires-python = ">=3.9"
16+
classifiers = [
17+
"Development Status :: 4 - Beta",
18+
"Intended Audience :: Developers",
19+
"Topic :: Multimedia :: Video",
20+
"License :: OSI Approved :: MIT License",
21+
"Programming Language :: Python :: 3",
22+
"Programming Language :: Python :: 3.9",
23+
"Programming Language :: Python :: 3.10",
24+
"Programming Language :: Python :: 3.11",
25+
"Programming Language :: Python :: 3.12",
26+
"Programming Language :: Python :: 3.13",
27+
]
28+
dependencies = [
29+
"numpy",
30+
"pandas",
31+
"plotille",
32+
]
33+
34+
[project.urls]
35+
Homepage = "https://github.com/slhck/ffmpeg-bitrate-stats"
36+
Repository = "https://github.com/slhck/ffmpeg-bitrate-stats"
37+
38+
[project.scripts]
39+
ffmpeg-bitrate-stats = "ffmpeg_bitrate_stats.__main__:main"
40+
41+
[dependency-groups]
42+
dev = [
43+
"pytest >=8.1.1,<9",
44+
"ruff>=0.12.11",
45+
"mypy",
46+
"pdoc>=15.0.4",
47+
]
48+
49+
[tool.mypy]
50+
python_version = "3.13"
51+
ignore_missing_imports = true
52+
exclude = ["build"]
53+
namespace_packages = false

requirements.dev.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 38 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 55 deletions
This file was deleted.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import importlib.metadata
2+
13
from .bitrate_stats import BitrateStats, BitrateStatsSummary, run_command
24

3-
__version__ = "1.1.2"
5+
__version__ = importlib.metadata.version("ffmpeg_bitrate_stats")
46

57
__all__ = ["BitrateStats", "BitrateStatsSummary", "run_command"]

0 commit comments

Comments
 (0)