-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathpyproject.toml
More file actions
222 lines (188 loc) · 4.65 KB
/
pyproject.toml
File metadata and controls
222 lines (188 loc) · 4.65 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = 'qualtran'
dynamic = ["version"]
author = "Google Quantum AI"
author_email = "mpharrigan@google.com"
description = "Software for fault-tolerant quantum algorithms research."
readme = "README.md"
requires-python = ">=3.11"
license = "Apache-2.0"
dependencies = [
# core dependencies
"attrs>=23.2.0",
"cachetools>=5.3",
"typing_extensions>=4.10.0",
"networkx",
"numpy>=1.26,<3.0",
"sympy",
"cirq-core~=1.4",
"fxpmath",
"galois",
# drawing
"notebook",
"nbconvert",
"nbformat",
"pydot",
"ipython",
"matplotlib",
"ipywidgets",
# ui
"dash",
"plotly",
# quimb simulation
"quimb",
# qsharp resource estimator interop
"qsharp",
"qsharp-widgets",
# qref bartiq interop
"qref==0.11.0",
"bartiq==0.12.1",
# pyzx interop
"pyzx",
# Pennylane interop
"pennylane",
# serialization
"protobuf",
# rotation_synthesis
"mpmath",
]
[tool.hatch.version]
path = "qualtran/_version.py"
[dependency-groups]
dev = [
{ include-group = "test"},
{ include-group = "typing"},
{ include-group = "lint"},
{ include-group = "format"},
{ include-group = "doc"},
]
test = [
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-xdist",
# test executing notebooks
"ipykernel",
"filelock",
# chemistry resource estimates
"openfermion[resources]",
]
typing = [
"mypy~=1.14",
"mypy-protobuf",
"sympy",
]
lint = [
"pylint~=3.3.1",
"ruff~=0.15.0",
# for checking _test.py files
"pytest",
"openfermion[resources]",
# dev tools
"tensorflow-docs",
"sphinx",
"filelock",
"griffe",
"mdit-py-plugins",
]
format = [
"flynt~=0.60",
"black~=24.8.0",
"isort~=5.10.1",
"ruff~=0.15.0",
]
doc = [
"ipywidgets",
"nbconvert",
"nbformat",
"sphinx",
"sphinx-autobuild",
"pydata-sphinx-theme",
"myst-nb",
"tensorflow-docs~=2023.5.24",
"griffe~=1.0",
]
[tool.black]
line-length = 100
skip-string-normalization = true
skip-magic-trailing-comma = true
exclude = "qualtran/protos/*"
[tool.ruff]
line-length = 100
target-version = "py311"
exclude = [
"qualtran/protos/*",
"*_pb2.py",
"*.ipynb",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
# "I", # isort (disabled until we switch formatters)
"W", # pycodestyle warnings
"PL", # pylint
]
ignore = [
# From the default ruleset:
"E741", # ambiguous variable name 'l', 'O', or 'I'
"E743", # ambiguous function definition
"E731", # assigning a lambda expression to a variable
# Handled by the formatter
"E501", # line too long (let ruff format handle this)
"W291", # trailing whitespace
"W293", # blank line contains whitespace
# We productively use these
"PLC0415", # import outside top-level
"PLW2901", # loop variable overwritten
"PLC0206", # Extracting value from dictionary without calling .items()
"PLW0406", # Module import itself
# Pylint 'refactor' rules
"PLR0913", # Too many arguments
"PLR0912", # Too many branches
"PLR0915", # Too many statements
"PLR0914", # Too many local variables
"PLR2004", # Magic value used in comparison
"PLR0911", # Too many return statements
"PLR1704", # Redefining argument with the local name
"PLR1714", # Consider merging multiple comparisons
"PLR1730", # replace if with min, max. Can be enabled.
# Might be enabled at some point
"PLR0402" # Prevalent in the rotation_synthesis submodule.
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
# Ruff wants us to redundantly re-export symbols in __init__.py files, but the
# automated fix isn't in the stable release yet.
"F401", # Unused import
]
[tool.ruff.lint.isort]
order-by-type = false
force-to-top = []
split-on-trailing-comma = false
[tool.ruff.format]
quote-style = "preserve"
skip-magic-trailing-comma = true
[tool.isort]
profile = 'black'
order_by_type = false
line_length = 100
remove_redundant_aliases = true
skip_glob = ["qualtran/protos/*"]
[tool.pytest.ini_options]
filterwarnings = [
'ignore::DeprecationWarning:quimb.linalg.approx_spectral:',
'ignore:.*standard platformdirs.*:DeprecationWarning:jupyter_client.*'
]
# we define classes like TestBloq etc. which pytest tries to collect,
# so if you really want to collect a class as a test use '*TestSuite'.
# (but please stick to the convention of test_* functions)
python_classes = '*TestSuite'
addopts = '--strict-markers'
markers = [
"slow: slow tests.",
"notebook: unit tests that execute a notebook."
]