1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=77.0"]
[project]
name = "aioshelly"
version = "0.0.0"
license = "Apache-2.0"
description = "Asynchronous library to control Shelly devices."
readme = "README.md"
authors = [{ name = "Paulus Schoutsen", email = "paulus@home-assistant.io" }]
requires-python = ">=3.11"
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"aiohttp>=3.11.1",
"bluetooth-data-tools>=1.28.0",
"habluetooth>=3.42.0",
"orjson>=3.8.1",
"yarl",
]
[project.optional-dependencies]
lint = [
"mypy==1.18.2",
"pydocstyle==6.3.0",
"ruff==0.14.0",
"types-requests",
]
dev = [
"aioresponses==0.7.8",
"pre-commit==4.3.0",
"pytest-asyncio==1.2.0",
"pytest-cov==7.0.0",
"pytest==8.4.2",
"requests",
"tox==4.31.0",
]
[project.urls]
"Source code" = "https://github.com/home-assistant-libs/aioshelly"
[tool.setuptools.packages.find]
include = ["aioshelly*"]
[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
[tool.mypy]
python_version = "3.11"
show_error_codes = true
follow_imports = "silent"
ignore_missing_imports = true
strict_equality = true
warn_incomplete_stub = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_return_any = true
warn_unreachable = true
[tool.ruff]
target-version = "py311"
lint.select = ["ALL"]
lint.ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"ASYNC109", # Async function definition with a `timeout` parameter
"COM812", # Trailing comma missing (conflicts with formatter)
"D203", # 1 blank line required before class docstring (conflicts with `no-blank-line-before-class` (D211))
"D213", # Multi-line docstring summary should start at the second line (conflicts with multi-line-summary-first-line` (D212))
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"FBT003", # Boolean positional value in function call
"G201", # Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)`
"N818", # Exception name should be named with an Error suffix
"PLR0912", # Too many branches
"TC001", # Move application import into a type-checking block
"TC002", # Move third-party import into a type-checking block
"TC003", # Move standard library import into a type-checking block
"TC006", # Add quotes to type expression in typing.cast()
"TID252", # Prefer absolute imports over relative imports from parent modules
"TRY003", # Avoid specifying long messages outside the exception class
"TRY400", # Use `logging.exception` instead of `logging.error`
]
[tool.ruff.lint.per-file-ignores]
"tools/*" = [
"T201", # `print` found
]
"tests/**/*" = [
"D100",
"PLR0913",
"PLR2004",
"S101",
"SLF001",
]
[tool.ruff.lint.mccabe]
max-complexity = 18
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py311, py312, py313, py314, lint, mypy, tests
skip_missing_interpreters = True
[gh-actions]
python =
3.11: py311, lint, mypy
3.12: py312, tests
3.13: py313, tests
3.14: py314, tests
[testenv:lint]
basepython = python3
ignore_errors = True
commands =
ruff format --check ./
ruff check ./
pydocstyle aioshelly
deps =
.[lint]
[testenv:mypy]
basepython = python3
ignore_errors = True
commands =
mypy aioshelly
deps =
.[lint]
[testenv:tests]
basepython = python3
ignore_errors = True
commands =
python -m pytest --cov=aioshelly --cov-report=xml --cov-report=term-missing
deps =
.[dev]
"""
|