-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathpyproject.toml
More file actions
360 lines (314 loc) · 10.2 KB
/
pyproject.toml
File metadata and controls
360 lines (314 loc) · 10.2 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
353
354
355
356
357
358
359
360
[build-system]
requires = [
"nanobind~=2.11.0",
"scikit-build-core>=0.11.6",
"setuptools-scm>=9.2.2",
"mqt.core~=3.4.1",
]
build-backend = "scikit_build_core.build"
[project]
name = "mqt.syrec"
description = "MQT SyReC Synthesizer: A Tool for HDL-based Synthesis of Reversible Circuits"
readme = "README.md"
authors = [
{ name = "Lukas Burgholzer", email = "lukas.burgholzer@tum.de" },
{ name = "Smaran Adarsh", email = "smaran.adarsh@tum.de" },
]
keywords = ["MQT", "reversible-computing", "design-automation", "synthesis"]
license = "MIT"
license-files = ["LICENSE.md"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: C++",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
"Typing :: Typed",
]
requires-python = ">=3.10"
dependencies = [
"mqt.core~=3.4.1",
"PyQt6>=6.8",
"ijson>=3.4.0",
"typing-extensions>=4.1.0; python_version < '3.11'"
]
dynamic = ["version"]
[project.scripts]
"syrec-editor" = "mqt.syrec.syrec_editor:main"
[project.urls]
Homepage = "https://github.com/munich-quantum-toolkit/syrec"
Documentation = "https://mqt.readthedocs.io/projects/syrec"
Issues = "https://github.com/munich-quantum-toolkit/syrec/issues"
Discussions = "https://github.com/munich-quantum-toolkit/syrec/discussions"
[tool.scikit-build]
# Protect the configuration against future changes in scikit-build-core
minimum-version = "build-system.requires"
# Set the wheel install directory
wheel.install-dir = "mqt/syrec"
# Explicitly set the package directory
wheel.packages = ["python/mqt"]
# Enable Stable ABI builds for CPython 3.12+
wheel.py-api = "cp312"
# Set required Ninja version
ninja.version = ">=1.10"
# Setuptools-style build caching in a local directory
build-dir = "build/{wheel_tag}/{build_type}"
# Only build the Python bindings target
build.targets = ["mqt-syrec-bindings"]
# Only install the Python package component
install.components = ["mqt-syrec_Python"]
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
sdist.include = ["python/mqt/syrec/_version.py"]
sdist.exclude = [
"**/.github",
"**/doc",
"**/docs",
"**/meta",
"**/plots",
"**/test",
"**/tests",
]
[tool.scikit-build.cmake.define]
BUILD_MQT_SYREC_TESTS = "OFF"
BUILD_MQT_SYREC_BINDINGS = "ON"
ENABLE_IPO = "ON"
[[tool.scikit-build.overrides]]
if.python-version = ">=3.13"
if.abi-flags = "t"
if.platform-system = "win32"
inherit.cmake.define = "append"
cmake.define.DISABLE_GIL = "1"
[tool.check-sdist]
sdist-only = ["python/mqt/syrec/_version.py"]
git-only = [
"docs/*",
"extern/*",
"test/*",
".idea/*",
]
[tool.setuptools_scm]
write_to = "python/mqt/syrec/_version.py"
[tool.pytest]
minversion = "9.0"
testpaths = ["test/python"]
strict = true
addopts = [
"-ra",
"--showlocals",
"--numprocesses=auto", # Automatically use all available CPU cores for parallel testing
]
log_level = "INFO"
filterwarnings = ["error"]
[tool.coverage]
run.source = ["mqt.syrec"]
report.exclude_also = [
'\.\.\.',
'if TYPE_CHECKING:',
'raise AssertionError',
'raise NotImplementedError',
'def __dir__()', # Ignore __dir__ method that exists mainly for better IDE support
'@overload' # Overloads are only for static typing
]
[tool.mypy]
files = ["python/mqt", "test/python", "noxfile.py"]
mypy_path = ["$MYPY_CONFIG_FILE_DIR/python"]
python_version = "3.10"
warn_unused_configs = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
strict = true
disallow_untyped_defs = false
explicit_package_bases = true
warn_unreachable = true
[[tool.mypy.overrides]]
module = ["mqt.syrec.pysyrec.*", "PyQt6.*", "ijson.*"]
ignore_missing_imports = true
[tool.ruff]
line-length = 120
namespace-packages = ["mqt"]
preview = true
fix = true
unsafe-fixes = true
show-fixes = true
src = ["python"]
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
extend-select = [
"A", # flake8-builtins
# "ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"ASYNC", # flake8-async
"B", # flake8-bugbear
"C4", # flake8-comprehensions
# "D", # pydocstyle
"EM", # flake8-errmsg
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"FLY", # flynt
"FURB", # refurb
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging-format
"N", # flake8-naming
"NPY", # numpy
"PERF", # perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # Ruff-specific
"S", # flake8-bandit
"SLF", # flake8-self
"SLOT", # flake8-slots
"SIM", # flake8-simplify
"T20", # flake8-print
"TC", # flake8-type-checking
"TID251", # flake8-tidy-imports.banned-api
"TRY", # tryceratops
"UP", # pyupgrade
"YTT", # flake8-2020
]
ignore = [
"FBT001", # Boolean positional arguments - conflicts with PyQt6 signal/slot mechanism
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"S101", # Use of assert detected
]
future-annotations = true
[tool.ruff.lint.isort]
known-first-party = ["mqt.syrec"]
[tool.ruff.lint.per-file-ignores]
"test/python/**" = [
"T20", # allow print statements in tests
"PLC2701" # allow private name imports in tests
]
"docs/**" = ["T20"]
"python/mqt/syrec/syrec_editor.py" = ["T20"]
"noxfile.py" = ["T20", "TID251"]
"*.pyi" = ["D418", "E501", "PYI021"]
"*.ipynb" = [
"D", # pydocstyle
"E402", # Allow imports to appear anywhere in Jupyter notebooks
"I002", # Allow missing `from __future__ import annotations` import
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.typos.default]
extend-ignore-re = [
'"id": ".*",',
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$", # ignore line
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on", # ignore block
# Only match the sequence "clang-analyzer-optin." instead of adding the entry (optin -> "option") to the extend-words entry so that the optin typo is corrected everywhere else
# This will ignore the whole line containing the matched pattern, which should be OK since we expect that this identifier will only be used in the .clang-tidy file
"clang-analyzer-optin\\."
]
extend-words = { wille = "wille", anc = "anc", aer = "aer", setp = "setp" }
[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.cibuildwheel]
build = "cp3*"
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_39_aarch64:latest"
skip = ["*-musllinux_*", "cp313t-*"]
archs = "auto64"
test-groups = ["test"]
test-command = "pytest {project}/test/python"
build-frontend = "build[uv]"
enable = ["cpython-freethreading"]
test-skip = [
"cp3??t-*", # no freethreading qiskit wheels
"cp*-win_arm64", # no numpy, qiskit, ... wheels
]
# The mqt-core shared libraries are provided by the mqt-core Python package.
# They should not be vendorized into the mqt-qcec wheel. This requires
# excluding the shared libraries from the repair process.
[tool.cibuildwheel.linux]
before-all = [
"curl -L -O https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz",
"tar -xzf boost_1_*",
"cd boost_1_*/",
"./bootstrap.sh",
"./b2 install --with-system"
]
environment = { DEPLOY="ON" }
# The SOVERSION needs to be updated when the shared libraries are updated.
repair-wheel-command = """auditwheel repair -w {dest_dir} {wheel} \
--exclude libmqt-core-ir.so.3.4 \
--exclude libmqt-core-qasm.so.3.4 \
--exclude libmqt-core-dd.so.3.4"""
[tool.cibuildwheel.macos]
environment = { MACOSX_DEPLOYMENT_TARGET = "13.3" }
repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} --ignore-missing-dependencies"
[tool.cibuildwheel.windows]
before-build = "uv pip install delvewheel>=1.11.2"
repair-wheel-command = """delvewheel repair -w {dest_dir} {wheel} --namespace-pkg mqt \
--exclude mqt-core-ir.dll \
--exclude mqt-core-qasm.dll \
--exclude mqt-core-dd.dll"""
environment = { CMAKE_ARGS = "-T ClangCL" }
[[tool.cibuildwheel.overrides]]
select = "cp312-*"
inherit.repair-wheel-command = "append"
repair-wheel-command = "uvx abi3audit --strict --report {wheel}"
[tool.uv]
required-version = ">=0.5.20"
cache-keys = [
{ file = "pyproject.toml" },
{ git = { commit = true, tags = true } },
{ file = "bindings/**/*.cpp"},
]
[tool.uv.sources]
mqt-syrec = { workspace = true }
[dependency-groups]
build = [
"nanobind~=2.11.0",
"scikit-build-core>=0.11.6",
"setuptools-scm>=9.2.2",
"mqt.core~=3.4.1",
]
docs = [
"furo>=2025.9.25",
"ipykernel>=6.29.5",
"myst-nb>=1.3.0",
"setuptools-scm>=9.2.2",
"sphinx>=8.1.3",
"sphinx>=8.2.3; python_version >= '3.11'",
"sphinx-autoapi>=3.6.0",
"sphinx-autodoc-typehints>=2.3.0",
"sphinx-copybutton>=0.5.2",
"sphinx-design>=0.6.1",
"sphinxcontrib-bibtex>=2.6.5",
"sphinxcontrib-svg2pdfconverter>=1.3.0",
"sphinxext-opengraph>=0.13.0",
]
test = [
"pytest>=9.0.1",
"pytest-cov>=7.0.0",
"pytest-sugar>=1.1.1",
"pytest-xdist>=3.8.0",
]
dev = [
{include-group = "build"},
{include-group = "test"},
"nox>=2025.11.12",
]