Skip to content

Commit 053d256

Browse files
authored
Merge pull request #541 from randomir/add-py313-drop-py38-support
Add Python 3.13 support and drop Python 3.8 support
2 parents de436db + 2c12f63 commit 053d256

File tree

8 files changed

+30
-29
lines changed

8 files changed

+30
-29
lines changed

.circleci/config.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
type: string
2424

2525
docker:
26-
- image: cimg/python:<< parameters.python-version >>
26+
- image: python:<< parameters.python-version >>
2727

2828
steps:
2929
- checkout
@@ -74,7 +74,7 @@ jobs:
7474

7575
test-doctest:
7676
docker:
77-
- image: cimg/python:3.9
77+
- image: python:3.12
7878

7979
steps:
8080
- checkout
@@ -106,7 +106,7 @@ jobs:
106106
type: string
107107
xcode:
108108
type: string
109-
default: "14.3.0"
109+
default: "16.0.0"
110110

111111
macos:
112112
xcode: << parameters.xcode >>
@@ -189,7 +189,7 @@ jobs:
189189
190190
deploy:
191191
docker:
192-
- image: cimg/python:3.9
192+
- image: python:3.12
193193

194194
steps:
195195
- checkout
@@ -200,7 +200,7 @@ jobs:
200200
python -m virtualenv env
201201
. env/bin/activate
202202
pip install -r requirements.txt
203-
pip install twine wheel
203+
pip install twine wheel setuptools
204204
205205
- run:
206206
name: verify version matches tag
@@ -227,11 +227,15 @@ workflows:
227227
name: test-linux-<< matrix.python-version >> | << matrix.dependency-specifiers >>
228228
matrix:
229229
parameters:
230-
python-version: &python-versions ["3.8", "3.9", "3.10", "3.11", &latest-python "3.12"]
230+
python-version: &python-versions ["3.9", "3.10", "3.11", "3.12", &latest-python "3.13"]
231231
dependency-specifiers:
232232
- "dwave-cloud-client~=0.12.0"
233233
- "dwave-cloud-client~=0.13.0"
234234
integration-test-python-version: &integration-python-versions [*latest-python]
235+
exclude:
236+
- python-version: "3.13"
237+
dependency-specifiers: "dwave-cloud-client~=0.12.0"
238+
integration-test-python-version: "3.13"
235239

236240
- test-osx:
237241
name: test-osx-<< matrix.python-version >>

dwave/embedding/transforms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ def embed_bqm(source_bqm, embedding=None, target_adjacency=None,
356356
>>> embedding = {'a': {0}, 'b': {1}, 'c': {2, 3}}
357357
>>> # Embed and show the chain strength
358358
>>> target_bqm = dwave.embedding.embed_bqm(bqm, embedding, target)
359-
>>> target_bqm.quadratic[(2, 3)]
360-
-1.9996979771955565
359+
>>> print(target_bqm.quadratic[(2, 3)])
360+
-1.999...
361361
>>> print(target_bqm.quadratic) # doctest: +SKIP
362362
{(0, 1): 1.0, (0, 3): 1.0, (1, 2): 1.0, (2, 3): -1.9996979771955565}
363363

dwave/system/composites/cutoffcomposite.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ class CutOffComposite(dimod.ComposedSampler):
6767
... {'ab': 0.8, 'ac': 0.7, 'bc': -1},
6868
... 0,
6969
... dimod.SPIN)
70-
>>> CutOffComposite(AutoEmbeddingComposite(sampler), 0.75).sample(bqm,
71-
... num_reads=1000).first.energy
70+
>>> samples = CutOffComposite(
71+
... AutoEmbeddingComposite(sampler), 0.75).sample(bqm, num_reads=1000)
72+
>>> print(samples.first.energy)
7273
-5.5
7374
7475
"""
@@ -238,7 +239,8 @@ class PolyCutOffComposite(dimod.ComposedPolySampler):
238239
>>> import dimod
239240
>>> sampler = dimod.HigherOrderComposite(dimod.ExactSolver())
240241
>>> poly = dimod.BinaryPolynomial({'a': 3, 'abc':-4, 'ac': 0.2}, dimod.SPIN)
241-
>>> PolyCutOffComposite(sampler, 1).sample_poly(poly).first.sample['a']
242+
>>> samples = PolyCutOffComposite(sampler, 1).sample_poly(poly)
243+
>>> print(samples.first.sample['a'])
242244
-1
243245
244246
"""

