Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
352 lines (290 loc) · 8.44 KB
/
Copy pathpyproject.toml
File metadata and controls
352 lines (290 loc) · 8.44 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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# Copyright (c) 2025 - 2026 Chair for Design Automation, TUM
# Copyright (c) 2025 - 2026 Munich Quantum Software Company GmbH
# All rights reserved.
#
# SPDX-License-Identifier: MIT
#
# Licensed under the MIT License
[build-system]
build-backend = "scikit_build_core.build"
requires = [
"pennylane-catalyst~=0.15.0",
"scikit-build-core>=1.1",
"vcs-versioning>=2.3",
]
[project]
name = "mqt-core-plugins-catalyst"
description = "An MLIR plugin for connecting MQT Core with Xanadu's Catalyst"
readme = "README.md"
keywords = [ "Catalyst", "design-automation", "MLIR", "MQT", "PennyLane", "plugin", "quantum-computing" ]
license = "MIT"
license-files = [ "LICENSE" ]
requires-python = ">=3.11"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: C++",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
"Topic :: Scientific/Engineering :: Quantum Computing",
"Typing :: Typed",
]
dynamic = [ "import-names", "import-namespaces", "version" ]
dependencies = [
"pennylane-catalyst~=0.15.0",
]
[[project.authors]]
name = "Patrick Hopf"
email = "patrick.hopf@tum.de"
[[project.authors]]
name = "Yannick Stade"
email = "yannick.stade@tum.de"
[[project.authors]]
name = "Lukas Burgholzer"
email = "burgholzer@me.com"
[project.urls]
Homepage = "https://github.com/munich-quantum-toolkit/core-plugins-catalyst"
Changelog = "https://github.com/munich-quantum-toolkit/core-plugins-catalyst/blob/main/CHANGELOG.md"
Documentation = "https://mqt.readthedocs.io/projects/core-plugins-catalyst"
Issues = "https://github.com/munich-quantum-toolkit/core-plugins-catalyst/issues"
Discussions = "https://github.com/munich-quantum-toolkit/core-plugins-catalyst/discussions"
PyPI = "https://pypi.org/project/mqt-core-plugins-catalyst/"
[project.entry-points."catalyst.passes_resolution"]
"mqt.passes" = "mqt.core.plugins.catalyst"
[dependency-groups]
dev = [
{ include-group = "build" },
{ include-group = "test" },
"nox>=2025.11.12",
]
test = [
"pytest>=9.0.1",
"pytest-console-scripts>=1.4.1",
"pytest-cov>=7.1",
"pytest-sugar>=1.1.1",
"pytest-xdist>=3.8",
]
docs = [
"breathe>=4.36",
"furo>=2025.12.19",
"myst-nb>=1.4",
"openqasm-pygments>=0.2",
"sphinx>=9",
"sphinx-autoapi>=3.6.1",
"sphinx-copybutton>=0.5.2",
"sphinx-design>=0.7",
"sphinx-llm>=1",
"sphinxcontrib-bibtex>=2.7",
"sphinxext-opengraph>=0.13",
]
build = [
"pennylane-catalyst~=0.15.0",
"scikit-build-core>=1.1",
"vcs-versioning>=2.3",
]
[tool.scikit-build]
# Protect the configuration against future changes in scikit-build-core
minimum-version = "build-system.requires"
# Setuptools-style build caching in a local directory
build-dir = "build/{wheel_tag}/{build_type}"
[tool.scikit-build.build]
# All the targets to build
targets = [
"mqt-core-plugins-catalyst",
]
[tool.scikit-build.ninja]
# Set required Ninja version
version = ">=1.10"
[tool.scikit-build.sdist]
include = [ "python/mqt/core/plugins/catalyst/_version.py" ]
exclude = [
"**/.github",
"**/doc",
"**/docs",
"**/eval",
"**/meta",
"**/paper",
"**/plots",
"**/test",
"**/tests",
]
[tool.scikit-build.wheel]
# Set the wheel install directory
install-dir = "mqt/core/plugins/catalyst"
# Explicitly set the package directory
packages = [ "python/mqt" ]
# Enable Stable ABI builds for CPython 3.11+
py-api = "cp311"
[tool.scikit-build.install]
components = [
"mqt-core-plugins-catalyst_Python",
]
[tool.uv]
required-version = ">=0.13.4"
environments = [
"sys_platform == 'darwin' and platform_machine == 'arm64'",
"sys_platform == 'linux'",
]
cache-keys = [
{ file = "pyproject.toml" },
{ git = { commit = true, tags = true } },
{ file = "lib/**/*" },
{ file = "include/**/*" },
]
[tool.uv.sources]
mqt-core-plugins-catalyst = { workspace = true }
[tool.cibuildwheel]
build = "cp3*"
skip = [ "*-musllinux_*", "cp3??t-*" ]
test-skip = [
"cp315*", # no 3.15 wheels yet
]
archs = "auto64"
build-frontend = "uv"
test-command = "pytest test"
test-groups = [ "test" ]
test-sources = [ "test" ]
[tool.cibuildwheel.linux]
environment = { DEPLOY = "ON", PATH = "$PATH:/root/.local/bin", MLIR_DIR = "/tmp/mlir/lib/cmake/mlir" }
before-all = [
"uv tool install sccache>=0.10.0",
"""\
curl -LsSf https://github.com/munich-quantum-software/setup-mlir/releases/latest/download/setup-mlir.sh | bash -s -- \
-v 8f264586d7521b0e305ca7bb78825aa3382ffef7 -p /tmp/mlir\
""",
]
before-test = "uvx sccache --show-stats"
[tool.cibuildwheel.macos]
environment = { MACOSX_DEPLOYMENT_TARGET = "13.3", CMAKE_PREFIX_PATH = "/tmp/zstd" }
before-all = [
# Building zstd from source to achieve compatibility with macOS 13+
"curl -LsSf https://github.com/facebook/zstd/archive/refs/tags/v1.5.7.tar.gz | tar -xzvf -",
"cd zstd-1.5.7 && make install PREFIX=/tmp/zstd && cd ..",
]
[tool.ruff]
line-length = 120
namespace-packages = [ "mqt" ]
src = [ "python" ]
preview = true
fix = true
unsafe-fixes = true
show-fixes = true
[tool.ruff.format]
preview = true
docstring-code-format = true
[tool.ruff.lint.per-file-ignores]
"test/**" = [ "INP001", "T20" ]
"test/test_plugin.py" = [ "E501" ]
"docs/**" = [ "INP001", "T20" ]
"noxfile.py" = [ "T20", "TID251" ]
"*.pyi" = [ "D418", "DOC202", "PYI011", "PYI021" ]
"*.ipynb" = [
"D", # pydocstyle
"E402", # Allow imports to appear anywhere in Jupyter notebooks
"I002", # Allow missing `from __future__ import annotations` import
]
[tool.ruff.lint.isort]
known-first-party = [ "mqt.core.plugins.catalyst" ]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint]
select = [ "ALL" ]
ignore = [
"C90", # <...> too complex
"COM812", # Conflicts with formatter
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"S101", # Use of assert detected
"S404", # `subprocess` module is possibly insecure
"TID252" # Prefer absolute imports over relative imports from parent modules
]
future-annotations = true
[tool.repo-review.ignore]
GH200 = "We use Renovate instead of Dependabot"
PC160 = "We use a mirror of crate-ci/typos"
PC170 = "We do not use rST files anymore"
[tool.check-sdist]
sdist-only = [ "python/mqt/core/plugins/catalyst/_version.py" ]
git-only = [
"docs/*",
"test/*",
]
[tool.check-wheel-contents]
ignore = [
"W002", # Wheel contains duplicate files (.so symlinks)
"W004", # Module is not located at importable path (/lib/mqt-core-*.so)
]
[tool.pyproject-fmt]
generate_python_version_classifiers = false
table_format = "long"
sub_table_spacing = "\n"
separate_root_table = "\n\n"
[tool.typos]
[tool.typos.default]
extend-ignore-re = [
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$", # ignore line
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on", # ignore block
"FoMaC"
]
[tool.typos.default.extend-words]
wille = "wille"
anc = "anc"
mch = "mch"
ket = "ket"
optin = "optin"
[tool.ty.src]
exclude = [
"docs/**",
]
[tool.ty.terminal]
# Error if ty emits any warning-level diagnostics.
error-on-warning = true
[tool.pytest]
addopts = [
"-ra",
"--numprocesses=auto", # Automatically use all available CPU cores for parallel testing
"--dist=loadfile", # Run tests from the same file sequentially (tests share MLIR files) while parallelizing across files
]
filterwarnings = [
"error",
"ignore:.*'return' in a 'finally' block.*:SyntaxWarning:",
]
log_level = "INFO"
minversion = "9.0"
strict = true
testpaths = [ "test" ]
[tool.coverage]
[tool.coverage.run]
source = [ "mqt.core.plugins.catalyst" ]
omit = [
"*/_compat/*",
]
parallel = true
disable_warnings = [
"no-sysmon",
]
core = "sysmon"
[tool.coverage.report]
exclude_also = [
"@overload", # Overloads are only for static typing
'\.\.\.',
"def __dir__()", # Ignore __dir__ method that exists mainly for better IDE support
"if TYPE_CHECKING:",
"raise AssertionError",
"raise NotImplementedError"
]
[[tool.dynamic-metadata]]
provider = "vcs_versioning"
[tool.vcs-versioning]
write_to = "python/mqt/core/plugins/catalyst/_version.py"