Debian Codegraph @

pyproject.toml

raw
1 [build-system]
2 requires = ["setuptools>=77.0"]
3 build-backend = "setuptools.build_meta"
4
5 [project]
6 name = "cookidoo-api"
7 dynamic = ["version", "readme"]
8 description = "Unofficial package to access Cookidoo."
9 authors = [
10 { name = "Cyrill Raccaud", email = "[email protected]" },
11 ]
12 dependencies = [
13 "aiohttp~=3.13",
14 "aiofiles~=25.1",
15 "isodate~=0.7.2",
16 ]
17 requires-python = ">=3.12"
18
19 classifiers = [
20 "Programming Language :: Python :: 3",
21 "Operating System :: OS Independent",
22 "Intended Audience :: Information Technology",
23 "Topic :: System :: Monitoring",
24 "Topic :: System :: Logging",
25 "Topic :: System :: Systems Administration",
26 ]
27 license = "MIT"
28 keywords = ["cookidoo", "todo", "home-assistant", "iot"]
29
30 [tool.setuptools]
31
32 [tool.setuptools.packages.find]
33 include = ["cookidoo_api*"]
34
35 [tool.setuptools.package-data]
36 cookidoo_api = ["py.typed", '*.json']
37
38 [tool.setuptools.dynamic]
39 version = {attr = "cookidoo_api.__version__"}
40 readme = {file = ["README.md"], content-type = "text/markdown"}
41
42 [project.urls]
43 Documentation = "https://miaucl.github.io/cookidoo-api/"
44 Source = "https://github.com/miaucl/cookidoo-api"
45 Issues = "https://github.com/miaucl/cookidoo-api/issues"
46 "Release notes" = "https://github.com/miaucl/cookidoo-api/releases"
47
48
49 [tool.ruff]
50
51 target-version = "py312" # Python 3.12
52
53 [tool.ruff.lint]
54 select = [
55 "B002", # Python does not support the unary prefix increment
56 "B007", # Loop control variable {name} not used within loop body
57 "B014", # Exception handler with duplicate exception
58 "B023", # Function definition does not bind loop variable {name}
59 "B026", # Star-arg unpacking after a keyword argument is strongly discouraged
60 "C", # complexity
61 "COM818", # Trailing comma on bare tuple prohibited
62 "D", # docstrings
63 "DTZ003", # Use datetime.now(tz=) instead of datetime.utcnow()
64 "DTZ004", # Use datetime.fromtimestamp(ts, tz=) instead of datetime.utcfromtimestamp(ts)
65 "E", # pycodestyle
66 "F", # pyflakes/autoflake
67 "G", # flake8-logging-format
68 "I", # isort
69 "ICN001", # import concentions; {name} should be imported as {asname}
70 "N804", # First argument of a class method should be named cls
71 "N805", # First argument of a method should be named self
72 "N815", # Variable {name} in class scope should not be mixedCase
73 "S307", # No builtin eval() allowed
74 "PGH004", # Use specific rule codes when using noqa
75 "PLC0414", # Useless import alias. Import alias does not rename original package.
76 "PLC", # pylint
77 "PLE", # pylint
78 "PLR", # pylint
79 "PLW", # pylint
80 "Q000", # Double quotes found but single quotes preferred
81 "RUF006", # Store a reference to the return value of asyncio.create_task
82 "S102", # Use of exec detected
83 "S103", # bad-file-permissions
84 "S108", # hardcoded-temp-file
85 "S306", # suspicious-mktemp-usage
86 "S307", # suspicious-eval-usage
87 "S313", # suspicious-xmlc-element-tree-usage
88 "S314", # suspicious-xml-element-tree-usage
89 "S315", # suspicious-xml-expat-reader-usage
90 "S316", # suspicious-xml-expat-builder-usage
91 "S317", # suspicious-xml-sax-usage
92 "S318", # suspicious-xml-mini-dom-usage
93 "S319", # suspicious-xml-pull-dom-usage
94 "S601", # paramiko-call
95 "S602", # subprocess-popen-with-shell-equals-true
96 "S604", # call-with-shell-equals-true
97 "S608", # hardcoded-sql-expression
98 "S609", # unix-command-wildcard-injection
99 "SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass
100 "SIM117", # Merge with-statements that use the same scope
101 "SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys()
102 "SIM201", # Use {left} != {right} instead of not {left} == {right}
103 "SIM208", # Use {expr} instead of not (not {expr})
104 "SIM212", # Use {a} if {a} else {b} instead of {b} if not {a} else {a}
105 "SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'.
106 "SIM401", # Use get from dict with default instead of an if block
107 "T100", # Trace found: {name} used
108 "T20", # flake8-print
109 "TID251", # Banned imports
110 "TRY004", # Prefer TypeError exception for invalid type
111 "B904", # Use raise from to specify exception cause
112 "TRY", # tryceratops
113 "UP", # pyupgrade
114 "W", # pycodestyle
115 ]
116
117 ignore = [
118 "D202", # No blank lines allowed after function docstring
119 "D203", # 1 blank line required before class docstring
120 "D213", # Multi-line docstring summary should start at the second line
121 "E501", # line too long
122
123 # Ignore ignored, as the rule is now back in preview/nursery, which cannot
124 # be ignored anymore without warnings.
125 # https://github.com/astral-sh/ruff/issues/7491
126 # "PLC1901", # Lots of false positives
127
128 "PLR0912", # Too many branches ({branches} > {max_branches})
129 "PLR0913", # Too many arguments to function call ({c_args} > {max_args})
130 "PLR0915", # Too many statements ({statements} > {max_statements})
131 "PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
132 "TRY003", # Avoid specifying long messages outside the exception class
133
134 # May conflict with the formatter, https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
135 "W191",
136 "E111",
137 "E114",
138 "E117",
139 "D206",
140 "D300",
141 "Q000",
142 "Q001",
143 "Q002",
144 "Q003",
145 "COM812",
146 "COM819",
147 "ISC001",
148 "ISC002",
149 ]
150
151 [tool.ruff.lint.flake8-pytest-style]
152 fixture-parentheses = false
153
154 [tool.ruff.lint.flake8-tidy-imports.banned-api]
155 "async_timeout".msg = "use asyncio.timeout instead"
156 "pytz".msg = "use zoneinfo instead"
157
158 [tool.ruff.lint.isort]
159 force-sort-within-sections = true
160 known-first-party = [
161 "cookidoo_api",
162 ]
163 combine-as-imports = true
164 split-on-trailing-comma = false
165
166 [tool.ruff.lint.per-file-ignores]
167
168 # Allow for main entry & scripts to write to stdout
169 "cookidoo_api/__main__.py" = ["T201"]
170 "cookidoo_api/scripts/*" = ["T201"]
171 "scripts/*" = ["T20"]
172 "tests/*" = ["T20"]
173 "smoke_test/*" = ["T20"]
174
175 [tool.ruff.lint.mccabe]
176 max-complexity = 25
177
178 [tool.pytest.ini_options]
179 asyncio_mode = "auto"
180 testpaths = [
181 "tests",
182 ]
183 log_cli = true
184 # log_cli_level = "DEBUG"
185 log_cli_format = "%(asctime)s%(msecs)03d [%(levelname)8s] %(name)s:%(lineno)s %(message)s"
186 log_cli_date_format = "%Y%m%dT%H%M%S."
187
188 [tool.coverage.run]
189 branch = true
190 source = ["tests"]
191
192 [tool.coverage.report]
193 format="text"
194 show_missing = true
195
196 # Regexes for lines to exclude from consideration
197 exclude_also = [
198 # Don't complain about missing debug-only code:
199 "def __repr__",
200 "if self\\.debug",
201
202 # Don't complain if tests don't hit defensive assertion code:
203 "raise AssertionError",
204 "raise NotImplementedError",
205
206 # Don't complain if non-runnable code isn't run:
207 "if 0:",
208 "if __name__ == .__main__.:",
209
210 # Don't complain about abstract methods, they aren't run:
211 "@(abc\\.)?abstractmethod",
212 ]
213
214 [tool.coverage.html]
215 directory = "coverage_html_report"
216
217 [tool.mypy]
218 python_version = "3.12"
219 plugins = "pydantic.mypy"
220 show_error_codes = true
221 follow_imports = "normal"
222 local_partial_types = true
223 strict_equality = true
224 no_implicit_optional = true
225 warn_incomplete_stub = true
226 warn_redundant_casts = true
227 warn_unused_configs = true
228 warn_unused_ignores = true
229 enable_error_code = ["ignore-without-code", "redundant-self", "truthy-iterable"]
230 disable_error_code = ["annotation-unchecked", "import-not-found", "import-untyped"]
231 extra_checks = false
232 check_untyped_defs = true
233 disallow_incomplete_defs = true
234 disallow_subclassing_any = true
235 disallow_untyped_calls = true
236 disallow_untyped_decorators = true
237 disallow_untyped_defs = true
238 warn_return_any = true
239 warn_unreachable = true