200 lines
4.3 KiB
TOML
200 lines
4.3 KiB
TOML
[project]
|
|
name = "transcriber"
|
|
version = "0.0.1"
|
|
description = "A python script which uses whisper to transcribe videos and outputs SRT files."
|
|
authors = [{ name = "Doug Scoular", email = "dscoular@gmail.com" }]
|
|
readme = "README.md"
|
|
keywords = ['python']
|
|
requires-python = ">=3.11,<4.0"
|
|
classifiers = [
|
|
"Intended Audience :: Developers",
|
|
"Programming Language :: Python",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3.10",
|
|
"Programming Language :: Python :: 3.11",
|
|
"Programming Language :: Python :: 3.12",
|
|
# "Programming Language :: Python :: 3.13", Waiting for AudioSegment to be updated for 3.13.
|
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
]
|
|
|
|
dependencies = [
|
|
"numpy",
|
|
"pysrt",
|
|
"openai-whisper",
|
|
"pydub"
|
|
]
|
|
|
|
[project.urls]
|
|
Homepage = "https://dscoular.github.io/transcriber/"
|
|
Repository = "https://github.com/dscoular/transcriber"
|
|
Documentation = "https://dscoular.github.io/transcriber/"
|
|
|
|
[project.scripts]
|
|
transcriber = "transcriber.transcribe:main"
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"coverage>=7.11.0",
|
|
"deptry>=0.23.0",
|
|
"mkdocs-coverage>=2.0.0",
|
|
"mkdocs-material>=8.5.10",
|
|
"mkdocs>=1.4.2",
|
|
"mkdocstrings[python]>=0.26.1",
|
|
"mypy>=0.991",
|
|
"pip-review>=1.3.0",
|
|
"pre-commit>=2.20.0",
|
|
"pysonar>=1.2.0",
|
|
"pytest-clarity>=1.0.1",
|
|
"pytest-cov>=4.0.0",
|
|
"pytest-mock>=3.15.0",
|
|
"pytest-sugar>=1.1.0",
|
|
"pytest>=7.2.0",
|
|
"ruff>=0.14.2",
|
|
"tox-uv>=1.29.0",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"coverage>=7.11.0",
|
|
"deptry>=0.23.0",
|
|
"mkdocs-coverage>=2.0.0",
|
|
"mkdocs-material>=9.6.22",
|
|
"mkdocs>=1.4.2",
|
|
"mkdocstrings[python]>=0.26.1",
|
|
"mypy>=0.991",
|
|
"pip-review>=1.3.0",
|
|
"pre-commit>=2.20.0",
|
|
"pysonar>=1.2.0",
|
|
"pytest-clarity>=1.0.1",
|
|
"pytest-cov>=4.0.0",
|
|
"pytest-mock>=3.15.0",
|
|
"pytest-sugar>=1.1.0",
|
|
"pytest>=7.2.0",
|
|
"ruff>=0.14.2",
|
|
"tox-uv>=1.29.0",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src/transcriber"]
|
|
|
|
[tool.mypy]
|
|
files = ["src"]
|
|
disallow_untyped_defs = true
|
|
disallow_any_unimported = true
|
|
no_implicit_optional = true
|
|
check_untyped_defs = true
|
|
warn_return_any = true
|
|
warn_unused_ignores = true
|
|
show_error_codes = true
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = [
|
|
"pysrt",
|
|
"whisper",
|
|
"pydub",
|
|
]
|
|
ignore_missing_imports = true
|
|
|
|
[tool.deptry.per_rule_ignores]
|
|
DEP002 = [
|
|
"coverage",
|
|
"deptry",
|
|
"mkdocs",
|
|
"mkdocs-coverage",
|
|
"mkdocs-material",
|
|
"mkdocstrings",
|
|
"mypy",
|
|
"pip-review",
|
|
"pre-commit",
|
|
"pysonar",
|
|
"pytest",
|
|
"pytest-clarity",
|
|
"pytest-cov",
|
|
"pytest-mock",
|
|
"pytest-sugar",
|
|
"ruff",
|
|
"tox-uv",
|
|
]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
addopts = [
|
|
"--cov=transcriber",
|
|
"--cov-report=term-missing",
|
|
"--cov-report=json",
|
|
"--cov-report=lcov",
|
|
"--cov-report=xml",
|
|
"--cov-report=html",
|
|
"--no-cov-on-fail"
|
|
]
|
|
# Hopefully pydub will get its act together upstream.
|
|
filterwarnings = [
|
|
# Only suppress repetition for SyntaxWarning from pydub (covers "invalid escape sequence")
|
|
"once::SyntaxWarning:pydub.*",
|
|
# Only suppress repetition for deprecation warnings containing "audioop" from pydub.utils
|
|
"once:audioop:DeprecationWarning:pydub.utils",
|
|
]
|
|
|
|
[tool.ruff]
|
|
target-version = "py312"
|
|
line-length = 120
|
|
fix = true
|
|
|
|
[tool.ruff.lint]
|
|
select = [
|
|
# flake8-2020
|
|
"YTT",
|
|
# flake8-bandit
|
|
"S",
|
|
# flake8-bugbear
|
|
"B",
|
|
# flake8-builtins
|
|
"A",
|
|
# flake8-comprehensions
|
|
"C4",
|
|
# flake8-debugger
|
|
"T10",
|
|
# flake8-simplify
|
|
"SIM",
|
|
# isort
|
|
"I",
|
|
# mccabe
|
|
"C90",
|
|
# pycodestyle
|
|
"E", "W",
|
|
# pyflakes
|
|
"F",
|
|
# pygrep-hooks
|
|
"PGH",
|
|
# pyupgrade
|
|
"UP",
|
|
# ruff
|
|
"RUF",
|
|
# tryceratops
|
|
"TRY",
|
|
]
|
|
# ignore = [
|
|
# LineTooLong
|
|
# "E501",
|
|
# DoNotAssignLambda
|
|
# "E731",
|
|
# ]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
# Allow assert() (S101) and long lines (E501) for all files in the tests directory.
|
|
"tests/**" = ["S101", "E501"]
|
|
# Apply the ignore for E501 in the docstring variable for the specific file
|
|
|
|
[tool.ruff.format]
|
|
preview = true
|
|
|
|
[tool.coverage.report]
|
|
skip_empty = true
|
|
|
|
[tool.coverage.run]
|
|
branch = true
|
|
source = ["src"]
|