-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpyproject.toml
195 lines (173 loc) · 6.28 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
194
195
# metadata
# ==================================================
[project]
name = "muutils"
version = "0.8.3"
description = "miscellaneous python utilities"
readme = "README.md"
requires-python = ">=3.8"
license = { text = "GPL-3.0-only" }
authors = [
{ name = "mivanit", email = "[email protected]" }
]
classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Development Status :: 4 - Beta",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Topic :: Utilities",
"Typing :: Typed",
]
dependencies = [] # no required deps!
[project.urls]
Homepage = "https://miv.name/muutils"
Repository = "https://github.com/mivanit/muutils"
Documentation = "https://miv.name/muutils/"
Issues = "https://github.com/mivanit/muutils/issues"
# dependencies
# ==================================================
[project.optional-dependencies]
array = [
"numpy>=1.24.4; python_version < '3.9'",
"numpy>1.24.4; python_version >= '3.9'",
"torch>=1.13.1,<2.5.0; python_version < '3.9'",
"torch>=1.13.1; python_version >= '3.9' and python_version < '3.13'",
"torch>=2.5.0; python_version >= '3.13'",
"jaxtyping>=0.2.12",
]
# special group for CI, where we install cpu torch separately
array_no_torch = [
"numpy>=1.24.4; python_version < '3.9'",
"numpy>1.24.4; python_version >= '3.9'",
"jaxtyping>=0.2.12",
]
notebook = [
"ipython>=8.0.0",
]
parallel = [
"multiprocess>=0.70.17",
"tqdm>=4.67.1",
]
[dependency-groups]
dev = [
# typing
"mypy>=1.0.1; python_version < '3.9'",
"mypy>=1.15; python_version >= '3.9'",
"typing-extensions; python_version < '3.11'",
"beartype>=0.14.1",
# tests & coverage
"pytest>=8.2.2",
"pytest-cov>=4.1.0",
"coverage-badge>=1.1.0",
# for testing plotting and notebooks
"ipykernel",
"jupyter",
"matplotlib>=3.0.0",
"plotly>=5.0.0",
# generating docs
"pdoc>=14.6.0",
# https://github.com/mivanit/muutils/security/dependabot/7
"jinja2>=3.1.5",
# lmcat -- a custom library. not exactly docs, but lets an LLM see all the code
"lmcat>=0.2.0; python_version >= '3.11'",
# tomli since no tomlib in python < 3.11
"tomli>=2.1.0; python_version < '3.11'",
]
lint = [
# lint
"pycln>=2.1.3",
"ruff>=0.4.8",
]
# build system and tooling configuration
# ==================================================
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.pytest.ini_options]
filterwarnings = [
"ignore::muutils.nbutils.configure_notebook.UnknownFigureFormatWarning", # don't show warning for unknown figure format
"ignore::muutils.nbutils.configure_notebook.PlotlyNotInstalledWarning", # don't show warning for missing plotly
"ignore::muutils.json_serialize.serializable_dataclass.ZanjMissingWarning", # don't show warning for missing zanj (can't have as a dep since zanj depends on muutils)
"ignore: PEP 484 type hint*:beartype.roar._roarwarn.BeartypeDecorHintPep585DeprecationWarning",
]
addopts = "--jaxtyping-packages=beartype.beartype"
[tool.ruff]
# Exclude the directories specified in the global excludes
exclude = ["tests/input_data", "tests/junk_data", "_wip/"]
[tool.pycln]
all = true
exclude = ["tests/input_data", "tests/junk_data", "_wip/"]
[tool.mypy]
exclude = ["tests/input_data", "tests/junk_data", "tests/_temp/", "_wip/"]
show_error_codes = true
# we disable this in the makefile for old versions
check_untyped_defs = true
[tool.lmcat]
output = "docs/other/lmcat.txt" # changing this might mean it wont be accessible from the docs
ignore_patterns = [
"docs/**",
".venv/**",
".git/**",
".meta/**",
"uv.lock",
".ruff_cache/**",
".github/ISSUE_TEMPLATE/**",
"_wip/**",
"sweep.yaml",
# there are... a lot of tests. we usually dont need to put these in lmcat
"tests/**",
]
[tool.lmcat.glob_process]
"[mM]akefile" = "makefile_recipes"
# [tool.makefile]
# =================================================================
[tool.makefile.docs]
warnings_ignore = [
"Error parsing type annotation .* for muutils\\..*\\. Import of np failed:",
"Error parsing type annotation .* for muutils\\..*\\. Import of JsonSerializer failed:",
"Error parsing type annotation .* for muutils\\..*\\. Import of StatCounter failed:",
"Error parsing type annotation .* for muutils\\..*\\. Import of Union failed:"
]
# Custom export configurations
[tool.makefile.uv-exports]
args = [
"--no-hashes"
]
exports = [
# no groups, no extras, just the base dependencies
{ name = "base", groups = false, extras = false },
# all extras but no groups
{ name = "extras", groups = false, extras = true },
# include the dev group (this is the default behavior)
{ name = "dev", groups = true },
# only the lint group -- custom options for this
{ name = "lint", options = ["--only-group", "lint"] },
# all groups and extras
{ name = "all", filename="requirements.txt", groups = true, extras=true },
# all groups and extras, a different way
{ name = "all", groups = true, options = ["--all-extras"] },
]
[tool.makefile.inline-todo]
search_dir = "."
out_file = "docs/other/todo-inline.md" # changing this might mean it wont be accessible from the docs
context_lines = 5
extensions = ["py", "md"]
tags = ["CRIT", "TODO", "FIXME", "HACK", "BUG", "NOTE"]
exclude = [
"docs/**",
".venv/**",
"scripts/get_todos.py",
"_wip/**",
]
[tool.inline-todo.tag_label_map]
NOTE = "documentation"
CRIT = "bug"
TODO = "enhancement"
FIXME = "bug"
BUG = "bug"
HACK = "enhancement"