-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
184 lines (158 loc) · 5.21 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
[tool.black]
line-length = 79
target-version = ["py310"]
[tool.ruff]
target-version = "py310"
[tool.ruff.lint]
ignore = [
"E501", # line-legth check
"D107", # Missing docstring in `__init__`
"D203", # black managed: one-blank-line-before-class
"D211", # black managed: no-blank-line-before-class
"D212", # black managed: multi-line-summary-first-line
"D213", # black managed: multi-line-summary-second-line
"D407", # [*] Missing dashed underline after section
"D412", # No blank lines allowed between a section header and its content
"INP001", # pdm managed: is part of an implicit namespace package. Add an `__init__.py`
"I001", # isort managed: Import block is un-sorted or un-formatted
"D100", # imho: shouldn't be enforced: Missing docstring in public module
"D103", # imho: docstrings in pub functions and classes shouldn't be enforced: Missing docstring in public function
"D104", # imho: docstrings in pub packages and classes shouldn't be enforced: Missing docstring in public function
"D101", # Missing docstring in public class
"COM812", # black managed: Trailing comma missing
"TRY003", # Avoid specifying long messages outside the exception class
"EM102", # Exception must not use an f-string literal, assign to variable first
"G004", # not a crime especially in loguru: Logging statement uses f-string
"S101", # Use of `assert` detected
"G010", # pcty_log use warn as access to Logging.warning: Logging statement uses `warn` instead of `warning`
"ERA001", # do not remove anything detected to be commented out code, this was removing intended comments
"F401", # do not remove unused imports in dags; there are expected to be imports that appear unused but will be used
"FA100", # Missing `from __future__ import annotations`, but uses `typing.Tuple`
"N812", # Lowercase `types` imported as non-lowercase `T`
"PLR0913", # Too many arguments to function call
"ANN", # ignore all annotation related errors as we use mypy
"PGH003", # Use specific rule codes when ignoring type issues (too much)
"D102", # If code is fully typed there are a lot of cases when we don't need docstrings. Missing docstring in public method
"D105", # Why we would need: Missing docstring in magic method
"EM101", # Exception must not use a string literal, assign to variable first
]
select = [
"ALL",
]
exclude = [
]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
"ANN001", # for fixtures that's expected: Missing type annotation for function argument
"ANN202", # Missing return type annotation for private function `call`
"ANN201", # test fnuctions no need to annotate: Missing return type annotation for public function
"PT019", # This is a mistake in ruff in case of pytest:parametrize:Fixture `_ext` without value is injected as parameter, use `@pytest.mark.usefixtures` instead
"PD901", # `df` is a bad variable name. Be kinder to your future self.
"ARG001", # Unused function argument
"ARG002", # Unused method argument:
"ARG003", # Unused method argument:
"PT015", # Assertion always fails, replace with `pytest.fail()`
"PT023", # Use `@pytest.mark.integration()` over `@pytest.mark.integration`
]
"tests/conftest.py" = [
"ALL"
]
[tool.coverage.run]
branch = false
source = [
"./pytest_when"
]
omit = [
]
[tool.coverage.paths]
source = ["./pytest_when"]
[tool.coverage.report]
fail_under = 100
skip_covered = true
show_missing = true
[tool.coverage.html]
directory = "coverage_html"
[tool.pytest.ini_options]
minversion = "7.2.0"
addopts = """
-vv
-s
"""
testpaths = "tests/"
[tool.isort]
atomic = true
line_length = 79
lines_after_imports = 2
lines_between_types = 1
use_parentheses = true
balanced_wrapping = true
include_trailing_comma = true
multi_line_output = 3
known_third_party = [
"pytest",
]
known_first_party = [
]
[tool.mypy]
allow_redefinition = false
check_untyped_defs = true
ignore_errors = false
ignore_missing_imports = true
implicit_reexport = false
local_partial_types = true
no_implicit_optional = true
strict_equality = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
namespace_packages = true
explicit_package_bases = true
[[tool.mypy.overrides]]
module = [
"conftest",
"tests.*",
"*.tests",
]
ignore_errors = true
[[tool.mypy.overrides]]
module = [
]
ignore_missing_imports = true
[tool.pdm]
[tool.pdm.dev-dependencies]
dev = [
"pre-commit>=2.21.0",
"black>=23.3.0",
"isort>=5.11.5",
"mypy>=1.2.0",
"ruff>=0.0.263",
]
test = [
"coverage>=7.3.1",
]
[tool.pdm.version]
source = "scm"
[project]
name = "pytest-when"
dynamic = ["version"]
description = "Utility which makes mocking more readable and controllable"
authors = [
{ name = "zhukovgreen", email = "iam+pytest-when@zhukovgreen.pro" },
]
dependencies = [
"pytest>=7.3.1",
"pytest-mock>=3.14.0",
"typing-extensions>=4.5.0",
]
requires-python = ">=3.10"
readme = "README.md"
[project.entry-points.pytest11]
pytest-when = "pytest_when.plugin"
[project.urls]
repository = "https://github.com/zhukovgreen/pytest-when"
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"