-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
149 lines (123 loc) · 4.16 KB
/
pyproject.toml
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
[build-system]
requires = ["hatchling", "hatch-requirements-txt"]
build-backend = "hatchling.build"
[project]
name = "habapp_rules"
description = "Basic rules for HABApp"
long_description = "Basic rules for HABApp"
authors = [{ name = "Seuling N." }]
license = "Apache-2.0"
dynamic = ["dependencies", "optional-dependencies", "version"]
requires-python = ">=3.10"
[tool.coverage]
branch = true
concurrency = "thread"
context = "(empty)"
disable_warnings = ["module-not-imported"]
dynamic_context = "test_function"
source = ["habapp_rules", "tests"]
omit = ["*oh_item.py", "*rule_runner.py", "*run_unittest.py", "*__version__.py"]
[tool.coverage.exclude_lines]
pragma = "no cover"
if_main = "if __name__ == \"__main__\":"
if_typing = "if typing.TYPE_CHECKING:"
typing_overload = "@(typing.)?overload"
[tool.coverage.report]
fail_under = 100
skip_covered = true
omit = ["*/helper/graph_machines.py", "*oh_item.py", "*rule_runner.py"]
[tool.hatch.build.targets.wheel]
include = ["habapp_rules"]
[tool.hatch.envs.lint]
detached = true
dependencies = ["pre-commit"]
[tool.hatch.envs.lint.scripts]
check = "pre-commit run --all-files"
[tool.hatch.envs.publish]
detached = true
[tool.hatch.envs.tests]
dependencies = ["coverage", "pytest", "graphviz"]
[tool.hatch.envs.tests.scripts]
local = "coverage run tests/run_unittest.py && coverage html --skip-covered --fail-under=100"
[tool.hatch.metadata.hooks.requirements_txt]
files = ["requirements.txt"]
[tool.hatch.metadata] # remove when HABApp dev is released
allow-direct-references = true
[tool.hatch.version]
path = "habapp_rules/__init__.py"
#[tool.mypy]
#python_version = 3.12
#files = "habapp_rules"
#plugins = "pydantic.mypy"
#exclude = "tests"
#check_untyped_defs = true
#disallow_any_generics = true
#disallow_incomplete_defs = true
#disallow_untyped_calls = true
#extra_checks = true
#follow_imports = "silent"
#local_partial_types = true
#no_implicit_reexport = true
#show_error_codes = true
#strict_equality = true
#warn_redundant_casts = true
#warn_return_any = true
#warn_unused_configs = true
#warn_unused_ignores = true
[[tool.mypy.overrides]]
module = ["pydantic.*"]
ignore_missing_imports = true
no_implicit_reexport = false
[tool.ruff]
indent-width = 4
line-length = 250
preview = true
exclude=["*rule_runner.py"]
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
indent-style = "space"
line-ending = "auto"
quote-style = "double"
skip-magic-trailing-comma = false
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"COM812", # Missing trailing commas
"CPY", # Missing copyright notice
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"DOC502", # Raised exception is not explicitly raised
"E501", # Line too long
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"G004", # Logging statement uses f-string
"ISC001", # Implicitly concatenated string literals on one line
"PD", # Pandas
"PLR0911", # Too many return statements
"PLR0913", # Too many arguments in function definition
"PLR0917", # Too many positional arguments
]
[tool.ruff.lint.isort]
split-on-trailing-comma = true
[tool.ruff.lint.per-file-ignores]
# Ignore certain rules in the 'tests/' directory
"tests/*" = [
"DTZ001", # datetime.datetime() called without a tzinfo argument
"DTZ002", # datetime.datetime.today() used
"DTZ005", # datetime.datetime.now() called without a tz argument
"FBT003", # Boolean-typed keyword argument in function call
"PLC2701", # Private name import
"PLR0915", # Too many statements
"PLR2004", # Magic value used in comparison
"PLR0904", # Too many public methods
"PLR6301", # Method could be a function, class method, or static method
"PT", # pytest style -> this pkg is using unittest
"PYI024", # Use typing.NamedTuple instead of collections.namedtuple
"S101", # Use of assert detected
"SLF001", # Private member accessed
]
[tool.ruff.lint.pydocstyle]
convention = "google"