Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
179 lines (163 loc) · 5.03 KB
/
Copy pathpyproject.toml
File metadata and controls
179 lines (163 loc) · 5.03 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "unraid-api"
dynamic = ["version"]
description = "Python client library for Unraid's official GraphQL API"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.11"
authors = [
{ name = "Ruaan Deysel", email = "ruaan.deysel@gmail.com" },
]
keywords = [
"unraid",
"graphql",
"api",
"home-assistant",
"automation",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Framework :: AsyncIO",
"Framework :: Pydantic",
"Topic :: Home Automation",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = [
"aiohttp>=3.9.0",
"packaging>=21.0",
"pydantic>=2.0.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-asyncio>=0.24.0",
"pytest-cov>=6.0.0",
"aiointercept>=0.1.5",
"graphql-core>=3.2.0",
"ruff>=0.8.0",
"mypy>=1.13.0",
"pre-commit>=4.0.0",
]
[project.urls]
Homepage = "https://github.com/tinkerologie/unraid-api"
Documentation = "https://github.com/tinkerologie/unraid-api#readme"
Repository = "https://github.com/tinkerologie/unraid-api.git"
Issues = "https://github.com/tinkerologie/unraid-api/issues"
[tool.hatch.build.targets.sdist]
include = [
"/src",
]
[tool.hatch.build.targets.wheel]
packages = ["src/unraid_api"]
# Version is read from _version.py - single source of truth
[tool.hatch.version]
path = "src/unraid_api/_version.py"
# =============================================================================
# Ruff Configuration
# =============================================================================
[tool.ruff]
target-version = "py311"
line-length = 88
src = ["src", "tests", "script"]
extend-exclude = ["scripts"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"ERA", # eradicate (commented code)
"PL", # pylint
"RUF", # Ruff-specific rules
"S", # flake8-bandit (security)
"ASYNC", # flake8-async
]
ignore = [
"PLR0911", # Too many return statements (_discover_redirect_url)
"PLR0912", # Too many branches (client.py _make_request)
"PLR0913", # Too many arguments
"PLR0915", # Too many statements (_discover_redirect_url)
"PLR2004", # Magic value comparison
"PLC0415", # Import not at top of file (used for lazy imports)
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*" = ["S101", "S104", "S604", "ARG001", "PLR2004"]
[tool.ruff.lint.isort]
known-first-party = ["unraid_api"]
# =============================================================================
# MyPy Configuration
# =============================================================================
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
show_error_codes = true
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = ["aiohttp.*", "aiointercept.*", "packaging.*"]
ignore_missing_imports = true
# =============================================================================
# Pytest Configuration
# =============================================================================
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["script"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
addopts = [
"-v",
"--tb=short",
"--strict-markers",
]
markers = [
"integration: marks tests as integration tests (require real server)",
]
# =============================================================================
# Coverage Configuration
# =============================================================================
[tool.coverage.run]
source = ["src/unraid_api", "script"]
branch = true
omit = ["tests/*"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
fail_under = 95
show_missing = true
# =============================================================================
# Bandit Configuration
# =============================================================================
[tool.bandit]
targets = ["src/unraid_api"]
skips = ["B101"] # Skip assert_used (used in tests)