-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
255 lines (224 loc) · 8.67 KB
/
pyproject.toml
File metadata and controls
255 lines (224 loc) · 8.67 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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
[project]
name = "holobench"
version = "1.98.0"
authors = [{ name = "Austin Gregg-Smith", email = "blooop@gmail.com" }]
description = "A package for benchmarking the performance of arbitrary functions"
readme = "README.md"
license = "MIT"
requires-python = ">=3.10,<3.14"
dependencies = [
"holoviews>=1.15,<=1.22.1",
"numpy>=1.0,<=2.4.1",
"param>=1.13.0,<=2.3.3",
"hvplot>=0.12.0,<=0.12.2",
"panel>=1.3.6,<=1.8.10",
"diskcache>=5.6,<=5.6.3",
"optuna>=3.2,<=4.8.0",
"xarray>=2023.7,<=2025.6.1",
"plotly>=5.15,<=6.7.0",
"pandas>=2.0,<=3.0.0",
"strenum>=0.4.0,<=0.4.15",
"scikit-learn>=1.2,<=1.7.2",
"moviepy>=2.1.2,<=2.2.1",
"matplotlib>=3.7,<=3.10.8",
]
[project.urls]
Repository = "https://github.com/blooop/bencher"
Home = "https://github.com/blooop/bencher"
Documentation = "https://bencher.readthedocs.io/en/latest/"
[tool.pixi.workspace]
channels = ["conda-forge", "https://prefix.dev/blooop"]
platforms = ["linux-64"]
[tool.pixi.system-requirements]
libc = "2.31"
[tool.pixi.dependencies]
python = ">=3.10"
sqlite = "==3.48.0"
shellcheck = ">=0.10.0,<0.11"
devpod = ">=0.8.0,<0.9"
gh = ">=2.83.0,<3.0"
playwright = ">=1.50,<2"
[tool.pixi.feature.py310.dependencies]
python = "3.10.*"
[tool.pixi.feature.py311.dependencies]
python = "3.11.*"
[tool.pixi.feature.py312.dependencies]
python = "3.12.*"
[tool.pixi.feature.py313.dependencies]
python = "3.13.*"
[tool.pixi.pypi-dependencies]
holobench = { path = ".", editable = true }
[project.optional-dependencies]
test = [
"nbformat",
"nbclient>=0.7,<=0.10.4",
"ipykernel",
"pip",
"jupyter_bokeh",
"pylint>=3.2.5,<=4.0.5",
"pytest-cov>=4.1,<=7.1.0",
"pytest>=7.4,<=9.0.3",
"hypothesis>=6.104.2,<=6.152.1",
"ruff>=0.5.0,<=0.15.11",
"sphinxcontrib-mermaid>=1.0,<3.0",
"coverage>=7.5.4,<=7.13.5",
"prek>=0.2.28,<0.4.0",
"ty>=0.0.13,<=0.0.31",
]
#adds support for embedding rerun windows (alpha)
rerun = ["rerun-sdk>=0.31.3,<=0.31.3", "rerun-notebook>=0.31.3,<=0.31.3"]
#unused for the moment but may turn on later
# scoop = ["scoop>=0.7.0,<=0.7.2.0"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build]
include = ["bencher", "CHANGELOG.md"]
# Environments
[tool.pixi.environments]
default = { features = ["test", "rerun"], solve-group = "default" }
py310 = ["py310", "test", "rerun"]
py311 = ["py311", "test", "rerun"]
py312 = ["py312", "test", "rerun"]
py313 = ["py313", "test", "rerun"]
[tool.pixi.tasks]
#AI AGENT TASKS
#use this task to test any changes to the code, it will run docs, lint, and tests.
agent-iterate = { depends-on = [
"generate-docs",
"ci",
"perf-track",
"git-commit-all",
"fix-commit-push",
] }
dev-add-docker = "devpod provider list | grep -qw docker || devpod provider add docker"
dev = { cmd = "devpod up . --ide none && ssh pythontemplate.devpod", depends-on = [
"dev-add-docker",
] }
dev-vs = { cmd = "devpod up . --ide vscode", depends-on = ["dev-add-docker"] }
dev-restart = { cmd = "devpod up . --recreate --ide none && ssh pythontemplate.devpod", depends-on = [
"dev-add-docker",
] }
dev-restart-vs = { cmd = "devpod up . --recreate --ide vscode", depends-on = [
"dev-add-docker",
] }
prek = "prek run -a"
prek-install = "prek install"
prek-update = "prek autoupdate"
perf = "python bencher/example/example_self_benchmark.py"
perf-track = "python -c \"from bencher.example.example_self_benchmark import example_self_benchmark_over_time; example_self_benchmark_over_time()\""
format = "ruff format ."
check-clean-workspace = "git diff --exit-code"
ruff-lint = "ruff check . --fix"
pylint = "pylint --version && echo 'running pylint...' && pylint $(git ls-files '*.py')"
ty = "ty check --respect-ignore-files ."
lint = { depends-on = ["ruff-lint", "ty", "pylint"] }
style = { depends-on = ["format", "lint"] }
commit-format = "git commit -a -m'autoformat code' || true"
test = "pytest"
coverage = "coverage run -m pytest && coverage xml -o coverage.xml"
coverage-report = "coverage report -m"
update-lock = "pixi update && git commit -a -m'update pixi.lock' || true"
push = "git push"
update-lock-push = { depends-on = ["update-lock", "push"] }
fix = { depends-on = ["update-lock", "format", "ruff-lint", "prek"] }
fix-commit-push = { depends-on = ["fix", "commit-format", "update-lock-push"] }
ci-no-cover = { depends-on = ["style", "test"] }
ci = { depends-on = [
"format",
"ruff-lint",
"pylint",
"ty",
"generate-examples",
"coverage",
"coverage-report",
] }
git-commit-all = "git add -A && git commit -m 'Add all untracked files' || true"
ci-push = { depends-on = ["format", "ruff-lint", "update-lock", "ci", "push"] }
clear-pixi = "rm -rf .pixi pixi.lock"
ralph = "ralph"
update-from-template-repo = "./scripts/update_from_template.sh"
dev-use-prebuilt = "./scripts/devcontainer_use_prebuilt.sh"
dev-use-local = "./scripts/devcontainer_use_local.sh"
# Generate Python example files only (fast, no computation)
generate-examples = "python -c \"from bencher.example.meta.generate_examples import generate_python_files; generate_python_files()\""
# Generate + run + produce docs (HTML reports + RST)
generate-docs = "python bencher/example/meta/generate_examples.py"
docs = { cmd = "rm -rf docs/builtdocs; sphinx-build -b html docs docs/builtdocs", depends-on = [
"generate-docs",
] }
#cache management
cache-stats = "python -c 'from bencher.cache_management import print_cache_stats; print_cache_stats()'"
cache-clear = "python -c 'from bencher.cache_management import clear_all; clear_all()'"
cache-clear-media = "python -c 'from bencher.cache_management import clear_media; clear_media()'"
cache-clean-orphans = "python -c 'from bencher.cache_management import clean_orphaned_media; clean_orphaned_media(dry_run=False)'"
#demos
benchmark-save = "python scripts/benchmark_save.py"
demo = "python3 bencher/example/example_image.py"
demo_rerun = "python3 bencher/example/example_rerun.py"
#performance tracking
test-timing-xml = "pytest --junit-xml=test-results.xml"
test-timing-report = "python3 -m bencher.test_timing_report test-results.xml reports"
test-timing = { depends-on = ["test-timing-xml", "test-timing-report"] }
[tool.pylint]
extension-pkg-whitelist = ["numpy", "scipy"]
jobs = 16 #detect number of cores
ignore-paths = ["docs/.*", "bencher/example/generated/.*"]
[tool.pylint.'MESSAGES CONTROL']
disable = "C,logging-fstring-interpolation,line-too-long,fixme,missing-module-docstring,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-locals,too-many-branches,too-many-statements,use-dict-literal,duplicate-code,too-many-public-methods,too-many-nested-blocks,cyclic-import,too-many-positional-arguments"
enable = "no-else-return,consider-using-in"
[tool.coverage.run]
omit = ["*/test/*", "__init__.py"]
[tool.coverage.report]
exclude_also = [
"def __repr__",
"if False:",
"if 0:",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"pass",
"(_):",
]
[tool.pytest.ini_options]
tmp_path_retention_count = 0
[tool.ty.rules]
# Ignore type errors related to param library descriptors
invalid-assignment = "ignore"
# Ignore argument type mismatches (many false positives with param library)
invalid-argument-type = "ignore"
# Ignore unresolved attributes (param descriptors create dynamic attributes)
unresolved-attribute = "ignore"
# Ignore invalid type forms (pn.panel is a function, not a type)
invalid-type-form = "ignore"
# Ignore return type mismatches
invalid-return-type = "ignore"
# Ignore not-subscriptable errors
not-subscriptable = "ignore"
# Ignore possibly missing attributes (Union type issues)
possibly-missing-attribute = "ignore"
# Ignore unsupported operator errors
unsupported-operator = "ignore"
# Ignore positional argument count errors
too-many-positional-arguments = "ignore"
missing-argument = "ignore"
# Ignore not-iterable errors (Union types)
not-iterable = "ignore"
# Ignore overload matching errors
no-matching-overload = "ignore"
# Ignore call-non-callable errors
call-non-callable = "ignore"
# Ignore call-top-callable errors (callable() guard + call on union types)
call-top-callable = "ignore"
# Ignore method override errors
invalid-method-override = "ignore"
# Ignore import/reference resolution errors
unresolved-import = "ignore"
unresolved-reference = "ignore"
# Ignore parameter default errors (param library StrEnum/enum descriptors resolve as Unknown)
invalid-parameter-default = "ignore"
# Ignore MRO errors (param base classes resolve as Unknown)
inconsistent-mro = "ignore"
# Ignore unused type: ignore comments (needed for other type checkers)
unused-ignore-comment = "ignore"
unused-type-ignore-comment = "ignore" # same rule, renamed in ty >= 0.0.14