-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
116 lines (103 loc) · 4.22 KB
/
Copy pathpyproject.toml
File metadata and controls
116 lines (103 loc) · 4.22 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
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "ipmideck"
dynamic = ["version"]
description = "Web-based IPMI management platform"
readme = "README.md"
license = {text = "Apache-2.0"}
requires-python = ">=3.11"
authors = [{name = "Luigi Tanzillo"}]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.11",
"Operating System :: POSIX :: Linux",
]
dependencies = [
"fastapi>=0.110.0",
"uvicorn[standard]>=0.27.0",
"aiosqlite>=0.20.0",
"bcrypt>=4.1.0",
"pyyaml>=6.0",
"pydantic>=2.5.0",
"pydantic-settings>=2.1.0",
"cryptography>=42.0.0",
"rich>=13.7,<16",
"pyfiglet>=1.0,<2",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-asyncio>=0.23.0",
"httpx>=0.27.0",
"ruff>=0.3.0",
"pytest-cov>=7.0,<8",
]
[project.scripts]
# Console entry point maps to cli(). Re-run `pip install -e .` to register `ipmideck`.
ipmideck = "backend.main:cli"
[tool.setuptools.dynamic]
version = { attr = "backend.core.branding._VERSION_FALLBACK" }
[tool.setuptools.packages.find]
include = ["backend*"]
# Non-Python data files that MUST ship inside the wheel + sdist for a functional install
# (D-05/D-06): the compiled SPA (backend/static/**) and the per-module SQLite migrations
# (backend/modules/*/migrations/*.sql). Both trees live INSIDE the `backend` import package, so
# package-data (with pyproject's default include-package-data = true) covers wheel AND sdist; the
# recursive `**` glob is supported on the pinned setuptools>=68.0. Runtime path resolution is
# already safe via Path(__file__).parent — data-files (which install OUTSIDE the package) would
# break that, so we deliberately do NOT use [tool.setuptools.data-files] or a MANIFEST.in.
# NOTE: package-data keys must be valid module names or the predefined "*" (the strict pyproject
# validator in current setuptools rejects a ".*" wildcard suffix like "backend.modules.*"), so the
# 5 module packages are enumerated explicitly — each is the exact package that owns its migrations/.
[tool.setuptools.package-data]
"backend" = ["static/**/*"]
"backend.modules.fanpilot" = ["migrations/*.sql"]
"backend.modules.fru" = ["migrations/*.sql"]
"backend.modules.power" = ["migrations/*.sql"]
"backend.modules.sel" = ["migrations/*.sql"]
"backend.modules.sensors" = ["migrations/*.sql"]
[tool.ruff]
target-version = "py311"
line-length = 100
# Explicit rule selection = ruff's historical default set. ruff 0.16.0 changed the
# default `select`, which broke the CI gate (122 new DTZ/BLE/... findings) while local
# dev on 0.15.x stayed green — declaring the intended set keeps lint results identical
# regardless of which ruff version pip resolves (dev deps are `>=`, not pinned).
[tool.ruff.lint]
select = ["E4", "E7", "E9", "F"]
[tool.ruff.lint.per-file-ignores]
# Intentional deferred imports placed after route definitions to preserve
# Starlette route ordering (SPA catch-all must register after module routes).
"backend/main.py" = ["E402"]
# conftest sets IPMIDECK_* env vars BEFORE `import backend.main` so the app's
# lifespan reads the test config / temp DB — imports must follow that setup.
"tests/conftest.py" = ["E402"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
# Coverage is scoped to the four safety-critical modules (D-12). It is NOT a global gate.
# NOTE (REVIEWS HIGH #3): coverage.py's `[tool.coverage.run] source` expects PACKAGES/DIRECTORIES,
# not individual file paths — file paths there silently mis-scope the fail_under denominator.
# Use `include` (file globs) instead so the report lists exactly these four files and fail_under=80
# is computed only over them. `--cov` is passed per-run (the gate command / pre-commit hook),
# never baked into addopts, so a plain `pytest` does not force coverage.
[tool.coverage.run]
branch = true
include = [
"backend/core/crypto.py",
"backend/core/auth.py",
"backend/modules/fanpilot/engine.py",
"backend/core/ipmi_service.py",
]
[tool.coverage.report]
fail_under = 80
show_missing = true
include = [
"backend/core/crypto.py",
"backend/core/auth.py",
"backend/modules/fanpilot/engine.py",
"backend/core/ipmi_service.py",
]
omit = []