[project]
name = "tidal-dl-ng"
authors = [{ name = "Robert Honz", email = "<cen.sored@gmail.com>" }]
version = "v0.33.0"
description = "TIDAL Media Downloader Next Generation!"
readme = "README.md"
license = "AGPL-3.0-only"
license-files = ["LICENSE"]
classifiers = [
  "Development Status :: 4 - Beta",
  "Intended Audience :: Developers",
  "Programming Language :: Python :: 3",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: 3.13",
]
requires-python = ">=3.12,<3.14"
dynamic = ["dependencies"]

[project.urls]
repository = "https://github.com/exislow/tidal-dl-ng"
documentation = "https://exislow.github.io/tidal-dl-ng/"

[project.scripts]
tidal-dl-ng = "tidal_dl_ng.cli:app"
tidal-dl-ng-gui = "tidal_dl_ng.gui:gui_activate"
tdn = "tidal_dl_ng.cli:app"
tdng = "tidal_dl_ng.gui:gui_activate"

[tool.poetry]
packages = [{ include = "tidal_dl_ng" }]

[tool.poetry.dependencies]
requests = "~2.32.5"
mutagen = "^1.47.0"
dataclasses-json = "^0.6.7"
pathvalidate = "^3.3.1"
m3u8 = "^6.0.0"
coloredlogs = "^15.0.1"
pyside6 = { version = "6.10.0", optional = true }
pyqtdarktheme-fork = { version = "^2.3.4", optional = true }
rich = "^14.2.0"
toml = "^0.10.2"
typer = "^0.20.0"
tidalapi = "^0.8.10"
python-ffmpeg = "^2.0.12"
pycryptodome = "^3.23.0"
ansi2html = "^1.9.2"

[project.optional-dependencies]
gui = ["pyside6", "pyqtdarktheme-fork"]

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
pytest = "^9.0.1"
deptry = "^0.24.0"
pyright = "^1.1.398"
pre-commit = "^4.5.0"
tox = "^4.32.0"
pyupgrade = "^3.21.2"
bandit = "^1.9.2"
darglint = "^1.8.1"
isort = { extras = ["colors"], version = "^7.0.0" }
mypy-extensions = "^1.1.0"
pydocstyle = "^6.3.0"
pylint = "^4.0.4"
pillow = "^12.0.0"
pytest-cov = "^7.0.0"
black = "^25.11.0"
nuitka = "2.8.4"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
mkdocs = "^1.6.1"
mkdocs-material = "^9.5.44"
mkdocstrings = { extras = ["python"], version = "^0.27.0" }
griffe = "^1.5.1"

[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.ruff]
target-version = "py312"
line-length = 120
fix = true
# Overview: https://docs.astral.sh/ruff/rules/
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",
  # Do not use bare `except`
  "E722",
  # PEP 484 prohibits implicit `Optional`
  # Disabled only temporarily.
  "RUF013",
]

[tool.ruff.per-file-ignores]
"tests/*" = ["S101"]
"tidal_dl_ng/cli.py" = ["UP007"]

[tool.black]
# https://github.com/psf/black
target-version = ["py312", "py313"]
line-length = 120
color = true
preview = true

exclude = '''
/(
    \.git
    | \.mypy_cache
    | \.tox
    | \.venv
    | _build
    | buck-out
    | build
    | dist
    | env
    | venv
    | site
    | docs
    | tidal_dl_ng/ui/main.py
    | tidal_dl_ng/ui/dialog_version.py
)/
'''

[tool.isort]
# https://github.com/timothycrosley/isort/
py_version = 312
line_length = 120
known_typing = [
  "typing",
  "types",
  "typing_extensions",
  "mypy",
  "mypy_extensions",
]
sections = [
  "FUTURE",
  "TYPING",
  "STDLIB",
  "THIRDPARTY",
  "FIRSTPARTY",
  "LOCALFOLDER",
]
include_trailing_comma = true
profile = "black"
multi_line_output = 3
indent = 4
color_output = true
known_third_party = [
  "Crypto",
  "PySide6",
  "coloredlogs",
  "dataclasses_json",
  "ffmpeg",
  "m3u8",
  "mutagen",
  "pathvalidate",
  "requests",
  "rich",
  "tidalapi",
  "toml",
  "typer",
]

[tool.pyright]
# https://microsoft.github.io/pyright/#/configuration
include = ["tidal_dl_ng"]
pythonVersion = "3.12"
typeCheckingMode = "standard"
reportMissingImports = true
reportMissingTypeStubs = false
reportUnusedImport = true
reportUnusedClass = true
reportUnusedFunction = true
reportUnusedVariable = true
reportDuplicateImport = true
reportUntypedFunctionDecorator = false
reportUntypedClassDecorator = false
reportUntypedBaseClass = true
reportUntypedNamedTuple = true
reportPrivateUsage = false
reportConstantRedefinition = true
reportIncompatibleMethodOverride = true
reportIncompatibleVariableOverride = true
reportInconsistentConstructor = true
reportOverlappingOverload = true
reportMissingSuperCall = false
reportUninitializedInstanceVariable = false
reportCallInDefaultInitializer = false
reportImplicitStringConcatenation = false
reportUnusedCallResult = false
reportUnusedCoroutine = true
reportUnusedExpression = false
reportUnnecessaryTypeIgnoreComment = true
reportMatchNotExhaustive = true
