road-master/radiko-podcast

View on GitHub
pyproject.toml

Summary

Maintainability
Test Coverage
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "radikopodcast"
version = "1.0.3"
description = "Automatic archiver for radiko program which queried by YAML file."
readme = "README.md"
requires-python = ">=3.9"
license = {file = "LICENSE"}
keywords = [
    "radiko",
    "radikopodcast",
]
authors = [
    {name = "Master", email = "roadmasternavi@gmail.com"},
]
maintainers = [
    {name = "Master", email = "roadmasternavi@gmail.com"},
]
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Environment :: Console",
    "Intended Audience :: End Users/Desktop",
    "License :: OSI Approved :: MIT License",
    "Natural Language :: English",
    "Operating System :: OS Independent",
    "Programming Language :: Python",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Topic :: Internet",
    "Topic :: Internet :: WWW/HTTP",
    "Topic :: Internet :: WWW/HTTP :: Indexing/Search",
    "Topic :: Multimedia",
    "Topic :: Multimedia :: Sound/Audio",
    "Topic :: Multimedia :: Sound/Audio :: Capture/Recording",
    "Topic :: System",
    "Topic :: System :: Archiving",
    "Topic :: System :: Archiving :: Backup",
    "Topic :: System :: Filesystems",
    "Typing :: Typed",
]
dependencies = [
    "click",
    "errorcollector",
    "ffmpeg-python",
    "radikoplaylist",
    "yamldataclassconfig",
    "sqlalchemy",
    "inflector",
    "asynccpu",
    "asyncffmpeg",
    "defusedxml",
]

[project.optional-dependencies]
test = []

[project.urls]
homepage = "https://github.com/road-master/radiko-podcast"
# documentation = "https://readthedocs.org"
repository = "https://github.com/road-master/radiko-podcast"
# changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md"

[project.entry-points."console_scripts"]
radiko-podcast = "radikopodcast.cli:radiko_podcast"

[tool.setuptools]
zip-safe = false

[tool.setuptools.packages.find]
include = ["radikopodcast", "radikopodcast.*"]

[tool.bandit.assert_used]
skips = ["tests/*"]

# @see https://black.readthedocs.io/en/stable/pyproject_toml.html#configuration-format
[tool.black]
line-length = 119

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    # Assume `if TYPE_CHECKING: ... else: ...` block is covered · Issue #831 · nedbat/coveragepy
    #   https://github.com/nedbat/coveragepy/issues/831#issuecomment-517778185
    "if TYPE_CHECKING:",
    # Pylint will detect instead:
    # - abstract-method / W0223 - Pylint 2.17.0-dev0 documentation
    #   https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/abstract-method.html
    "raise NotImplementedError",
]

[tool.docformatter]
recursive = true
wrap-descriptions = 119
wrap-summaries = 119

[tool.isort]
# see:
# - Using Black with other tools - Black 23.1.0 documentation
#   https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#custom-configuration
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 119
# For compatibility with PyLint and Hacking, Google also supports, 
# Black doesn't have any opinions
# see:
# - https://pycqa.github.io/isort/docs/configuration/profiles.html
# - https://qiita.com/kaityo256/items/5b0b55d105ef2366cb0c
# - https://www.xn--ebkc7kqd.com/entry/hacking-isort
force_sort_within_sections = true
lexicographical = true
# Google supports, Black doesn't have any opinions
# see: https://pycqa.github.io/isort/docs/configuration/profiles.html
order_by_type = false

[tool.mypy]
strict = true
plugins = [
  "sqlalchemy.ext.mypy.plugin"
]

[[tool.mypy.overrides]]
module = [
    "defusedxml.*",
    "factory",
    "ffmpeg",
    "inflector",
]
ignore_missing_imports = true

[tool.pydocstyle]
# To add Google convention
# see:
# - Error Codes — pydocstyle 6.1.1 documentation
#   http://www.pydocstyle.org/en/stable/error_codes.html#default-conventions
add_select = ["D212", "D214", "D410", "D411", "D415", "D416", "D417"]
# D400: First line may ends with ":" for expression.
# D402: First line may ends with function signature for expression.
# D415: First line may ends with ":" for expression.
# D101: Docstring may be missed in public class since docstring-min-length is set.
# D102: Docstring may be missed in public method since docstring-min-length is set.
# D103: Docstring may be missed in public function since docstring-min-length is set.
# D105: Docstring may be missed in magic method since docstring-min-length is set.
# D105: Docstring may be missed in public nested class since docstring-min-length is set.
# D107: Docstring may be missed in __init__ method since docstring-min-length is set.
add_ignore = ["D400", "D401", "D402", "D415", "D101", "D102", "D103", "D105", "D106", "D107"]

[tool.pylint.basic]
docstring-min-length = "7"

[tool.pylint.format]
max-line-length = 119

[tool.pylint.options]
# Since this rule against single responsibility principle.
# @see https://stackoverflow.com/questions/28722314/why-does-pylint-want-2-public-methods-per-class/40258006#40258006
min-public-methods = "1"

[tool.pylint.typecheck]
ignored-classes = [
    "scoped_session",  # @see https://stackoverflow.com/questions/59214324/flask-error-db-scoped-session-instance-of-scoped-session-has-no-commit-mem/59214469#59214469
]

[tool.ruff]
line-length = 119
target-version = "py39"

[tool.ruff.lint]
select = [
    "F",  # Pyflakes
    "E",  # pycodestyle
    "W",  # pycodestyle
    "C90",  # mccabe
    # "I",  # isort
    "N",  # pep8-naming
    # "D",  # pydocstyle
    "UP",  # pyupgrade
    "YTT",  # flake8-2020
    "ANN",  # flake8-annotations
    "S",  # flake8-bandit
    "BLE",  # flake8-blind-except
    "FBT",  # flake8-boolean-trap
    "B",  # flake8-bugbear
    "A",  # flake8-builtins
    "COM",  # flake8-commas
    "C4",  # flake8-comprehensions
    "DTZ",  # flake8-datetimez
    "T10",  # flake8-debugger
    "DJ",  # flake8-django
    "EM",  # flake8-errmsg
    "EXE",  # flake8-executable
    "ISC",  # flake8-implicit-str-concat
    "ICN",  # flake8-import-conventions
    "G",  # flake8-logging-format
    "INP",  # flake8-no-pep420
    "PIE",  # flake8-pie
    "T20",  # flake8-print
    "PYI",  # flake8-pyi
    "PT",  # flake8-pytest-style
    "Q",  # flake8-quotes
    "RSE",  # flake8-raise
    "RET",  # flake8-return
    "SLF",  # flake8-self
    "SIM",  # flake8-simplify
    "TID",  # flake8-tidy-imports
    "TCH",  # flake8-type-checking
    "ARG",  # flake8-unused-arguments
    "PTH",  # flake8-use-pathlib
    "ERA",  # eradicate
    "PD",  # pandas-vet
    "PGH",  # pygrep-hooks
    "PL",  # Pylint
    "TRY",  # tryceratops
    "NPY",  # NumPy-specific rules
    "RUF",  # Ruff-specific rules
]
ignore = [
    "UP032",  # [*] Use f-string instead of `format` call
    "ANN101",  # Missing type annotation for `self` in method
    "ANN102",  # Missing type annotation for `cls` in classmethod
    "ANN401",  # Dynamically typed expressions (typing.Any) are disallowed, These warnings are disabled by default
]

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101"]