-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
203 lines (189 loc) · 4.79 KB
/
pyproject.toml
File metadata and controls
203 lines (189 loc) · 4.79 KB
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
194
195
196
197
198
199
200
201
202
203
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "pyproject"
dynamic = ["version"]
description = "Template for Python projects."
readme = "README.md"
requires-python = ">=3.12,<3.13"
license = { file = "LICENSE.md" }
authors = [{ name = "Tho Nguyen", email = "contact@naiwaaa.simplelogin.com" }]
dependencies = [
"numpy>=2.1.3",
"matplotlib>=3.9.2",
"polars[numpy,plot,pydantic,style]>=1.15.0",
"scipy>=1.14.1",
"scikit-learn>=1.5.2",
"pillow>=11.0.0",
"scikit-image>=0.24.0",
#
"torch>=2.5.1",
"torchaudio>=2.5.1",
"torchvision>=0.20.1",
#
"graphviz>=0.20.3",
"pydot>=3.0.2",
"wandb>=0.18.7",
"pydantic>=2.10.2",
"pydantic-settings>=2.6.1",
"cloudpickle>=3.1.0",
"rich[jupyter]>=13.9.4",
"structlog>=24.4.0",
]
[project.urls]
Homepage = "https://git.sr.ht/~naiwaaa/pyproject-template"
Repository = "https://git.sr.ht/~naiwaaa/pyproject-template"
[project.scripts]
cli = "pyproject.cli:main"
[tool.hatch.version]
path = "src/pyproject/__init__.py"
[tool.uv.sources]
torch = [{ index = "pytorch-cu124", marker = "platform_system != 'Darwin'" }]
torchvision = [{ index = "pytorch-cu124", marker = "platform_system != 'Darwin'" }]
torchaudio = [{ index = "pytorch-cu124", marker = "platform_system != 'Darwin'" }]
[[tool.uv.index]]
name = "pytorch-cu124"
url = "https://download.pytorch.org/whl/cu124"
explicit = true
[dependency-groups]
dev = ["pre-commit>=4.0.1", "ruff>=0.8.1"]
docs = ["pdoc>=15.0.0"]
notebooks = ["jupyterlab>=4.3.1", "jupytext>=1.16.4"]
testing = [
"pytest>=8.3.3",
"pytest-cov>=6.0.0",
"pytest-mock>=3.14.0",
"pytest-memray>=1.7.0",
"pytest-pretty>=1.2.0",
"pytest-clarity>=1.0.1",
"pytest-randomly>=3.16.0",
"pytest-instafail>=0.5.0",
"pytest-benchmark>=5.1.0",
"hypothesis>=6.121.1",
]
type-checking = ["mypy[faster-cache]>=1.13.0", "types-pillow>=10.2.0.20240822"]
all = [
{ include-group = 'dev' },
{ include-group = 'docs' },
{ include-group = 'notebooks' },
{ include-group = 'testing' },
{ include-group = 'type-checking' },
]
[tool.mypy]
mypy_path = "src"
python_version = "3.12"
exclude = [".cache/", ".venv/"]
# disallow dynamic typing
disallow_any_explicit = true
disallow_any_generics = 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
implicit_optional = false
strict_optional = true
# configuring warnings
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_return_any = true
warn_unreachable = true
# miscellaneous strictness flags
allow_redefinition = false
enable_error_code = [
"redundant-self",
"redundant-expr",
"possibly-undefined",
"truthy-bool",
"truthy-iterable",
"ignore-without-code",
"unused-ignore",
"narrowed-type-not-subtype",
]
implicit_reexport = false
strict_concatenate = true
strict_equality = true
strict = true
# configuring error messages
show_error_context = true
show_column_numbers = true
hide_error_codes = false
# incremental mode
cache_dir = ".cache/mypy"
# advanced options
plugins = ["numpy.typing.mypy_plugin", "pydantic.mypy"]
# miscellaneous
warn_unused_configs = false
[[tool.mypy.overrides]]
module = ["matplotlib.*", "sklearn.*"]
ignore_missing_imports = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true
[tool.pytest.ini_options]
addopts = [
# general
"--exitfirst",
"-vv",
"--failed-first",
# reporting
"--durations=5",
"-ra",
"--showlocals",
# warnings
"--strict-config",
"--strict-markers",
# collection
# "--ignore-glob=**/fixtures/*",
"--import-mode=importlib",
"--doctest-modules",
"--doctest-continue-on-failure",
# pytest-cov
"--cov",
"--cov-report=term-missing:skip-covered",
"--cov-config=pyproject.toml",
# pytest-memray
"--memray",
"--most-allocations=5",
# pytest-clarity
"--diff-symbols",
# pytest-instafail
"--instafail",
# pytest-benchmark
"--benchmark-warmup=on",
"--benchmark-columns=min,mean,stddev,outliers,rounds,iterations",
"--benchmark-sort=mean",
"--benchmark-disable-gc",
"--benchmark-storage=file://./.cache/benchmarks",
"--benchmark-disable",
# hypothesis
"--hypothesis-show-statistics",
"--hypothesis-explain",
]
cache_dir = ".cache/pytest"
doctest_optionflags = "NUMBER IGNORE_EXCEPTION_DETAIL"
markers = ["slow: mark tests as slow"]
testpaths = ["src", "tests"]
verbosity_assertions = 2
xfail_strict = true
[tool.coverage.run]
source = ["src"]
branch = true
data_file = ".cache/coverage"
relative_files = true
[tool.coverage.report]
fail_under = 0
show_missing = true
skip_covered = true
exclude_lines = [
"no cover",
"if TYPE_CHECKING:",
"raise NotImplementedError",
"if __name__ == .__main__.:",
]