-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
226 lines (200 loc) · 6.72 KB
/
pyproject.toml
File metadata and controls
226 lines (200 loc) · 6.72 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
[build-system]
requires = ["hatchling", "packaging"]
build-backend = "hatchling.build"
[project]
name = "selene-sim"
description = "Quantinuum's open source emulator for hybrid quantum computation"
version = "0.2.12"
requires-python = ">=3.10"
dependencies = [
"numpy>=2.2.6",
"pyyaml>=6.0.2",
"selene-core~=0.2.4",
"selene-hugr-qis-compiler~=0.2.6",
"tqdm>=4.67.1",
]
authors = [
{ name = "Jake Arkinstall", email = "jake.arkinstall@quantinuum.com" },
{ name = "TKET development team", email = "tket-support@quantinuum.com" },
]
maintainers = [
{ name = "Jake Arkinstall", email = "jake.arkinstall@quantinuum.com" },
{ name = "TKET development team", email = "tket-support@quantinuum.com" },
]
readme = "selene-sim/python/selene_sim/README.md"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Quantum Computing",
"Topic :: System :: Emulators",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
[project.urls]
repository = "https://github.com/quantinuum/selene"
[dependency-groups]
dev = [
"auditwheel>=6.3.0",
"cibuildwheel>=2.23.3",
"guppylang~=0.21.6,!=0.21.7,!=0.21.9", # temporary workaround for libtket.so compatibility issues
"hugr>=0.13.0",
"mypy>=1.14.1",
"pip>=24.2",
"pytest-snapshot~=0.9.0",
"pytest>=8.3.5",
"pytket>=2.0.1",
"pytket~=2.9.1",
"qir-qis~=0.1.2",
"ruff>=0.8.0",
"types-pyyaml>=6.0.12.20250402",
]
[tool.uv.sources]
selene-sim = { workspace = true }
selene-core = { workspace = true }
[tool.uv.workspace]
members = ["selene-core"]
[tool.hatch.build.hooks.custom]
path = "hatch_build.py"
[tool.hatch.build.targets.wheel]
exclude = ["selene-sim/python/selene_sim/README.md"]
packages = [
"selene-sim/python/selene_sim",
"selene-ext/error-models/depolarizing/python/selene_depolarizing_error_model_plugin",
"selene-ext/error-models/ideal/python/selene_ideal_error_model_plugin",
"selene-ext/error-models/simple-leakage/python/selene_simple_leakage_error_model_plugin",
"selene-ext/interfaces/helios_qis/python/selene_helios_qis_plugin",
"selene-ext/runtimes/simple/python/selene_simple_runtime_plugin",
"selene-ext/runtimes/soft_rz/python/selene_soft_rz_runtime_plugin",
"selene-ext/simulators/classical-replay/python/selene_classical_replay_plugin",
"selene-ext/simulators/coinflip/python/selene_coinflip_plugin",
"selene-ext/simulators/quantum-replay/python/selene_quantum_replay_plugin",
"selene-ext/simulators/quest/python/selene_quest_plugin",
"selene-ext/simulators/stim/python/selene_stim_plugin",
]
[tool.uv]
cache-keys = [
{ file = "selene-sim/**/*.c" },
{ file = "selene-sim/**/*.h" },
{ file = "selene-sim/**/*.rs" },
{ file = "selene-sim/**/CMakeLists.txt" },
{ file = "selene-sim/**/Cargo.toml" },
{ file = "selene-sim/**/Cargo.lock" },
{ file = "selene-ext/**/*.c" },
{ file = "selene-ext/**/*.h" },
{ file = "selene-ext/**/*.rs" },
{ file = "selene-ext/**/CMakeLists.txt" },
{ file = "selene-ext/**/Cargo.toml" },
{ file = "selene-ext/**/Cargo.lock" },
]
[tool.ruff]
# exclude any external code (e.g. stim) fetched in the build process
extend-exclude = [
"target",
]
[tool.ruff.lint.per-file-ignores]
"**/python/tests/*.py" = ["F821", "F841"] # ^
[tool.mypy]
ignore_missing_imports = true
exclude = ["test_.*.py$", "^target/.*$", "^selene-core/.*$", "^scratch/.*$"]
[tool.pytest.ini_options]
norecursedirs = ['*.egg', '.*', 'build', 'target', 'dist', 'venv']
[tool.deptry]
known_first_party = [
"selene_sim",
# Error models
"selene_depolarizing_error_model_plugin",
"selene_ideal_error_model_plugin",
"selene_simple_leakage_error_model_plugin",
# Interfaces
"selene_helios_qis_plugin",
# Runtimes
"selene_simple_runtime_plugin",
"selene_soft_rz_runtime_plugin",
# Simulators
"selene_classical_replay_plugin",
"selene_coinflip_plugin",
"selene_quantum_replay_plugin",
"selene_quest_plugin",
"selene_stim_plugin",
]
extend_exclude = [
"target",
"selene-core/python/selene_core",
]
[tool.deptry.package_module_name_map]
pyyaml = "yaml"
[tool.deptry.per_rule_ignores]
DEP001 = [
"hatchling", # used in build system
"sympy", # optional dependency
# "selene_sim", # dynamic import
]
DEP002 = [
# "pydot", # needed by networkx
]
DEP003 = [
"packaging", # used in build system
]
DEP004 = [
"guppylang", # used in tests
"hugr", # used in tests
"pytest", # used in tests
"qir_qis", # used in tests
]
[tool.cibuildwheel]
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64"
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64"
build = "cp310-*"
skip = "*-win32 *-manylinux_i686 *-musllinux*"
build-frontend = { name = "build[uv]", args = ["-C--profile=release"] }
environment-pass = ["UV_EXTRA_INDEX_URL", "PIP_EXTRA_INDEX_URL", "CACHE_CARGO"]
test-requires = [
"pytest",
"pytest-snapshot",
"guppylang~=0.21.6,!=0.21.7,!=0.21.9",
"pytket~=2.9.1",
]
test-command = "pytest {project}/selene-sim {project}/selene-ext {project}/selene-core"
[tool.cibuildwheel.linux]
environment = { PATH = "$PATH:$HOME/.cargo/bin" }
before-all = '''
# clean any non-version-controlled files, e.g. when building locally.
git clean -dfX;
# extract any caching if present
if [ -d /host/tmp/ci-cache/selene/.cargo ]; then
cp -r /host/tmp/ci-cache/selene/.cargo $HOME;
fi;
if [ -d /host/tmp/ci-cache/selene/target ]; then
cp -r /host/tmp/ci-cache/selene/target {project};
fi;
# grab rust
curl -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
'''
before-test = '''
# if we have caching enabled and it exists, copy caches to the
# host so that it can be reused in the next build.
if [ -d /host/tmp/ci-cache ]; then
mkdir -p /host/tmp/ci-cache/selene;
if [ -d $HOME/.cargo ]; then
rm -rf /host/tmp/ci-cache/selene/.cargo;
cp -r $HOME/.cargo /host/tmp/ci-cache/selene/;
fi;
if [ -d {project}/target ]; then
rm -rf /host/tmp/ci-cache/selene/target;
cp -r {project}/target /host/tmp/ci-cache/selene;
fi;
# make sure the cache is readable by the host
chmod -R a+rX /host/tmp/ci-cache/selene
fi;
uv pip install ./selene-core;
'''
[tool.cibuildwheel.macos]
environment = { PATH = "$PATH:$HOME/.cargo/bin", MACOSX_DEPLOYMENT_TARGET = "11.0" }
before-all = ['curl -sSf https://sh.rustup.rs | sh -s -- -y']
before-test = ['uv pip install ./selene-core']
[tool.cibuildwheel.windows]
before-all = ['curl -sSf https://sh.rustup.rs | sh -s -- -y']
before-test = ['uv pip install ./selene-core']