[project]
name = "bluetooth-auto-recovery"
version = "1.5.3"
description = "Recover bluetooth adapters that are in an stuck state"
authors = [{ name = "J. Nick Koston", email = "nick@koston.org" }]
license = "MIT"
readme = "README.md"
requires-python = ">=3.9"
dynamic = ["classifiers", "dependencies"]

[project.urls]
"Repository" = "https://github.com/bluetooth-devices/bluetooth-auto-recovery"
"Documentation" = "https://bluetooth-auto-recovery.readthedocs.io"
"Bug Tracker" = "https://github.com/bluetooth-devices/bluetooth-auto-recovery/issues"
"Changelog" = "https://github.com/bluetooth-devices/bluetooth-auto-recovery/blob/main/CHANGELOG.md"

[tool.poetry]
classifiers = [
    "Development Status :: 2 - Pre-Alpha",
    "Intended Audience :: Developers",
    "Natural Language :: English",
    "Operating System :: OS Independent",
    "Topic :: Software Development :: Libraries",
]
packages = [
    { include = "bluetooth_auto_recovery", from = "src" },
]

[tool.poetry.dependencies]
python = ">=3.9,<3.14"

# Documentation Dependencies
Sphinx = {version = ">=5,<8", optional = true}
sphinx-rtd-theme = {version = ">=1,<4", optional = true}
myst-parser = {version = ">=0.18,<3.1", optional = true}
PyRIC = ">=0.1.6.3"
btsocket = ">=0.2.0"
async-timeout = {version = ">=3.0.0", python = "<3.11"}
usb-devices = ">=0.4.1"
bluetooth-adapters = ">=0.16.0"

[tool.poetry.extras]
docs = [
    "myst-parser",
    "sphinx",
    "sphinx-rtd-theme",
]

[tool.poetry.group.dev.dependencies]
pytest = "^8.3"
pytest-asyncio = ">=0.23.5"
pytest-cov = "^6.1"

[tool.semantic_release]
branch = "main"
version_toml = ["pyproject.toml:project.version"]
version_variables = ["src/bluetooth_auto_recovery/__init__.py:__version__"]
build_command = "pip install poetry && poetry build"

[tool.pytest.ini_options]
addopts = "-v -Wdefault --cov=bluetooth_auto_recovery --cov-report=term-missing:skip-covered"
pythonpath = ["src"]

[tool.coverage.run]
branch = true

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "@overload",
    "if TYPE_CHECKING",
    "raise NotImplementedError",
]

[tool.isort]
profile = "black"
known_first_party = ["bluetooth_auto_recovery", "tests"]

[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
mypy_path = "src/"
no_implicit_optional = true
show_error_codes = true
warn_unreachable = true
warn_unused_ignores = true
exclude = [
    'docs/.*',
    'setup.py',
]

[[tool.mypy.overrides]]
module = "tests.*"
allow_untyped_defs = true

[[tool.mypy.overrides]]
module = "docs.*"
ignore_errors = true

[build-system]
requires = ["poetry-core>=2.1.0"]
build-backend = "poetry.core.masonry.api"