dwave/system/composites/embedding.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
import dimod
3232
import minorminer
33-
import functools
3433

3534
from dwave.embedding import (target_to_source, unembed_sampleset, embed_bqm,
3635
chain_to_quadratic, EmbeddedStructure)
@@ -82,7 +81,7 @@ class EmbeddingComposite(dimod.ComposedSampler):
8281
>>> h = {'a': -1., 'b': 2}
8382
>>> J = {('a', 'b'): 1.5}
8483
>>> sampleset = sampler.sample_ising(h, J, num_reads=100)
85-
>>> sampleset.first.energy
84+
>>> print(sampleset.first.energy)
8685
-4.5
8786
8887

dwave/system/composites/tiling.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@
2525
2626
See `Ocean Glossary <https://docs.ocean.dwavesys.com/en/stable/concepts/index.html>`_
2727
for explanations of technical terms in descriptions of Ocean tools.
28-
2928
"""
3029

31-
from math import sqrt, ceil
32-
3330
import dimod
3431
import dwave_networkx as dnx
35-
import numpy as np
3632

3733
import dwave.embedding
3834

dwave/system/samplers/dwave_sampler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class DWaveSampler(dimod.Sampler, dimod.Structured):
155155
>>> sampleset = sampler.sample_ising({qubit_a: -1, qubit_b: 1},
156156
... {},
157157
... num_reads=100)
158-
>>> sampleset.first.sample[qubit_a] == 1 and sampleset.first.sample[qubit_b] == -1
158+
>>> print(sampleset.first.sample[qubit_a] == 1 and sampleset.first.sample[qubit_b] == -1)
159159
True
160160
161161
See `Ocean Glossary <https://docs.ocean.dwavesys.com/en/stable/concepts/index.html>`_
@@ -396,7 +396,7 @@ def sample(self, bqm, warnings=None, **kwargs):
396396
>>> sampleset = sampler.sample_ising({qubit_a: -1, qubit_b: 1},
397397
... {},
398398
... num_reads=100)
399-
>>> sampleset.first.sample[qubit_a] == 1 and sampleset.first.sample[qubit_b] == -1
399+
>>> print(sampleset.first.sample[qubit_a] == 1 and sampleset.first.sample[qubit_b] == -1)
400400
True
401401
402402
See `Ocean Glossary <https://docs.ocean.dwavesys.com/en/stable/concepts/index.html>`_

requirements.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
dimod==0.12.13
1+
dimod==0.12.17
22
dwave-optimization==0.4.0
3-
dwave-preprocessing==0.6.4
3+
dwave-preprocessing==0.6.7
44
dwave-cloud-client==0.12.0
5-
dwave-networkx==0.8.10
6-
dwave-samplers==1.2.0
5+
dwave-networkx==0.8.14
6+
dwave-samplers==1.4.0
77
homebase==1.0.1
8-
minorminer==0.2.14
9-
networkx==2.8.8
8+
minorminer==0.2.16
9+
networkx~=3.0
1010

1111
numpy==1.23.5;python_version<"3.11" # for compatibility with scipy 1.9.3
12-
oldest-supported-numpy;python_version>="3.11"
12+
numpy==2.1.0;python_version>="3.13"
1313

1414
scipy==1.9.3;python_version<"3.11"
15-
scipy==1.11.2;python_version>="3.11"
15+
scipy==1.14.1;python_version>="3.11"

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
'scipy>=1.7.3',
3737
]
3838

39-
python_requires = '>=3.8'
39+
python_requires = '>=3.9'
4040

4141
packages = ['dwave',
4242
'dwave.embedding',
@@ -50,11 +50,11 @@
5050
'Operating System :: OS Independent',
5151
'Development Status :: 3 - Alpha',
5252
'Programming Language :: Python :: 3 :: Only',
53-
'Programming Language :: Python :: 3.8',
5453
'Programming Language :: Python :: 3.9',
5554
'Programming Language :: Python :: 3.10',
5655
'Programming Language :: Python :: 3.11',
5756
'Programming Language :: Python :: 3.12',
57+
'Programming Language :: Python :: 3.13',
5858
]
5959

6060
setup(

0 commit comments

Comments
 (0)