-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
203 lines (173 loc) · 5.27 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
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
#############################################################################
# This code is part of Fast Pauli.
#
# (C) Copyright Qognitive Inc 2024.
#
# This code is licensed under the BSD 2-Clause License. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
#############################################################################
################################################################################
# Build System
################################################################################
[build-system]
requires = [
# scikit-build-core uses cmake as needed (do not list it here)
"scikit-build-core",
"setuptools_scm[toml]>=8",
]
build-backend = "scikit_build_core.build"
################################################################################
# Project
################################################################################
[project]
name = "fast_pauli"
readme = "README.md"
description = "fast pauli"
authors = [
{ name="James E. T. Smith", email="[email protected]" },
{ name="Eugene Rublenko", email="[email protected]" },
{ name="Alex Lerner", email="[email protected]" },
{ name="Sebastien Roy", email="[email protected]" },
{ name="Jeffrey Berger", email="[email protected]" },
]
dependencies = ["numpy", "qiskit", "qiskit-algorithms"]
requires-python = ">= 3.10"
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dynamic = ["version"]
[project.optional-dependencies]
dev = [
"cibuildwheel",
"clang-format",
"cmake-format",
"pre-commit",
"mypy",
"ruff",
"pytest",
"pytest-benchmark",
"setuptools_scm",
"sphinx",
"sphinx_rtd_theme",
"sphinx-autobuild",
]
docs = [
"cmake>=3.25",
"sphinx",
"sphinx-rtd-theme",
"sphinx-copybutton",
"sphinx-autobuild",
"sphinxcontrib-napoleon",
"breathe",
"furo",
]
examples = [
]
################################################################################
# Linting/Formatting
################################################################################
[tool.mypy]
warn_redundant_casts = true
warn_unused_ignores = true
# Needed because of bug in MyPy
disallow_subclassing_any = false
mypy_path = "stubs"
disallow_untyped_calls = true
disallow_untyped_defs = true
check_untyped_defs = true
warn_return_any = true
no_implicit_optional = true
strict_optional = true
ignore_missing_imports = true
explicit_package_bases = true
exclude = ["docs", "build"]
[tool.ruff]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
".venv",
"fast_pauli/__version__.py",
"docs",
]
line-length = 88
indent-width = 4
target-version = "py38"
[tool.ruff.lint]
select = [
"F", # PyFlakes (https://docs.astral.sh/ruff/rules/#pyflakes-f)
"E", "W", # pycodestyle (https://docs.astral.sh/ruff/rules/#pycodestyle-e-w)
"I", # Isort (https://docs.astral.sh/ruff/rules/#isort-i)
"N", # PEP-8 Naming (https://docs.astral.sh/ruff/rules/#pep8-naming-n)
"D", # pydocstyle (https://docs.astral.sh/ruff/rules/#pydocstyle-d)
"YTT", # flake8-2020 (https://docs.astral.sh/ruff/rules/#flake8-2020-ytt)
"ASYNC", # flake8-async (https://docs.astral.sh/ruff/rules/#flake8-async-async)
"B", # flake8-bugbear (https://docs.astral.sh/ruff/rules/#flake8-bugbear-b)
"UP", # flake8-bandit (https://docs.astral.sh/ruff/rules/#flake8-bandit-up)
"SIM", # flake8-simplify (https://docs.astral.sh/ruff/rules/#flake8-simplify-sim)
]
ignore = [
# Allow non-lowercase variable names to help the code match the math better
"N806",
# mypy doesn't support PEP695 (upgrading to `type` python keyword)
"UP040",
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.format]
quote-style = "double"
docstring-code-format = true
################################################################################
# Packaging
################################################################################
# https://scikit-build-core.readthedocs.io/en/latest/#configuration
# Example: use LLVM
# pip install -e . --verbose -C cmake.args="-DCMAKE_CXX_COMPILER=clang++-18"
[tool.scikit-build]
cmake.build-type = "Release"
build-dir = "build/{wheel_tag}"
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
sdist.include = ["fast_pauli/__version__.py"]
# TODO add more options here
[tool.setuptools_scm]
write_to = "fast_pauli/__version__.py"
[tool.cibuildwheel]
skip = "pp*"
test-requires = "pytest"
test-command = "pytest -s -vv --import-mode importlib {project}/tests/fast_pauli"
[tool.cibuildwheel.linux]
build = ["cp3*_x86_64"]
skip = ["*musllinux*"]
[tool.cibuildwheel.macos]
environment = "CXX=g++-14"