-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathpyproject.toml
More file actions
163 lines (144 loc) · 4.35 KB
/
pyproject.toml
File metadata and controls
163 lines (144 loc) · 4.35 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
[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"
dynamic = ["version", "dependencies", "optional-dependencies"]
[project.urls]
Documentation = "https://graphix.readthedocs.io"
"Bug Tracker" = "https://github.com/TeamGraphix/graphix/issues"
[tool.setuptools_scm]
version_file = "graphix/_version.py"
[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }
[tool.setuptools.dynamic.optional-dependencies]
dev = { file = ["requirements-dev.txt"] }
extra = { file = ["requirements-extra.txt"] }
doc = { file = ["requirements-doc.txt"] }
typing = { file = ["requirements-typing.txt"] }
[tool.setuptools.packages.find]
include = ["graphix", "stubs"]
[tool.ruff]
line-length = 120
extend-exclude = ["docs"]
[tool.ruff.lint]
preview = true
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:",
"raise NotImplementedError\\(.*\\)",
"return NotImplemented",
"typing_extensions.assert_never\\(.*\\)",
"assert_never\\(.*\\)",
"@abc.abstractmethod",
]