-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathpyproject.toml
More file actions
176 lines (156 loc) · 5.51 KB
/
pyproject.toml
File metadata and controls
176 lines (156 loc) · 5.51 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
[build-system]
requires = [
# Same as dependency-groups.build
"cython~=3.2.0",
"meson~=1.9.0",
"meson-python~=0.18.0",
"ninja~=1.13.0",
]
build-backend = 'mesonpy'
[project]
name = "dwave-optimization"
dynamic = ["version"]
authors = [
{name = "D-Wave Inc.", email = "tools@dwavesys.com"},
]
description = "Enables the formulation of nonlinear models for industrial optimization problems."
license = {file = "LICENSE"}
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: 3 :: Only",
'Programming Language :: Python :: Implementation :: CPython',
]
requires-python = ">=3.10"
dependencies = [
"numpy>=1.21.3", # oldest that supports Python 3.10
]
[project.optional-dependencies]
all = [
"dimod>=0.12.0", # oldest minor that passes tests
"scikit-learn>=1.6.0", # oldest minor that passes tests
]
[project.readme]
file = "README.rst"
content-type = "text/x-rst"
[project.urls]
Changelog = "https://github.com/dwavesystems/dwave-optimization/releases"
Documentation = "https://docs.dwavequantum.com"
"Source Code" = "https://github.com/dwavesystems/dwave-optimization"
[dependency-groups]
blas = [
# Optional build requirement
"scipy_openblas64==0.3.30.0.8",
]
build = [
# Same as build-system.requires
"cython~=3.2.0",
"meson~=1.9.0",
"meson-python~=0.18.0",
"ninja~=1.13.0",
]
blas-build = [
{include-group = "build"},
{include-group = "blas"},
]
changelog = [
"reno==4.1.0",
]
dev = [
# Install requirements
"numpy==2.2.6; python_version < '3.11'", # last that supports 3.10
"numpy==2.3.3; python_version >= '3.11'",
{include-group = "build"},
{include-group = "changelog"},
]
docs = [
# Matches dwave-ocean-sdk as of Dec 2025
"pydata-sphinx-theme==0.16.1",
"sphinx==8.2.3",
"sphinx-design==0.6.1",
"breathe==4.35.0",
]
test = [
"dimod==0.12.21",
"scikit-learn==1.7.2; python_version<'3.11'", # last that supports 3.10
"scikit-learn==1.8.0; python_version>='3.11'", # first that supports 3.14t
]
[tool.cibuildwheel]
build-verbosity = "1"
skip = "pp* *musllinux*"
# When building with cibuildwheel, we want scipy_openblas64 available to the
# build step. There isn't (as of Dec 2025) a way to override the
# build-system.requires so we need to build without isolation
before-build = "pip install --group blas-build"
build-frontend = { name = "build", args = ["--no-isolation"] }
before-test = "pip install --group test"
test-command = "python -Werror -m unittest discover {project}/tests/"
[tool.cibuildwheel.config-settings]
compile-args = ["-v"]
setup-args = ["-Dblas=enabled"] # require BLAS
[tool.cibuildwheel.linux]
archs = "x86_64 aarch64"
[tool.cibuildwheel.macos]
# We follow NumPy and don't build universal wheels, see https://github.com/numpy/numpy/pull/20787
archs = "x86_64 arm64"
# Lowest version that has the C++ features we want, see https://cibuildwheel.pypa.io/en/stable/cpp_standards/
environment = "MACOSX_DEPLOYMENT_TARGET=10.13"
[tool.cibuildwheel.windows]
archs = "AMD64"
repair-wheel-command = [
"pip install delvewheel",
# We put the commands in an .sh so we can use bash
"bash ./dwave/optimization/_build/_windows_repair_wheel.sh {wheel} {dest_dir}",
]
[[tool.cibuildwheel.overrides]]
# For Python3.12+, rather than building individual wheels we build an abi3
# wheel. 313t and 314t do not support abi wheels yet.
select = "cp31[!01]-*" # uses fnmatch, will fail for 3.20+ but good enough for now
build-frontend = { name = "build", args = ["-Csetup-args=-Dpython.allow_limited_api=true", "--no-isolation"] }
inherit.repair-wheel-command = "append"
repair-wheel-command = [
"pip install abi3audit",
"abi3audit --strict --report {wheel}",
]
[[tool.cibuildwheel.overrides]]
select = "*-????linux_*"
inherit.repair-wheel-command = "prepend"
repair-wheel-command = "python /project/dwave/optimization/_build/_fix_rpath.py {wheel}"
[[tool.cibuildwheel.overrides]]
select = "*-macosx_*"
inherit.repair-wheel-command = "prepend"
repair-wheel-command = "python ./dwave/optimization/_build/_fix_rpath.py {wheel}"
[[tool.cibuildwheel.overrides]]
# We need a universal build of scipy_openblas so we need to make one on the fly
select = "*-macosx_*"
before-build = [
"pip download --group blas -d .openblas_arm64 --platform macosx_11_0_arm64 --no-deps",
"pip download --group blas -d .openblas_x86_64 --platform macosx_11_0_x86_64 --no-deps",
"pip install delocate",
"delocate-merge .openblas_x86_64/scipy_openblas*.whl .openblas_arm64/scipy_openblas*.whl -w .openblas",
"pip install .openblas/scipy_openblas*.whl",
"pip install --group build",
]
[tool.coverage.run]
source = ["dwave/optimization"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == .__main__.:",
]
# This is, by default, overriden in meson.build. We then override the override
# in cibuildwheel. It's a bit convoluted, but (as of August 2025) it's the only
# way to get it to work, see https://github.com/mesonbuild/meson-python/issues/787
[tool.meson-python]
limited-api = true