-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathpyproject.toml
More file actions
203 lines (183 loc) · 4.88 KB
/
Copy pathpyproject.toml
File metadata and controls
203 lines (183 loc) · 4.88 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
[build-system]
requires = ["setuptools>=77", "wheel", "setuptools_scm"]
build-backend = "setuptools.build_meta"
[project]
name = "graphix"
authors = [{ name = "Shinichi Sunami", email = "shinichi.sunami@gmail.com" }]
maintainers = [
{ name = "Shinichi Sunami", email = "shinichi.sunami@gmail.com" },
]
license-files = ["LICENSE"]
description = "Optimize and simulate measurement-based quantum computation"
readme = "README.md"
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Science/Research",
"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",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Physics",
]
requires-python = ">=3.10,<3.15"
dependencies = [
"matplotlib",
"networkx",
"numba>=0.65.1",
"numpy>=2",
"quimb",
"scipy",
"sympy",
"typing_extensions",
]
dynamic = ["version"]
[project.urls]
Documentation = "https://graphix.readthedocs.io"
"Bug Tracker" = "https://github.com/TeamGraphix/graphix/issues"
[project.optional-dependencies]
dev = [
"mypy==2.3.0",
"pre-commit",
"pyright",
"ruff==0.15.21",
"types-networkx==3.6.1.20260624",
"types-psutil",
"types-setuptools",
"scipy-stubs",
"nox==2026.7.11",
"psutil",
"pytest",
"pytest-benchmark",
"pytest-cov",
"pytest-mock",
"pytest-mpl",
"qiskit>=1.0,<2.4",
"qiskit_qasm3_import",
"qiskit-aer",
"matplotlib==3.10.9",
]
doc = [
"furo",
"joblib",
"matplotlib",
"sphinx",
"sphinx-gallery",
]
typing = [
"numpy==2.4.2; python_version >= '3.11'",
"numba==0.66.0; python_version >= '3.11'",
"numpy<2.4.2; python_version == '3.10'",
]
[tool.setuptools_scm]
version_file = "graphix/_version.py"
[tool.setuptools.packages.find]
include = ["graphix", "stubs"]
[tool.ruff]
line-length = 120
extend-exclude = ["docs"]
[tool.ruff.lint]
preview = false
select = ["ALL"]
extend-ignore = [
"C90", # Complexity
"E74", # Ambiguous name
"ERA", # Commmented out code
"FBT", # Boolean positional arguments
"FIX", # Fixme
"PLR091", # Too many XXX
"PLR0904", # Too many public methods
"PLR2004", # Magic vavlue comparison
"S101", # assert
"T20", # print
"TD", # Todo
# Tentative ignores
"ANN", # Missing annotations
"CPY", # Copyright
"DOC", # Docstring
"E501", # Line too long
"EM10", # Raise string
"PLR1702", # Too many nests
"PLW1641", # __hash__ missing
"PT011", # pytest raises too broad
"SLF001", # Private access
"TRY003", # Raise vanilla args
# Conflicts with ruff format
"COM812",
"COM819",
"D206",
"D300",
"E111",
"E114",
"E117",
"ISC001",
"ISC002",
"Q000",
"Q001",
"Q002",
"Q003",
"W191",
]
# Allow "α" (U+03B1 GREEK SMALL LETTER ALPHA) which could be confused for "a"
# Allow "×" (U+00D7 MULTIPLICATION SIGN) which could be confused for "x"
allowed-confusables = ["α", "×"]
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint.extend-per-file-ignores]
"benchmarks/*.py" = [
"D", # Benchmarks follow Sphinx doc conventions
"INP", # Missing __init__.py
]
"examples/*.py" = [
"ARG", # Unused arguments
"B018", # Useless expression
"D", # Examples follow Sphinx doc conventions
"E402", # Import not at top of file
"INP", # Missing __init__.py
]
"tests/*.py" = [
"D10", # Allow undocumented items
"PLC2701", # Allow private imports
"PLR6301", # self not used
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
[tool.pytest.ini_options]
addopts = ["--ignore=examples", "--ignore=docs", "--ignore=benchmarks", "--benchmark-autosave"]
# Silence cotengra warning
filterwarnings = ["ignore:Couldn't import `kahypar`"]
[tool.mypy]
# Keep in sync with pyright
files = ["*.py", "examples", "graphix", "tests"]
follow_imports = "silent"
follow_untyped_imports = true # required for qiskit, requires mypy >=1.14
strict = true
mypy_path = "./stubs"
[tool.pyright]
# Keep in sync with mypy
include = ["*.py", "examples", "graphix", "tests"]
reportUnknownArgumentType = "information"
reportUnknownLambdaType = "information"
reportUnknownMemberType = "information"
reportUnknownParameterType = "information"
reportUnknownVariableType = "information"
# reportInvalidTypeVarUse is a warning by default
reportInvalidTypeVarUse = "error"
extraPaths = ["./stubs"]
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"case _:",
"raise NotImplementedError(\\(.*\\))?",
"return NotImplemented",
"raise RuntimeError(\\(.*\\))",
"typing_extensions.assert_never\\(.*\\)",
"assert_never\\(.*\\)",
"@abc.abstractmethod",
]