Files
sbv2-v2/pyproject.toml
tuna2134 4f3bcfd252 fix
2026-07-23 11:33:43 +09:00

157 lines
4.3 KiB
TOML

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "style-bert-vits2"
dynamic = ["version"]
description = "Style-Bert-VITS2: Bert-VITS2 with more controllable voice styles."
readme = "README.md"
requires-python = ">=3.12"
license = "AGPL-3.0"
keywords = []
authors = [
{ name = "litagin02", email = "139731664+litagin02@users.noreply.github.com" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
]
dependencies = [
"cmudict",
"cn2an",
"g2p_en",
"jieba",
"loguru",
"nltk>=3.9,<4",
"num2words",
"numba",
"numpy>=1.26,<3",
"onnxruntime",
"pydantic>=2.0",
"pyopenjtalk-dict",
"pypinyin",
"pyworld-prebuilt",
"safetensors",
"transformers",
]
[project.optional-dependencies]
torch = [
"accelerate",
"torch>=2.7,<2.8",
]
[project.urls]
Documentation = "https://github.com/litagin02/Style-Bert-VITS2#readme"
Issues = "https://github.com/litagin02/Style-Bert-VITS2/issues"
Source = "https://github.com/litagin02/Style-Bert-VITS2"
[tool.hatch.version]
path = "style_bert_vits2/constants.py"
[tool.hatch.build.targets.sdist]
only-include = [
".vscode",
"dict_data/default.csv",
"docs",
"style_bert_vits2",
"tests",
"LGPL_LICENSE",
"LICENSE",
"THIRD_PARTY_NOTICES.md",
"licenses",
"pyproject.toml",
"README.md",
]
exclude = [".git", ".gitignore", ".gitattributes"]
[tool.hatch.build.targets.wheel]
packages = ["style_bert_vits2"]
# for PyTorch inference
[tool.hatch.envs.test]
dependencies = [
"coverage[toml]>=6.5",
"pytest",
"scipy",
]
features = ["torch"]
[tool.hatch.envs.test.scripts]
# Usage: `hatch run test:test`
test = "pytest -s tests/test_main.py::test_synthesize_cpu"
# Usage: `hatch run test:test-cuda`
test-cuda = "pytest -s tests/test_main.py::test_synthesize_cuda"
# Usage: `hatch run test:coverage`
test-cov = "coverage run -m pytest -s tests/test_main.py::test_synthesize_cpu"
# Usage: `hatch run test:cov-report`
cov-report = ["- coverage combine", "coverage report"]
# Usage: `hatch run test:cov`
cov = ["test-cov", "cov-report"]
[[tool.hatch.envs.test.matrix]]
python = ["3.12"]
# for ONNX inference (without PyTorch dependency)
[tool.hatch.envs.test-onnx]
dependencies = [
"coverage[toml]>=6.5",
"pytest",
"scipy",
"onnxruntime-directml; sys_platform == 'win32'",
"onnxruntime-gpu; sys_platform != 'darwin'",
]
[tool.hatch.envs.test-onnx.scripts]
# Usage: `hatch run test-onnx:test`
test = "pytest -s tests/test_main.py::test_synthesize_onnx_cpu"
# Usage: `hatch run test-onnx:test-cuda`
test-cuda = "pytest -s tests/test_main.py::test_synthesize_onnx_cuda"
# Usage: `hatch run test-onnx:test-directml`
test-directml = "pytest -s tests/test_main.py::test_synthesize_onnx_directml"
# Usage: `hatch run test-onnx:test-coreml`
test-coreml = "pytest -s tests/test_main.py::test_synthesize_onnx_coreml"
# Usage: `hatch run test-onnx:coverage`
test-cov = "coverage run -m pytest -s tests/test_main.py::test_synthesize_onnx_cpu"
# Usage: `hatch run test-onnx:cov-report`
cov-report = ["- coverage combine", "coverage report"]
# Usage: `hatch run test-onnx:cov`
cov = ["test-cov", "cov-report"]
[[tool.hatch.envs.test-onnx.matrix]]
python = ["3.12"]
[tool.hatch.envs.style]
detached = true
dependencies = ["black[jupyter]", "isort"]
[tool.hatch.envs.style.scripts]
# Usage: `hatch run style:check`
check = [
"black --check --diff .",
"isort --check-only --diff --profile black --gitignore --lai 2 . --sg \"Data/*\" --sg \"inputs/*\" --sg \"model_assets/*\" --sg \"static/*\"",
]
# Usage: `hatch run style:fmt`
fmt = [
"black .",
"isort --profile black --gitignore --lai 2 . --sg \"Data/*\" --sg \"inputs/*\" --sg \"model_assets/*\" --sg \"static/*\"",
"check",
]
[tool.coverage.run]
source_pkgs = ["style_bert_vits2", "tests"]
branch = true
parallel = true
omit = ["style_bert_vits2/constants.py"]
[tool.coverage.paths]
style_bert_vits2 = ["style_bert_vits2", "*/style-bert-vits2/style_bert_vits2"]
tests = ["tests", "*/style-bert-vits2/tests"]
[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
[tool.ruff]
extend-select = ["I"]
[tool.ruff.lint.isort]
lines-after-imports = 2