-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathpyproject.toml
More file actions
218 lines (193 loc) · 6.74 KB
/
pyproject.toml
File metadata and controls
218 lines (193 loc) · 6.74 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
[project]
name = "xdsl"
description = "xDSL"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "Apache License v2.0 with LLVM Exceptions" }
authors = [{ name = "Mathieu Fehr", email = "mathieu.fehr@ed.ac.uk" }]
classifiers = ["Programming Language :: Python :: 3"]
dependencies = [
"immutabledict<4.3.2",
"typing-extensions>=4.7,<5",
"ordered-set==4.1.0",
]
dynamic = ["version"]
[project.entry-points.'xdsl.universe']
xdsl = 'xdsl.universe:XDSL_UNIVERSE'
[project.optional-dependencies]
dev = [
"toml<0.11",
"pytest-cov",
"coverage<8.0.0",
"ipykernel",
"pytest<9.1",
"nbval<0.12",
"filecheck==1.0.3",
"lit<19.0.0",
"marimo>=0.23,<0.24",
"prek~=0.3.1",
"ruff==0.15.12",
"nbconvert>=7.7.2,<8.0.0",
"textual-dev==1.8.0",
"pytest-asyncio==1.3.0",
"pyright==1.1.409",
"sympy==1.14.0",
]
gui = ["textual>=8,<9", "pyclip==0.7"]
llvm = ["llvmlite~=0.47.0"]
[dependency-groups]
dev = ["xdsl[dev,gui,llvm]", "my_plugin"]
bench = [
"asv>=0.6.4",
"snakeviz>=2.2.2",
"viztracer>=1.0.1",
"flameprof>=0.4",
"orjson>=3.10.15",
"pyinstrument>=5.0.1",
"bytesight",
]
docs = [
"lzstring2",
"mkdocs-awesome-nav>=3.1.2",
"mkdocs-gen-files>=0.5.0",
"mkdocs-marimo>=0.2.1",
"mkdocs-material>=9.5.49",
"mkdocs-simple-hooks>=0.1.5",
"mkdocs>=1.6.1",
"mkdocstrings[python]>=0.27.0",
"pymdown-extensions>=10.7",
"riscemu==2.2.7",
"micropip>=0.7",
]
[project.urls]
Homepage = "https://xdsl.dev/"
"Source Code" = "https://github.com/xdslproject/xdsl"
"Issue Tracker" = "https://github.com/xdslproject/xdsl/issues"
[project.scripts]
xdsl-opt = "xdsl.tools.xdsl_opt:main"
irdl-to-pyrdl = "xdsl.tools.irdl_to_pyrdl:main"
xdsl-run = "xdsl.tools.xdsl_run:main"
xdsl-gui = "xdsl.interactive.app:main"
xdsl-stubgen = "xdsl.utils.dialect_stub:make_all_stubs"
xdsl-tblgen = "xdsl.tools.xdsl_tblgen:main"
[tool.setuptools]
platforms = ["Linux", "Mac OS-X", "Unix"]
zip-safe = false
[tool.setuptools_scm]
# No config necessary
[tool.uv.sources]
lzstring2 = { git = "https://github.com/superlopuh/lz-string.git" }
bytesight = { git = "https://github.com/EdmundGoodman/bytesight.git", rev = "e8e8e45ec34316fdc99ee09ea8886c4f63c248be" }
my_plugin = { path = "tests/my_plugin", editable = true }
[tool.setuptools.packages]
find = {}
[tool.setuptools.package-data]
xdsl = ["**/*.irdl", "py.typed", "interactive/*.tcss"]
[build-system]
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"
[tool.pyright]
# We need this for TypeForm, should remove it once that's in
enableExperimentalFeatures = true
# Use specific rule ignore instead if necessary
enableTypeIgnoreComments = false
reportAssertAlwaysTrue = true
reportImportCycles = false
# Allow importing from irdl files
reportMissingModuleSource = false
reportUnnecessaryCast = true
reportUnnecessaryIsInstance = true
reportUnnecessaryTypeIgnoreComment = true
typeCheckingMode = "strict"
extraPaths = ["tests"]
"include" = ["docs", "xdsl", "tests", "benchmarks"]
"exclude" = ["docs/marimo"]
[tool.ruff]
target-version = "py310"
extend-include = ["*.ipynb", "*.pyi"]
exclude = [".venv", "docs/marimo"]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "PT", "TID251", "INP", "PYI"]
ignore = [
"E741", # https://beta.ruff.rs/docs/rules/ambiguous-variable-name/
"PT006", # https://beta.ruff.rs/docs/rules/pytest-parametrize-names-wrong-type/
"PT012", # https://beta.ruff.rs/docs/rules/pytest-raises-with-multiple-statements/
"PYI041", # https://docs.astral.sh/ruff/rules/redundant-numeric-union
]
[tool.ruff.lint.pycodestyle]
# TODO: remove this setting and go to default line length of 88
# Removing this line length results in a large number of errors for doc strings, ideally
# these should be ignored separately.
max-line-length = 130
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"xdsl.dialects.utils.fast_math".msg = "Use xdsl.dialects.utils instead"
"xdsl.dialects.utils.format".msg = "Use xdsl.dialects.utils instead"
"xdsl.ir.affine.affine_expr".msg = "Use xdsl.ir.affine instead"
"xdsl.ir.affine.affine_map".msg = "Use xdsl.ir.affine instead"
"xdsl.ir.affine.affine_set".msg = "Use xdsl.ir.affine instead"
"xdsl.ir.core".msg = "Use xdsl.ir instead."
"xdsl.irdl.attributes".msg = "Use xdsl.irdl instead"
"xdsl.irdl.common".msg = "Use xdsl.irdl instead"
"xdsl.irdl.constraints".msg = "Use xdsl.irdl instead"
"xdsl.irdl.operations".msg = "Use xdsl.irdl instead"
"xdsl.parser.affine_parser".msg = "Use xdsl.parser instead."
"xdsl.parser.attribute_parser".msg = "Use xdsl.parser instead."
"xdsl.parser.base_parser".msg = "Use xdsl.parser instead."
"xdsl.parser.core".msg = "Use xdsl.parser instead."
"xdsl.parser.generic_parser".msg = "Use xdsl.parser instead."
"typing.TypeVar".msg = "Use typing_extensions.TypeVar instead."
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F403"]
"**/filecheck/*" = ["F811", "F841", "E501"]
"docs/database_example.ipynb" = ["ALL"]
"docs/irdl.ipynb" = ["ALL"]
"docs/mlir_interoperation.ipynb" = ["E402"]
"docs/Toy/Toy_Ch1.ipynb" = ["E402"]
"docs/Toy/Toy_Ch2.ipynb" = ["E402"]
"docs/Toy/Toy_Ch3.ipynb" = ["E402"]
"docs/tutorial.ipynb" = ["ALL"]
"docs/xdsl-introduction.ipynb" = ["ALL"]
"scripts/**" = ["INP"]
"tests/*" = ["E501", "INP"]
"tests/test_declarative_assembly_format.py" = ["F811"]
"tests/test_frontend_type_conversion.py" = ["PYI042"] # typealias i32 error
"xdsl/frontend/pyast/dialects/builtin.py" = ["PYI042"] # typealias i32 error
"xdsl/dialects/*.pyi" = ["PYI021"] # auto-generated stubs have docstrings
"typings/**/*.pyi" = ["PYI021", "PYI048", "F821", "F403"]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.format]
exclude = ["docs/marimo/**/*.py"]
[tool.pytest.ini_options]
python_files = ["tests/*test_*.py", "docs/*test_*.py", "docs/marimo/**.py"]
python_classes = "Test_*"
python_functions = "test_*"
addopts = ["--durations=20", "--maxfail=5", "--import-mode=importlib"]
asyncio_default_fixture_loop_scope = "function"
[tool.coverage.run]
relative_files = true
branch = true
omit = [
# Autogenerated missed code handles other VCSes.
"tests/*",
"benchmarks/*",
]
concurrency = ["multiprocessing"]
parallel = true
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Don't complain about missing debug-only code:
"def __repr__",
# Don't complain if tests don't hit defensive assertion code:
"raise NotImplementedError",
"raise ValueError",
"raise TypeError",
"raise RuntimeError",
"assert_never",
]
format = "markdown"
# Converts some errors to warnings
# we should investigate whether this is still necessary once the online codecov reporting is fixed
# https://github.com/nedbat/coveragepy/blob/1aecfa7ae2a81aa9c278cbb43718ae7e4bdcf5b5/coverage/report_core.py#L108
ignore_errors = true