-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathpyproject.toml
260 lines (242 loc) · 5.75 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
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
256
257
258
259
260
[build-system]
requires = ["maturin>=1.7,<2.0"]
build-backend = "maturin"
[project]
name = "egglog"
description = "e-graphs in Python built around the the egglog rust library"
readme = "README.md"
dynamic = ["version"]
license = { text = "MIT" }
requires-python = ">=3.10"
classifiers = [
"Environment :: MacOS X",
"Environment :: Win32 (MS Windows)",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Compilers",
"Topic :: Software Development :: Interpreters",
"Typing :: Typed",
]
dependencies = ["typing-extensions", "black", "graphviz", "anywidget"]
[project.optional-dependencies]
array = [
"scikit-learn",
"array_api_compat",
"numba==0.59.1",
"llvmlite==0.42.0",
]
dev = [
"ruff",
"pre-commit",
"mypy",
"anywidget[dev]",
"egglog[docs,test]",
"jupyterlab",
]
test = [
"pytest",
"mypy",
"syrupy",
"egglog[array]",
"pytest-codspeed",
"pytest-benchmark",
"pytest-xdist",
]
docs = [
"pydata-sphinx-theme",
"myst-nb",
"sphinx-autodoc-typehints",
"sphinx-gallery",
"nbconvert",
"matplotlib",
"anywidget",
"seaborn",
"egglog[array]",
"line-profiler",
"sphinxcontrib-mermaid",
"ablog",
]
[tool.ruff.lint]
ignore = [
# Allow uppercase vars
"N806",
"N802",
# Allow subprocess run
"S603",
# ALlow any
"ANN401",
# Allow exec
"S102",
"S307",
"S307",
# allow star imports
"F405",
"F403",
# Dont care if cls isnt typed explicitly in classmethod
"ANN102",
# Same for self
"ANN101",
# Allow single line docstrings on multiple lines
"D200",
"D212",
# Allow shadoing builtins
"A003",
"A002",
# Allow Unused args
"ARG001",
"ARG002",
# Allow TODOs
"TD002",
"TD003",
"FIX002",
# Allow commented out code
"ARG001",
"ERA001",
# Allow boolean positional args
"FBT003",
"FBT002",
"FBT001",
# Allow creating types in function arg defaults
"B008",
# Allow no type annotations for private functions
"ANN202",
# Allow short var names
"E741",
# Allow docstring to not end with period
"D400",
"D415",
# Allow asserts
"S101",
# Allow try except in loop
"PERF203",
# Allow unused args
"ARG003",
# Allow no type annotation for kwargs
"ANN003",
# And for args
"ANN002",
# Allow globals
"PLW0603",
# Allow lots of statements
"PLR0915",
# Allow print
"T201",
# Allow constants
"PLR2004",
# Allow missing type annotations
"ANN001",
# allow missing return types
"ANN201",
# Allow uppercase args
"N803",
# allow generic df name
"PD901",
# Allow future anywhere in file
"F404",
# allow imports anywhere in cell
"E402",
# Alllow open()
"PTH123",
# Inconsistant formatting
"D203",
"COM812",
"COM819",
"E501",
"ISC001",
"Q001",
"Q002",
"Q003",
"W191",
"Q000",
"D206",
# Allow shadowing builtin
"A001",
# Allow unused lambda vars
"ARG005",
# Allow no space after first line of docstring
"D205",
# Allow "useless expressions" as they show up in examples
"B018",
# TODO: Remove the rest of these eventually
# Allow public methods to not have docstrings
"D102",
# Allow longer messages for custom errors
"TRY003",
# Allow f-string in exceptions
"EM102",
# No docstrings for public module
"D100",
# docstring public class
"D101",
# Docstring init
"D107",
# Docstring public function
"D103",
# docstring magic method
"D105",
# Allow lots of args for functions
"PLR0913",
# Allow non imperative docstrings
"D401",
# Allow private member refs
"SLF001",
# allow blind exception to add context
"BLE001",
]
select = ["ALL"]
[tool.ruff]
line-length = 120
# Allow lines to be as long as 120.
src = ["python"]
extend-exclude = ["python/tests/__snapshots__"]
unsafe-fixes = true
[tool.ruff.format]
preview = true
[tool.ruff.lint.per-file-ignores]
# Don't require annotations for tests
"python/tests/**" = ["ANN001", "ANN201"]
[tool.mypy]
ignore_missing_imports = true
warn_redundant_casts = true
check_untyped_defs = true
strict_equality = true
warn_unused_configs = true
allow_redefinition = true
exclude = ["__snapshots__", "_build", "^conftest.py$"]
[tool.maturin]
python-source = "python"
module-name = "egglog.bindings"
features = ["pyo3/extension-module"]
[tool.pytest.ini_options]
addopts = ["--import-mode=importlib"]
testpaths = ["python"]
python_files = ["test_*.py", "test.py"]
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"]
norecursedirs = ["__snapshots__"]
filterwarnings = [
"error",
"ignore::numba.core.errors.NumbaPerformanceWarning",
"ignore::pytest_benchmark.logger.PytestBenchmarkWarning",
# https://github.com/manzt/anywidget/blob/d38bb3f5f9cfc7e49e2ff1aa1ba994d66327cb02/pyproject.toml#L120
"ignore:Deprecated in traitlets 4.1, use the instance .metadata:DeprecationWarning",
]
[tool.coverage.report]
exclude_also = [
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
"assert_never\\(",
]
[tool.uv.workspace]
members = ["egglog"]