-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathpyproject.toml
More file actions
209 lines (193 loc) · 6.85 KB
/
pyproject.toml
File metadata and controls
209 lines (193 loc) · 6.85 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
[build-system]
requires = ["setuptools>=68.0"]
build-backend = "setuptools.build_meta"
[project]
name = "amazon-braket-sdk"
dynamic = ["version"]
description = "An open source library for interacting with quantum computing devices on Amazon Braket"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">= 3.11"
authors = [{ name = "Amazon Web Services" }]
keywords = ["Amazon", "AWS", "Quantum"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"amazon-braket-schemas>=1.27.0",
"amazon-braket-default-simulator>=1.32.0",
"oqpy~=0.3.7",
"backoff",
"boltons",
"boto3>=1.28.53",
# SageMaker pinned cloudpickle==2.2.1
# see https://github.com/aws/sagemaker-python-sdk/issues/4871
"cloudpickle==2.2.1",
"nest-asyncio",
"networkx",
"numpy",
"openpulse",
"openqasm3",
"sympy",
"backports.entry-points-selectable",
]
[project.optional-dependencies]
test = [
"botocore",
"jsonschema==3.2.0",
"pytest",
"pytest-cov",
# https://github.com/pytest-dev/pytest-rerunfailures/issues/302
"pytest-rerunfailures<16.0",
"pytest-xdist[psutil]",
]
docs = [
"sphinx",
"sphinx-rtd-theme",
"sphinxcontrib-apidoc",
"sphinx-autodoc-typehints",
]
[project.urls]
Homepage = "https://github.com/amazon-braket/amazon-braket-sdk-python"
[tool.setuptools.dynamic]
version = { attr = "braket._sdk._version.__version__" }
[tool.setuptools.packages.find]
where = ["src"]
exclude = ["test"]
[tool.setuptools.package-data]
"*" = ["*.json"]
[tool.coverage.run]
parallel = true
branch = true
source = ["src"]
omit = [
"**/braket/ir/*",
"**/braket/device_schema/*",
"**/braket/schema_common/*",
"**/braket/task_result/*",
"**/braket/simulator/*",
"*/site-packages/braket/*",
]
[tool.coverage.paths]
source = ["src", "*/site-packages/braket"]
[tool.coverage.report]
show_missing = true
ignore_errors = true
exclude_lines = [
"pragma: no cover",
"from importlib.metadata import entry_points",
"raise NotImplementedError",
"if sys.version_info.minor == 9:",
"if TYPE_CHECKING:",
]
[tool.coverage.html]
directory = "build/coverage"
[tool.coverage.xml]
output = "build/coverage/coverage.xml"
[tool.pytest.ini_options]
xfail_strict = true
# https://pytest-xdist.readthedocs.io/en/latest/known-limitations.html
addopts = "--verbose -n logical --durations=0 --durations-min=1 --dist worksteal"
testpaths = ["test/unit_tests"]
# Issue #557 in `pytest-cov` (currently v4.x) has not moved for a while now,
# but once a resolution has been adopted we can drop this "ignore".
# Ref: https://github.com/pytest-dev/pytest-cov/issues/557
filterwarnings = [
"ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning",
]
norecursedirs = [
".tox",
".git",
"*/migrations/*",
"*/static/*",
"docs",
"venv",
"*/{{cookiecutter.project_slug}}/*",
]
[tool.ruff]
target-version = "py311"
line-length = 100
format.preview = true
format.docstring-code-line-length = 100
format.docstring-code-format = true
lint.select = ["ALL"]
lint.ignore = [
"A001", "A002", # This will be refactored out later
"ANN202", "ARG001", "ARG002", # TODO after onboarding
"ANN002", # Missing type annotation for `*args` in method
"ANN003", # Missing type annotation for `**kwargs` in method
"ANN204", # Special functions don't need return types
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `arg`
"B008", # Logger definition rework
"B026", # Accepted pattern to unpack after keyword args
"BLE001", # This needs to be cleaned up later.
"COM812", # conflicts with formatter
"CPY", # No copyright header
"D", # ignore documentation for now
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
"DOC201", # no restructuredtext support yet
"DOC502", # Exceptions are documented in top level functions and not in the private methods
"DOC501", # broken with sphinx docs
"EM", # error string messages are fine
"ERA001", # This is used to capture math
"FBT", # Booleans in methods are fine
"FIX", # Allow TODO statements for now.
"FURB101", # Same as PTH
"FURB103", # Same as PTH
"G004", # Let f strings in logger
"INP001", # no implicit namespaces here
"ISC001", # conflicts with formatter
"N802", # Function names are set now
"N803", # Allow uppercase
"N806", # Vars will break this rule based on technical names.
"N815", # Allowing reviewers to do a per case basis
"PLC2701", # Allow private function access in code
"PLR0904", # Too many public methods
"PLR0911", # Too many return statements
"PLR0913", # Too many variables in function
"PLR0914", # Too many local variables
"PLR0917", # Too many positional arguments
"PLR6301", # Ignore for dispatch functions
"PLR2004", # Allow magic values
"PLW1510", # Subprocess implicitly uses this
"PLW0603", # Allow usage of global vars
"PLW1641", # Object with equal and not __hash__
"PTH", # Prefer builtin path
"PYI034", # Return class type hint here instead of self
"S104", # Possible binding to all interfaces
"S403", # Pickle is used
"S404", # Using subprocess is alright.
"S603", # Using subprocess is alright.
"S607", # Partial path
"SLF", # Private methods are allowed for access
"T201", # Print statements are used in some places. Later this should be moved inline.
"TCH", # This is good to look into later on. TODO
"TD", # Allow TODO Statements
"TRY003", # Longer messages are fine.
]
lint.per-file-ignores."tests/**/*.py" = [
"D", # don't care about documentation in tests
"FBT", # don't care about booleans as positional arguments in tests
"INP001", # no implicit namespace
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
"S101", # asserts allowed in tests...
"S603", # `subprocess` call: check for execution of untrusted input
]
lint.isort = { known-first-party = ["amazon-braket-sdk", "tests"] }
lint.preview = true
lint.pyupgrade.keep-runtime-typing = true
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-annotations]
mypy-init-return = false
[tool.ruff.lint.flake8-builtins]
builtins-allowed-modules = ["operator"]