eggplants/subt

View on GitHub
pyproject.toml

Summary

Maintainability
Test Coverage
[build-system]
build-backend = "poetry.core.masonry.api"
requires = [
  "poetry-core",
]

[tool.poetry]
name = "subt"
version = "0.0.0"
description = "Translate a subtitle file"
authors = [ "eggplants <w10776e8w@yahoo.co.jp>" ]
license = "MIT"
readme = "README.md"
repository = "https://github.com/eggplants/subt"
keywords = [
  "subtitle",
  "translate",
]
classifiers = [
  "Development Status :: 4 - Beta",
  "Environment :: Console",
  "Operating System :: OS Independent",
  "Programming Language :: Python :: 3 :: Only",
  "Typing :: Typed",
]

[tool.poetry.dependencies]
python = "^3.12"
pysubs2 = "^1.7.3"
translatepy = "^2.3"

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.7.0"
mypy = "^1.11.0"
pytest = "^8.3.2"
pytest-cov = "^5.0.0"
taskipy = "^1.13.0"

[tool.poetry.scripts]
subt = "subt.main:main"

[tool.black]
target-version = [ "py312" ]

[tool.ruff]
lint.select = [ "ALL" ]
lint.ignore = [
  "D211", # No blank lines allowed before class docstring
  "D213", # Multi-line docstring summary should start at the second line
]
lint.per-file-ignores."main.py" = [
  "T201", # `print` found
]
lint.per-file-ignores."tests/*" = [
  "D",
  "S101", # Use of assert detected
]
lint.pydocstyle.convention = "google"

[tool.mypy]
python_version = "3.12"
strict = true

# much harder
# disallow_any_decorated = true
# disallow_any_explicit = true
# disallow_any_expr = true
disallow_any_unimported = true
implicit_optional = false      # for mypy<1.0
strict_concatenate = true
warn_unreachable = true

# message
pretty = true
show_column_numbers = true
show_error_context = true

[tool.pyright]
pythonVersion = "3.12"
typeCheckingMode = "strict"

[tool.taskipy.tasks]
test = "pytest --cov=subt --cov-report=term"
"test:ci" = "task test --cov-report=xml:cov.xml"
lint = "pre-commit run -a"
profile = "python -m cProfile"