-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
127 lines (115 loc) · 5.15 KB
/
Copy pathpyproject.toml
File metadata and controls
127 lines (115 loc) · 5.15 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "bosch-smart-home-camera-tool"
version = "10.12.3"
description = "Standalone command-line tool for Bosch Smart Home cameras (snapshots, livestream proxy, events, light/privacy control)."
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.11"
dependencies = [
"requests",
"urllib3",
"defusedxml>=0.7.1",
"aiohttp>=3.9",
"bosch-shc-camera-client>=0.5.4,<0.6",
]
[project.urls]
Homepage = "https://github.com/mosandlt/Bosch-Smart-Home-Camera-Tool-Python"
Repository = "https://github.com/mosandlt/Bosch-Smart-Home-Camera-Tool-Python"
[project.scripts]
bosch-camera = "bosch_camera:main"
# Flat single-file-module layout (no package dir): list the runtime modules and
# the translations data dir explicitly so the wheel ships exactly these and
# never the local bosch_config.json secret (which is gitignored anyway).
[tool.hatch.build.targets.wheel]
include = [
"bosch_camera.py",
"bosch_cloud_ssl.py",
"bosch_i18n.py",
"bosch_maintenance.py",
"bosch_rcp_client.py",
"bosch_tls.py",
"get_token.py",
"start_proxy.py",
"translations/*.json",
]
# only-include is an exclusive allowlist — guarantees the sdist ships exactly
# these paths and never local venvs/caches/secrets (.venv-test, bosch_config.json).
[tool.hatch.build.targets.sdist]
only-include = [
"bosch_camera.py",
"bosch_cloud_ssl.py",
"bosch_i18n.py",
"bosch_maintenance.py",
"bosch_rcp_client.py",
"bosch_tls.py",
"get_token.py",
"start_proxy.py",
"translations",
"README.md",
"LICENSE",
"CHANGELOG.md",
"pyproject.toml",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-ra --strict-markers"
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.mypy]
# Project-wide strict typing (family-parity with the HA integration).
python_version = "3.11"
strict = true
ignore_missing_imports = true
[tool.coverage.report]
fail_under = 90
[tool.pylint.MASTER]
persistent = false
jobs = 2
[tool.pylint.REPORTS]
score = false
[tool.pylint."MESSAGES CONTROL"]
disable = [
# ruff already enforces these — disable to avoid duplicate CI noise
"format",
"wrong-import-order",
"line-too-long",
"unused-import", # ruff F401
"unused-variable", # ruff F841
# mypy already enforces these
"import-error",
"no-member",
# project conventions — single flat CLI module, not a package
"too-many-lines", # bosch_camera.py is a deliberately flat single-file CLI
"too-many-branches", # argparse dispatch + cmd_* handlers are inherently branchy
"too-many-statements",
"too-many-locals",
"too-many-arguments",
"too-many-positional-arguments",
"broad-exception-caught", # network calls catch broadly to print a clean CLI error
"missing-function-docstring", # most cmd_* handlers have a module-level docstring instead
"invalid-name", # short CLI-local names (r, cm, cfg) are conventional here
"import-outside-toplevel", # optional-dependency (numpy/PIL/smbclient) + circular-import avoidance
"reimported", # same symbol imported lazily in multiple cmd_* scopes
"cell-var-from-loop", # closures are called synchronously within the same iteration, never deferred
"missing-timeout", # false positive — bosch_get/post/put (bosch_tls.py) set a kwargs.setdefault("timeout", 10)
"global-statement", # module-level lazy-init caches (bosch_cloud_ssl adapter, bosch_i18n lang cache)
"arguments-renamed", # urllib3 HTTPAdapter override intentionally matches urllib3's own param name drift
"too-many-instance-attributes", # bosch_maintenance.py's diagnostic report dataclass-like holder
"missing-class-docstring", # tiny local helper classes (e.g. the OAuth callback HTTP handler)
"redefined-builtin", # get_token.py's `format` param name mirrors argparse's own --format flag
"subprocess-run-check", # diagnostic subprocess calls (ipconfig/ffmpeg) already branch on stdout/returncode
"no-else-return", # explicit if/elif/else chains read clearer than de-indented early returns here
"too-many-return-statements", # cmd_* dispatch/status functions have one return per status branch by design
"too-many-nested-blocks", # deeply-nested RCP/stream fallback cascades reflect the real protocol cascade
"unused-argument", # argparse cmd_* signatures are fixed by the dispatch table, not all args used per command
"consider-using-with", # subprocess.Popen handles for long-running child processes (ffmpeg/go2rtc) outlive the function
"redefined-outer-name", # threading/signal/t re-imported locally in a few functions for lazy-import reasons
"useless-return", # explicit `return` at a function's end documents "no value on purpose" for cmd_* handlers
"fixme", # tracked TODOs (e.g. TURN/NAT-traversal) are deliberate backlog markers, not lint debt
"protected-access", # `proc._nvr_out_path`/`proc._go2rtc_cfg_path` SET a new custom attr on our own subprocess handle, not access an external private member
"no-else-break", # same readability call as no-else-return
]