[project]
name = "mpd-now-playable"
dynamic = ["version"]
description = "Expose your MPD server as a 'now playable' app on MacOS"
authors = [
    {name = "Danielle McLean", email = "dani@00dani.me"},
]
dependencies = [
    "aiocache>=0.12.2",
    "pyobjc-framework-MediaPlayer>=10.0 ; sys_platform == 'darwin'",
    "python-mpd2>=3.1.0",
    "xdg-base-dirs>=6.0.1",
    "pytomlpp>=1.0.13",
    "yarl>=1.9.4",
    "boltons>=24.0.0",
    "pydantic>=2.7.4",
    "rich>=13.7.1",
    "ormsgpack>=1.5.0",
]
readme = "README.md"

requires-python = ">=3.12"
license = {text = "MIT"}
classifiers = [
    "Environment :: No Input/Output (Daemon)",
    "License :: OSI Approved :: MIT License",
    "Operating System :: MacOS :: MacOS X",
    "Programming Language :: Python :: 3.12",
    "Topic :: Multimedia :: Sound/Audio :: Players",
]

[project.optional-dependencies]
redis = [
    "aiocache[redis]",
]
memcached = [
    "aiocache[memcached]",
]
websockets = [
    "websockets>=12.0",
]
all = ["mpd-now-playable[redis,memcached,websockets]"]

[project.urls]
Homepage = "https://git.00dani.me/00dani/mpd-now-playable"
Issues = "https://git.00dani.me/00dani/mpd-now-playable/issues"

[project.scripts]
mpd-now-playable = 'mpd_now_playable.cli:main'

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"

[tool.mypy]
mypy_path = 'stubs'
plugins = ['pydantic.mypy', 'mpd_now_playable.tools.schema.plugin']
enable_incomplete_feature = 'NewGenericSyntax'

[tool.ruff.lint]
select = [
    # pycodestyle
    "E4", # import
    "E7", # statement
    "E9", # runtime
    # flake8
    "F", # standard flake8 rules
    "A", # flake8-builtins
    "ANN", # flake8-annotations
    "ASYNC", # flake8-async
    "B", # flake8-bugbear
    "S", # flake8-bandit
    "INP", # flake8-no-pep420
    # isort
    "I",
    # mccabe
    "C90",
]
ignore = [
    "ANN101", # missing-type-self
    "ANN102", # missing-type-cls
]

[tool.ruff.lint.flake8-annotations]
mypy-init-return = true

[tool.ruff.format]
# I prefer tabs for accessibility reasons.
indent-style = "tab"

[tool.pdm.scripts]
start = {call = 'mpd_now_playable.cli:main'}
lint = 'ruff check src/mpd_now_playable'
typecheck = 'mypy -p mpd_now_playable'
check = {composite = ['lint', 'typecheck'], keep_going = true}

[tool.pdm.version]
source = "scm"
write_to = 'mpd_now_playable/__version__.py'
write_template = "__version__ = '{}'"

[tool.pdm.build]
excludes = ["**/.mypy_cache"]

[tool.pdm.dev-dependencies]
dev = [
    "mypy>=1.11.0",
    "ruff>=0.1.6",
    "class-doc>=0.2.6",
]