-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
pyproject.toml
160 lines (145 loc) · 5.13 KB
/
pyproject.toml
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
160
[build-system]
requires = ["setuptools==75.5.0", "wheel==0.45.0"]
build-backend = "setuptools.build_meta"
[project]
name = "aiounifi"
version = "80"
license = {text = "MIT"}
description = "Python library for communicating with UniFi Network Controller API"
readme = "README.md"
authors = [{name = "Robert Svensson", email = "[email protected]"}]
keywords = ["unifi", "homeassistant"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.12",
"Topic :: Home Automation",
]
requires-python = ">=3.12.0"
dependencies = [
"aiohttp>3.9",
"orjson>3.9",
"segno>=1.5.2",
]
[project.optional-dependencies]
requirements = [
"aiohttp==3.11.2",
"orjson==3.10.11",
"segno==1.6.1",
]
requirements_test = [
"aioresponses==0.7.6",
"mypy==1.13.0",
"pytest==8.3.3",
"pytest-aiohttp==1.0.5",
"pytest-asyncio==0.24.0",
"pytest-cov==6.0.0",
"ruff==0.7.3",
"trustme==1.2.0",
"types-orjson==3.6.2",
]
requirements_dev = [
"pre-commit==4.0.1"
]
[project.urls]
"Source Code" = "https://github.com/Kane610/aiounifi"
"Bug Reports" = "https://github.com/Kane610/aiounifi/issues"
"Forum" = "https://community.home-assistant.io/t/unifi-network-integration-official-thread/"
[project.scripts]
aiounifi = "aiounifi.__main__:main"
[tool.coverage.report]
fail_under = 95
exclude_also = [
"if TYPE_CHECKING:"
]
[tool.setuptools.packages.find]
include = ["aiounifi*"]
[tool.setuptools.package-data]
"aiounifi" = ["py.typed"]
[tool.mypy]
python_version = "3.12"
check_untyped_defs = true
disallow_any_generics = 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
no_implicit_reexport = true
strict_equality = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[tool.pytest.ini_options]
addopts = "--cov=aiounifi --cov-report term-missing"
asyncio_mode = "auto"
log_cli = false
log_cli_level = "DEBUG"
testpaths = ["tests"]
[tool.ruff]
src = ["aiounifi", "tests"]
target-version = "py312"
lint.select = [
"B002", # Python does not support the unary prefix increment
"B005", # Using .strip() with multi-character strings is misleading
"B007", # Loop control variable {name} not used within loop body
"B014", # Exception handler with duplicate exception
"B015", # Pointless comparison. Did you mean to assign a value? Otherwise, prepend assert or remove it.
"B018", # Found useless attribute access. Either assign it to a variable or remove it.
"B023", # Function definition does not bind loop variable {name}
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged
"B032", # Possible unintentional type annotation (using :). Did you mean to assign (using =)?
"C", # complexity
"COM818", # Trailing comma on bare tuple prohibited
"D", # docstrings
"E", # pycodestyle
"F", # pyflakes/autoflake
"G", # flake8-logging-format
"I", # isort
"ICN001", # import concentions; {name} should be imported as {asname}
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"N804", # First argument of a class method should be named cls
"N805", # First argument of a method should be named self
"N815", # Variable {name} in class scope should not be mixedCase
"PERF", # A Linter for performance anti-patterns
"PGH004", # Use specific rule codes when using noqa
"PIE", # flake8-pie
"PL", # pylint
"PT", # pytest
"RSE", # flake8-raise
"RUF005", # Consider iterable unpacking instead of concatenation
"RUF006", # Store a reference to the return value of asyncio.create_task
"RUF100", # Unused `noqa` directive
"S307", # No builtin eval() allowed
"SIM", # flake8-simplify
"T100", # Trace found: {name} used
"T20", # flake8-print
"UP", # pyupgrade
"W", # pycodestyle
]
lint.ignore = [
"D202", # No blank lines allowed after function docstring
"D203", # 1 blank line required before class docstring
"D206", # Checks for docstrings that are indented with tabs
"D213", # Multi-line docstring summary should start at the second line
"E501", # Checks for lines that exceed the specified maximum character length
"ISC001", # Implicitly concatenated string literals on one line
"PLR0913", # Too many arguments to function call ({c_args} > {max_args})
"PLR0915", # Too many statements ({statements} > {max_statements})
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"W191", # Checks for indentation that uses tabs
]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = ["aiounifi"]
combine-as-imports = true
[tool.ruff.lint.mccabe]
max-complexity = 12