Files
epub-tts/pyproject.toml
renatoxsrandCopilot ffbf2f21be [epub-tts] Vendor aedocw backends and add adapter subclasses
- Add git submodules under src/vendor for the aedocw repositories:
  - epub2tts, epub2tts-edge, epub2tts-chatterbox, epub2tts-kokoro
- Add adapter modules in src/epub_tts to run vendored packages in isolated venvs:
  - vendor_utils.py (creates/uses per-repo .venv and installs package)
  - epub2tts.py, epub2tts_edge.py, epub2tts_chatterbox.py, epub2tts_kokoro.py
- Add aedocw_backend.py providing AedocwBackend and concrete subclasses that
  dispatch to the vendored adapters when selected via the CLI.
- Add tts_edge shim for backward compatibility.
- Register new backends in src/epub_tts/__main__.py and invoke the selected
  backend at runtime.
- Update pyproject.toml to exclude vendored packages from setuptools package
  discovery.

This change vendors upstream tools while providing thin adapters that invoke
their CLIs inside isolated virtualenvs, and integrates them into the
epub-tts backend registry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-06 15:56:27 -03:00

128 lines
3.3 KiB
TOML

[build-system]
requires = ["setuptools>=61.0.0", "setuptools-scm[simple]>=9.2"]
build-backend = "setuptools.build_meta"
[project]
name = "epub-tts"
dynamic = ["version"]
description = "Python project to gather several projects that convert EPUB files to audiobooks (M4B files, mostly), with different TTS backends."
readme = "README.md"
# Minimum could probably be 3.10, but wasn't tested
requires-python = ">=3.11"
license = "BSD-3-Clause-Clear"
license-files = ["LICENSE"]
authors = [
{ name = "Renato Xavier da Silveira Rosa", email = "renatoxsr@gmail.com" }
]
classifiers = [
"Programming Language :: Python :: 3",
"Development Status :: 3 - Alpha",
"Operating System :: OS Independent",
"Environment :: Console",
"Environment :: GPU",
"Topic :: Multimedia :: Sound/Audio :: Sound Synthesis",
"Topic :: Text Processing :: Filters",
"Topic :: File Formats"
]
dependencies = [
"load-dotenv>=0.1.0",
]
[project.optional-dependencies]
dev = [
"ruff>=0.4",
]
[project.urls]
Homepage = "https://git.silveirarosa.com/renatoxsr/epub-tts"
Issues = "https://git.silveirarosa.com/renatoxsr/epub-tts/issues"
[project.scripts]
epub-tts = "epub_tts.__main__:main"
# SETUPTOOLS
[tool.setuptools.packages.find]
where = ["src"]
exclude = ["vendor*"]
[tool.setuptools.dynamic]
#version = {attr = "epub_tts.__version__"}
[tool.setuptools_scm]
# RUFF
[tool.ruff]
# Target Python version
target-version = "py311"
# Same as Black default
indent-width = 4
# # Standard Line Length Limits
# - 79 Characters: The strict PEP 8 official standard for code. It prevents horizontal wrapping or scrolling on older terminals and ensures high code readability.
# - 72 Characters: The PEP 8 official standard strictly reserved for docstrings and comments.
# - 88 Characters: The default standard used by Black, a highly popular, uncompromising Python code formatter.
# - 99 Characters: The maximum limit permitted by PEP 8 for internal or team-based projects if the team explicitly agrees to a longer limit.
# - 100 to 120 Characters: A very common relaxed standard used in enterprise environments, large open-source projects, and default setups for modern IDEs like JetBrains
line-length = 88
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
[tool.ruff.lint]
# select = [...] # See the Default Rules page for the full listing.
ignore = ["E501"]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Enable Pyflakes (F) and Flake8 (E/W) codes
select = ["E", "F", "I"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.format]
# Use double quotes (like Black)
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"