forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
117 lines (105 loc) · 4.66 KB
/
pyproject.toml
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
[build-system]
requires = ["setuptools", "wheel", "setuptools-rust"]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 100
target-version = ['py38', 'py39', 'py310', 'py311']
[tool.cibuildwheel]
manylinux-x86_64-image = "manylinux2014"
manylinux-i686-image = "manylinux2014"
skip = "pp* cp36-* cp37-* *musllinux*"
test-skip = "cp310-win32 cp310-manylinux_i686 cp311-win32 cp311-manylinux_i686"
test-command = "python {project}/examples/python/stochastic_swap.py"
# We need to use pre-built versions of Numpy and Scipy in the tests; they have a
# tendency to crash if they're installed from source by `pip install`, and since
# Numpy 1.22 there are no i686 wheels, so we force pip to use older ones without
# restricting any dependencies that Numpy and Scipy might have.
before-test = "pip install --only-binary=numpy,scipy numpy scipy"
environment = 'RUSTUP_TOOLCHAIN="stable"'
[tool.cibuildwheel.linux]
before-all = "yum install -y wget && {package}/tools/install_rust.sh"
environment = 'PATH="$PATH:$HOME/.cargo/bin" CARGO_NET_GIT_FETCH_WITH_CLI="true" RUSTUP_TOOLCHAIN="stable"'
repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel} && pipx run abi3audit --strict --report {wheel}"
[tool.cibuildwheel.macos]
repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} && pipx run abi3audit --strict --report {wheel}"
[tool.cibuildwheel.windows]
repair-wheel-command = "cp {wheel} {dest_dir}/. && pipx run abi3audit --strict --report {wheel}"
[tool.ruff]
select = [
# Rules in alphabetic order
"C4", # category: flake8-comprehensions
"EXE", # Category: flake8-executable
"F631", # assert-tuple
"F632", # is-literal
"F634", # if-tuple
"F823", # undefined-local
"C4", # category: flake8-comprehensions
]
[tool.pylint.main]
extension-pkg-allow-list = [
"numpy",
"qiskit._accelerate",
# We can't allow pylint to load qiskit._qasm2 because it's not able to
# statically resolve the cyclical load of the exception and it bugs out.
"retworkx",
"rustworkx",
"tweedledum",
]
load-plugins = ["pylint.extensions.docparams", "pylint.extensions.docstyle"]
py-version = "3.8" # update it when bumping minimum supported python version
[tool.pylint.basic]
good-names = ["a", "b", "i", "j", "k", "d", "n", "m", "ex", "v", "w", "x", "y", "z", "Run", "_", "logger", "q", "c", "r", "qr", "cr", "qc", "nd", "pi", "op", "b", "ar", "br", "p", "cp", "ax", "dt", "__unittest", "iSwapGate", "mu"]
method-rgx = "(([a-z_][a-z0-9_]{2,49})|(assert[A-Z][a-zA-Z0-9]{2,43})|(test_[_a-zA-Z0-9]{2,}))$"
variable-rgx = "[a-z_][a-z0-9_]{1,30}$"
[tool.pylint.format]
max-line-length = 105 # default 100
[tool.pylint."messages control"]
disable = [
# intentionally disabled:
"spelling", # too noisy
"fixme", # disabled as TODOs would show up as warnings
"protected-access", # disabled as we don't follow the public vs private convention strictly
"duplicate-code", # disabled as it is too verbose
"redundant-returns-doc", # for @abstractmethod, it cannot interpret "pass"
"too-many-lines", "too-many-branches", "too-many-locals", "too-many-nested-blocks", "too-many-statements",
"too-many-instance-attributes", "too-many-arguments", "too-many-public-methods", "too-few-public-methods", "too-many-ancestors",
"unnecessary-pass", # allow for methods with just "pass", for clarity
"no-else-return", # relax "elif" after a clause with a return
"docstring-first-line-empty", # relax docstring style
"import-outside-toplevel", "import-error", # overzealous with our optionals/dynamic packages
# TODO(#9614): these were added in modern Pylint. Decide if we want to enable them. If so,
# remove from here and fix the issues. Else, move it above this section and add a comment
# with the rationale
"arguments-renamed",
"broad-exception-raised",
"consider-iterating-dictionary",
"consider-using-dict-items",
"consider-using-enumerate",
"consider-using-f-string",
"modified-iterating-list",
"nested-min-max",
"no-member",
"no-value-for-parameter",
"non-ascii-name",
"not-context-manager",
"superfluous-parens",
"unknown-option-value",
"unexpected-keyword-arg",
"unnecessary-dict-index-lookup",
"unnecessary-direct-lambda-call",
"unnecessary-dunder-call",
"unnecessary-ellipsis",
"unnecessary-lambda-assignment",
"unnecessary-list-index-lookup",
"unspecified-encoding",
"unsupported-assignment-operation",
"use-dict-literal",
"use-list-literal",
"use-implicit-booleaness-not-comparison",
"use-maxsplit-arg",
]
enable = [
"use-symbolic-message-instead"
]
[tool.pylint.spelling]
spelling-private-dict-file = ".local-spellings"