| 1 |
[build-system] |
| 2 |
requires = ['setuptools>=77.0', 'Cython>=3', "poetry-core>=2.0.0"] |
| 3 |
build-backend = "poetry.core.masonry.api" |
| 4 |
|
| 5 |
[project] |
| 6 |
name = "habluetooth" |
| 7 |
version = "7.1.2" |
| 8 |
license = "Apache-2.0" |
| 9 |
description = "High availability Bluetooth" |
| 10 |
authors = [{ name = "J. Nick Koston", email = "[email protected]" }] |
| 11 |
readme = "README.md" |
| 12 |
requires-python = ">=3.11" |
| 13 |
|
| 14 |
[project.urls] |
| 15 |
"Repository" = "https://github.com/bluetooth-devices/habluetooth" |
| 16 |
"Documentation" = "https://habluetooth.readthedocs.io" |
| 17 |
"Bug Tracker" = "https://github.com/bluetooth-devices/habluetooth/issues" |
| 18 |
"Changelog" = "https://github.com/bluetooth-devices/habluetooth/blob/main/CHANGELOG.md" |
| 19 |
|
| 20 |
[tool.poetry] |
| 21 |
classifiers = [ |
| 22 |
"Development Status :: 2 - Pre-Alpha", |
| 23 |
"Intended Audience :: Developers", |
| 24 |
"Natural Language :: English", |
| 25 |
"Operating System :: OS Independent", |
| 26 |
"Topic :: Software Development :: Libraries", |
| 27 |
] |
| 28 |
packages = [ |
| 29 |
{ include = "habluetooth", from = "src" }, |
| 30 |
] |
| 31 |
|
| 32 |
[tool.poetry.build] |
| 33 |
generate-setup-file = true |
| 34 |
script = "build_ext.py" |
| 35 |
|
| 36 |
[tool.poetry.dependencies] |
| 37 |
python = ">=3.11,<3.15" |
| 38 |
bleak = ">=3.0.2" |
| 39 |
bleak-retry-connector = ">=4.7.1" |
| 40 |
bluetooth-data-tools = ">=1.29.24" |
| 41 |
bluetooth-adapters = ">=2.4.0" |
| 42 |
bluetooth-auto-recovery = ">=1.6.4" |
| 43 |
async-interrupt = ">=1.1.1" |
| 44 |
dbus-fast = { version = ">=5.0.22", markers = "platform_system == 'Linux'" } |
| 45 |
btsocket = ">=0.3.0" |
| 46 |
|
| 47 |
[tool.poetry.group.dev.dependencies] |
| 48 |
pytest = ">=9.1.1,<10" |
| 49 |
pytest-cov = ">=7.1.0,<8" |
| 50 |
pytest-asyncio = ">=1.4.0,<1.5.0" |
| 51 |
pytest-codspeed = ">=5.0.3,<6.0.0" |
| 52 |
pytest-timeout = ">=2.3.1" |
| 53 |
freezegun = "^1.5.5" |
| 54 |
dbus-fast = ">=5.0.22" |
| 55 |
|
| 56 |
[tool.poetry.group.docs] |
| 57 |
optional = true |
| 58 |
|
| 59 |
[tool.poetry.group.docs.dependencies] |
| 60 |
myst-parser = ">=5.1.0" |
| 61 |
sphinx = ">=4.0" |
| 62 |
furo = ">=2023.5.20" |
| 63 |
sphinx-autobuild = ">=2021.3.14" |
| 64 |
|
| 65 |
[tool.semantic_release] |
| 66 |
version_toml = ["pyproject.toml:project.version"] |
| 67 |
version_variables = [ |
| 68 |
"src/habluetooth/__init__.py:__version__", |
| 69 |
"docs/conf.py:release", |
| 70 |
] |
| 71 |
build_command = "pip install poetry && poetry build --format sdist" |
| 72 |
|
| 73 |
[tool.semantic_release.changelog] |
| 74 |
exclude_commit_patterns = [ |
| 75 |
"chore*", |
| 76 |
"ci*", |
| 77 |
] |
| 78 |
|
| 79 |
[tool.semantic_release.changelog.environment] |
| 80 |
keep_trailing_newline = true |
| 81 |
|
| 82 |
[tool.semantic_release.branches.main] |
| 83 |
match = "main" |
| 84 |
|
| 85 |
[tool.semantic_release.branches.noop] |
| 86 |
match = "(?!main$)" |
| 87 |
prerelease = true |
| 88 |
|
| 89 |
[tool.pytest.ini_options] |
| 90 |
addopts = "-v -Wdefault --cov=habluetooth --cov-report=term-missing:skip-covered" |
| 91 |
pythonpath = ["src"] |
| 92 |
log_cli="true" |
| 93 |
log_level="NOTSET" |
| 94 |
timeout = 5 |
| 95 |
|
| 96 |
[tool.coverage.run] |
| 97 |
branch = true |
| 98 |
|
| 99 |
[tool.coverage.report] |
| 100 |
exclude_lines = [ |
| 101 |
"pragma: no cover", |
| 102 |
"@overload", |
| 103 |
"if TYPE_CHECKING", |
| 104 |
"raise NotImplementedError", |
| 105 |
'if __name__ == "__main__":', |
| 106 |
] |
| 107 |
|
| 108 |
[tool.ruff] |
| 109 |
target-version = "py311" |
| 110 |
line-length = 88 |
| 111 |
|
| 112 |
[tool.ruff.lint] |
| 113 |
ignore = [ |
| 114 |
"E721", # type checks for cython |
| 115 |
"D203", # 1 blank line required before class docstring |
| 116 |
"D212", # Multi-line docstring summary should start at the first line |
| 117 |
"D100", # Missing docstring in public module |
| 118 |
"D104", # Missing docstring in public package |
| 119 |
"D107", # Missing docstring in `__init__` |
| 120 |
"D401", # First line of docstring should be in imperative mood |
| 121 |
"ASYNC109", # ``timeout`` is part of our bleak-compatible public API |
| 122 |
"TRY003", # too many to fix; long messages outside the exception class |
| 123 |
] |
| 124 |
select = [ |
| 125 |
"A", # flake8-builtins |
| 126 |
"ASYNC", # flake8-async |
| 127 |
"B", # flake8-bugbear |
| 128 |
"BLE", # flake8-blind-except |
| 129 |
"C4", # flake8-comprehensions |
| 130 |
"C90", # mccabe complexity |
| 131 |
"D", # flake8-docstrings |
| 132 |
"DTZ", # flake8-datetimez |
| 133 |
"E", # pycodestyle |
| 134 |
"EM", # flake8-errmsg |
| 135 |
"ERA", # eradicate |
| 136 |
"EXE", # flake8-executable |
| 137 |
"F", # pyflake |
| 138 |
"FA", # flake8-future-annotations |
| 139 |
"FIX", # flake8-fixme |
| 140 |
"FLY", # flynt |
| 141 |
"FURB", # refurb |
| 142 |
"G", # flake8-logging-format |
| 143 |
"I", # isort |
| 144 |
"ICN", # flake8-import-conventions |
| 145 |
"INP", # flake8-no-pep420 |
| 146 |
"ISC", # flake8-implicit-str-concat |
| 147 |
"LOG", # flake8-logging |
| 148 |
"N", # pep8-naming |
| 149 |
"NPY", # numpy-specific rules |
| 150 |
"PERF", # Perflint |
| 151 |
"PGH", # pygrep-hooks |
| 152 |
"PIE", # flake8-pie |
| 153 |
"PLC", # pylint convention |
| 154 |
"PLW", # pylint warnings |
| 155 |
"PT", # flake8-pytest-style |
| 156 |
"PTH", # flake8-use-pathlib |
| 157 |
"PYI", # flake8-pyi |
| 158 |
"Q", # flake8-quotes |
| 159 |
"RET", # return |
| 160 |
"RSE", # flake8-raise |
| 161 |
"RUF", # ruff specific |
| 162 |
"S", # flake8-bandit |
| 163 |
"SIM", # simplify |
| 164 |
"SLOT", # flake8-slots |
| 165 |
"T10", # flake8-debugger |
| 166 |
"T20", # flake8-print |
| 167 |
"TC", # flake8-type-checking |
| 168 |
"TD", # flake8-todos |
| 169 |
"TRY", # tryceratops |
| 170 |
"UP", # pyupgrade |
| 171 |
"W", # pycodestyle |
| 172 |
"YTT", # flake8-2020 |
| 173 |
] |
| 174 |
|
| 175 |
[tool.ruff.lint.per-file-ignores] |
| 176 |
"tests/**/*" = [ |
| 177 |
"D100", |
| 178 |
"D101", |
| 179 |
"D102", |
| 180 |
"D103", |
| 181 |
"D104", |
| 182 |
"S101", |
| 183 |
] |
| 184 |
"setup.py" = ["D100"] |
| 185 |
"conftest.py" = ["D100"] |
| 186 |
# Sphinx config: ``copyright`` is the Sphinx convention, file is not a package |
| 187 |
"docs/conf.py" = ["D100", "A001", "INP001"] |
| 188 |
# Example scripts intentionally use print and aren't a package |
| 189 |
"examples/*" = ["INP001", "T201"] |
| 190 |
# Standalone diagnostic scripts run by hand on a Bluetooth host |
| 191 |
"scripts/*" = ["INP001", "T201", "D102", "D103", "C901", "BLE001", "EM102", "E501"] |
| 192 |
|
| 193 |
[tool.ruff.lint.isort] |
| 194 |
known-first-party = ["habluetooth", "tests"] |
| 195 |
|
| 196 |
[tool.mypy] |
| 197 |
check_untyped_defs = true |
| 198 |
disallow_any_generics = true |
| 199 |
disallow_incomplete_defs = true |
| 200 |
disallow_untyped_defs = true |
| 201 |
mypy_path = "src/" |
| 202 |
no_implicit_optional = true |
| 203 |
show_error_codes = true |
| 204 |
warn_unreachable = true |
| 205 |
warn_unused_ignores = true |
| 206 |
exclude = [ |
| 207 |
'docs/.*', |
| 208 |
'setup.py', |
| 209 |
] |
| 210 |
|
| 211 |
[[tool.mypy.overrides]] |
| 212 |
module = "tests.*" |
| 213 |
allow_untyped_defs = true |
| 214 |
|
| 215 |
[[tool.mypy.overrides]] |
| 216 |
module = "docs.*" |
| 217 |
ignore_errors = true |