Debian Codegraph @

pyproject.toml

raw
1 [build-system]
2 requires = ["hatchling"]
3 build-backend = "hatchling.build"
4
5 [project]
6 name = "ha-iotawattpy"
7 license = {text = "GPL-3.0-or-later"}
8 description = "Python library for the IoTaWatt Energy device"
9 readme = "README.md"
10 authors = [
11 {name = "Greg Diehl", email = "[email protected]"},
12 {name = "Stefan Agner", email = "[email protected]"},
13 ]
14 keywords = ["iotawatt", "energy", "home-assistant"]
15 classifiers = [
16 "Intended Audience :: Developers",
17 "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
18 "Operating System :: OS Independent",
19 "Programming Language :: Python :: 3.13",
20 "Programming Language :: Python :: 3.14",
21 ]
22 requires-python = ">=3.13"
23 dependencies = [
24 "httpx>=0.24",
25 ]
26 version = "0.3.0"
27
28 [project.urls]
29 "Homepage" = "https://pypi.org/project/ha-iotawattpy"
30 "Source Code" = "https://github.com/home-assistant-libs/iotawattpy"
31 "Bug Reports" = "https://github.com/home-assistant-libs/iotawattpy/issues"
32
33 [dependency-groups]
34 dev = [
35 "mypy>=1.10",
36 "pre-commit>=4.0",
37 "pytest>=8",
38 "pytest-asyncio>=0.23",
39 "pytest-cov>=5",
40 "pytest-timeout>=2",
41 "respx>=0.21",
42 "ruff>=0.6",
43 ]
44
45 [tool.hatch.build.targets.wheel]
46 packages = ["iotawattpy"]
47
48 [tool.hatch.build.targets.sdist]
49 include = [
50 "/iotawattpy",
51 ]
52
53 [tool.coverage.report]
54 show_missing = true
55 # Test suite is currently minimal; raise this as tests are added.
56 fail_under = 0
57
58 [tool.coverage.run]
59 source = ["iotawattpy"]
60 branch = true
61
62 [tool.mypy]
63 # Specify the target platform details in config, so your developers are
64 # free to run mypy on Windows, Linux, or macOS and get consistent
65 # results.
66 platform = "linux"
67 python_version = "3.13"
68
69 # show error messages from unrelated files
70 follow_imports = "normal"
71
72 # suppress errors about unsatisfied imports
73 ignore_missing_imports = true
74
75 # be strict
76 check_untyped_defs = true
77 disallow_any_generics = true
78 disallow_incomplete_defs = true
79 disallow_subclassing_any = true
80 disallow_untyped_calls = true
81 disallow_untyped_decorators = true
82 disallow_untyped_defs = true
83 no_implicit_optional = true
84 strict_optional = true
85 warn_incomplete_stub = true
86 warn_no_return = true
87 warn_redundant_casts = true
88 warn_return_any = true
89 warn_unused_configs = true
90 warn_unused_ignores = true
91
92 [tool.pytest.ini_options]
93 addopts = "--cov"
94 asyncio_mode = "auto"
95
96 [tool.ruff.lint]
97 ignore = [
98 "ANN401", # Opinionated warning on disallowing dynamically typed expressions
99 "COM812", # Recommended to disable due to conflicts with ruff format
100 "D203", # Conflicts with other rules
101 "D213", # Conflicts with other rules
102 "D417", # False positives in some occasions
103 "ISC001", # Recommended to disable due to conflicts with ruff format
104 "PLR2004", # Just annoying, not really useful
105 "PLR0913", # Too many arguments
106 ]
107 select = ["ALL"]
108
109 [tool.ruff.lint.per-file-ignores]
110 # The library exposes a stable camelCase API consumed by Home Assistant
111 # (e.g. getName, setValue, integratedInterval). The naming rules are
112 # disabled package-wide rather than per-method to keep the source clean.
113 "iotawattpy/**" = [
114 "N802", # Function name should be lowercase
115 "N803", # Argument name should be lowercase
116 "N806", # Variable in function should be lowercase
117 "N815", # Variable in class scope should not be mixedCase
118 "FBT001", # Boolean-typed positional argument
119 "FBT002", # Boolean default positional argument
120 ]
121 "tests/**" = [
122 "D100", # Missing docstring in public module
123 "D103", # Missing docstring in public function
124 "D104", # Missing docstring in public package
125 "FBT001", # boolean-type-hint-positional-argument
126 "N802", # Function name {name} should be lowercase
127 "N816", # Variable {name} in global scope should not be mixedCase
128 "PLR0913", # Too many arguments in function definition
129 "S101", # Use of assert detected
130 "SLF001", # Private member accessed: {access}
131 "T201", # print found
132 ]
133 "example.py" = [
134 "D", # docstrings not required in example script
135 "T201", # print allowed
136 "ANN", # annotations not strictly required
137 "INP001", # implicit namespace package
138 ]
139
140 [tool.ruff.lint.flake8-pytest-style]
141 fixture-parentheses = false
142 mark-parentheses = false
143
144 [tool.ruff.lint.isort]
145 known-first-party = ["iotawattpy"]
146 force-sort-within-sections = true
147 split-on-trailing-comma = false
148 combine-as-imports = true