-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
193 lines (157 loc) · 4.17 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
185
186
187
188
189
190
191
192
193
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "duper"
description = ''
readme = "README.md"
requires-python = ">=3.7"
keywords = []
authors = [
{ name = "Bobronium", email = "[email protected]" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"typing_extensions; python_version < '3.11'",
"mypy-extensions",
]
dynamic = ["version"]
[tool.hatch.dirs.env]
virtual = ".hatch"
#path = "./.venv_{env_name}"
[project.optional-dependencies]
dev = ["astpretty", "bytecode"]
benchmark = ["pyinstrument", "ipython", "dill", "orjson"]
typing = ["mypy"]
profiling = ["pyinstrument"]
debugging = ["ipython"]
style = ["ruff", "black", "isort", "pyupgrade"]
testing = ["pytest", "pytest-cov"]
[project.urls]
Documentation = "https://github.com/Bobronium/duper#readme"
Issues = "https://github.com/Bobronium/duper/issues"
Source = "https://github.com/Bobronium/duper"
[tool.hatch.version]
path = "duper/__about__.py"
[tool.hatch.envs.default]
path = ".venv"
features = ["benchmark", "lint", "test", "build"]
[tool.hatch.envs.311]
path = ".venv_311"
python = "3.11"
features = ["benchmark", "lint", "test", "build"]
dependencies = [
"pytest",
"pytest-cov",
]
[tool.hatch.envs.test]
features = ["testing"]
[tool.hatch.envs.test.scripts]
version = "python --version"
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=duper --cov=tests {args}"
no-cov = "cov --no-cov {args}"
[tool.hatch.envs.style]
features = ["style"]
[tool.hatch.envs.types]
features = ["typing"]
[tool.hatch.envs.types.scripts]
check = [
"mypy {env:PACKAGE}",
]
[tool.hatch.envs.default.env-vars]
PACKAGE = "{root}/duper"
TESTS = "{root}/tests"
SOURCES = "{root}/tests {root}/duper"
[tool.hatch.envs.style.scripts]
# hatch run is pretty slow and it doesn't feel good to use it
# TODO: fix this or find a snapier alternative
check = [
"ruff {env:SOURCES}",
"black --check {args} {env:SOURCES}",
"isort --check-only {args} {env:SOURCES}",
]
# Relatively safe operation that shouldn't break anything.
fmt = [
"isort {env:SOURCES}",
"black {env:SOURCES}",
]
# fmt + auto fixes. Potentially can lead to unwanted changes.
fix = [
"pyupgrade --py310-plus --exit-zero-even-if-changed {env:PACKAGE}/**/*.py {env:PACKAGE}/*.py",
"ruff {env:SOURCES} --fix",
"fmt",
]
[tool.coverage.run]
branch = true
parallel = true
omit = [
"duper/__about__.py",
]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.isort]
force_single_line = true
lines_after_imports = 2
line_length = 100
profile = "black"
[tool.black]
line_length = 100
[tool.ruff]
line-length = 100
ignore = ["E501"]
[tool.mypy]
# are these possible to comply with?
# disallow_any_expr = true
# disallow_any_explicit = true
disallow_any_unimported = true
disallow_any_decorated = true
disallow_any_generics = true
disallow_subclassing_any = true
# Untyped definitions and calls
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
# None and Optional handling
no_implicit_optional = true
strict_optional = true
# Configuring warnings
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_return_any = true
warn_unreachable = true
warn_incomplete_stub = true
warn_unused_configs = true
# Suppressing errors
ignore_errors = false
enable_error_code = "ignore-without-code"
# Miscellaneous strictness flags
allow_untyped_globals = false
allow_redefinition = false
local_partial_types = false
implicit_reexport = false
strict_equality = true
strict = true
no_silence_site_packages = true
# Configuring error messages
show_error_context = false
show_column_numbers = false
show_error_codes = true
color_output = true
error_summary = true