Skip to content
This repository was archived by the owner on Jan 26, 2023. It is now read-only.

Commit c9c576b

Browse files
authored
Merge pull request #148 from arcondello/fix/versions
Remove python 2.7 and 3.4 support and support latest dimod
2 parents 7b75942 + 7d52048 commit c9c576b

File tree

4 files changed

+59
-126
lines changed

4 files changed

+59
-126
lines changed

.appveyor.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,6 @@ environment:
1414
secure: 9/YAQhmz9Kb1ZeXzhBYeQA==
1515

1616
matrix:
17-
# Python < 2.7 is not supported by dimod
18-
- PYTHON: "C:\\Python27"
19-
PYTHON_VERSION: "2.7.x"
20-
PYTHON_ARCH: "32"
21-
22-
- PYTHON: "C:\\Python27-x64"
23-
PYTHON_VERSION: "2.7.x"
24-
PYTHON_ARCH: "64"
25-
26-
- PYTHON: "C:\\Python34"
27-
PYTHON_VERSION: "3.4.x"
28-
PYTHON_ARCH: "32"
29-
30-
- PYTHON: "C:\\Python34-x64"
31-
PYTHON_VERSION: "3.4.x"
32-
PYTHON_ARCH: "64"
33-
3417
- PYTHON: "C:\\Python35"
3518
PYTHON_VERSION: "3.5.x"
3619
PYTHON_ARCH: "32"
@@ -55,6 +38,14 @@ environment:
5538
PYTHON_VERSION: "3.7.x"
5639
PYTHON_ARCH: "64"
5740

41+
- PYTHON: "C:\\Python38"
42+
PYTHON_VERSION: "3.8.x"
43+
PYTHON_ARCH: "32"
44+
45+
- PYTHON: "C:\\Python38-x64"
46+
PYTHON_VERSION: "3.8.x"
47+
PYTHON_ARCH: "64"
48+
5849
install:
5950
# If there is a newer build queued for the same PR, cancel this one.
6051
# The AppVeyor 'rollout builds' option is supposed to serve the same

.circleci/config.yml

Lines changed: 45 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,10 @@ jobs:
5454
. env/bin/activate
5555
codecov
5656
57-
- run: &sdist-build-template
58-
name: build sdist
59-
command: |
60-
. env/bin/activate
61-
python setup.py sdist
62-
63-
- store_artifacts:
64-
path: ./dist
65-
66-
- run: &sdist-install-template
67-
name: test installing from sdist without cython
68-
command: |
69-
python -m virtualenv env_sdist
70-
. env_sdist/bin/activate
71-
pip install dist/dwave-qbsolv-*.tar.gz
72-
73-
- run: &sdist-cython-install-template
74-
name: install sdist with cython
75-
command: |
76-
python -m virtualenv env_cython_sdist
77-
. env_cython_sdist/bin/activate
78-
pip install cython
79-
pip install dist/dwave-qbsolv-*.tar.gz
57+
test-3.8:
58+
<<: *full-test-template
59+
docker:
60+
- image: circleci/python:3.8-buster
8061

8162
test-3.7:
8263
<<: *full-test-template
@@ -88,22 +69,17 @@ jobs:
8869
docker:
8970
- image: circleci/python:3.5-jessie
9071

91-
test-3.4:
92-
<<: *full-test-template
93-
docker:
94-
- image: circleci/python:3.4-jessie
95-
96-
test-2.7:
97-
<<: *full-test-template
98-
docker:
99-
- image: circleci/python:2.7-jessie
100-
101-
test-osx-3.7: &osx-tests-template
72+
test-osx-3.8: &osx-tests-template
10273
macos:
103-
xcode: "9.4.1"
74+
xcode: "11.2.1"
10475
environment:
105-
PYTHON: 3.7.0
106-
# HOMEBREW_NO_AUTO_UPDATE: 1 # for 3.7 we need to update homebrew
76+
PYTHON: 3.8.0
77+
HOMEBREW_NO_AUTO_UPDATE: 1
78+
79+
# Force (lie about) macOS 10.9 binary compatibility.
80+
# Needed for properly versioned wheels.
81+
# See: https://github.com/MacPython/wiki/wiki/Spinning-wheels
82+
MACOSX_DEPLOYMENT_TARGET: 10.9
10783

10884
working_directory: ~/repo
10985

@@ -117,7 +93,7 @@ jobs:
11793
11894
- restore_cache:
11995
keys:
120-
- pyenv-{{ .Environment.CIRCLE_JOB }}
96+
- pyenv-{{ .Environment.CIRCLE_JOB }}-xcode11.2.1
12197

12298
- run:
12399
name: install python
@@ -127,7 +103,7 @@ jobs:
127103
- save_cache:
128104
paths:
129105
- ~/.pyenv
130-
key: pyenv-{{ .Environment.CIRCLE_JOB }}
106+
key: pyenv-{{ .Environment.CIRCLE_JOB }}-xcode11.2.1
131107

132108
- run:
133109
name: create virtualenv
@@ -157,38 +133,26 @@ jobs:
157133

158134
- run: *run-tests-template
159135

160-
- run: *sdist-build-template
161-
162-
- store_artifacts:
163-
path: ./dist
164-
165-
- run: *sdist-install-template
166-
167-
- run: *sdist-cython-install-template
136+
test-osx-3.7:
137+
<<: *osx-tests-template
138+
environment:
139+
PYTHON: 3.7.4
140+
HOMEBREW_NO_AUTO_UPDATE: 1
141+
MACOSX_DEPLOYMENT_TARGET: 10.9
168142

169143
test-osx-3.6:
170144
<<: *osx-tests-template
171145
environment:
172146
PYTHON: 3.6.5
173147
HOMEBREW_NO_AUTO_UPDATE: 1
148+
MACOSX_DEPLOYMENT_TARGET: 10.9
174149

175150
test-osx-3.5:
176151
<<: *osx-tests-template
177152
environment:
178153
PYTHON: 3.5.5
179154
HOMEBREW_NO_AUTO_UPDATE: 1
180-
181-
test-osx-3.4:
182-
<<: *osx-tests-template
183-
environment:
184-
PYTHON: 3.4.8
185-
HOMEBREW_NO_AUTO_UPDATE: 1
186-
187-
test-osx-2.7:
188-
<<: *osx-tests-template
189-
environment:
190-
PYTHON: 2.7.15
191-
HOMEBREW_NO_AUTO_UPDATE: 1
155+
MACOSX_DEPLOYMENT_TARGET: 10.9
192156

193157
##################################################################################################
194158
# Deploy
@@ -207,7 +171,8 @@ jobs:
207171
name: build wheels
208172
command: |
209173
for PYBIN in /opt/python/*/bin; do
210-
"${PYBIN}/pip" install -r python/requirements.txt
174+
if "${PYBIN}/python" -c "import sys; sys.exit(sys.version_info>=(3, 5))"; then continue; fi;
175+
"${PYBIN}/pip" install -r requirements.txt
211176
"${PYBIN}/pip" wheel . -w ./wheelhouse
212177
"${PYBIN}/python" setup.py sdist -d ./dist
213178
done
@@ -249,12 +214,13 @@ jobs:
249214
docker:
250215
- image: quay.io/pypa/manylinux1_i686
251216

252-
build-osx-3.7: &osx-build-template
217+
build-osx-3.8: &osx-build-template
253218
macos:
254-
xcode: "9.4.1"
219+
xcode: "11.2.0"
255220
environment:
256-
PYTHON: 3.7.0
257-
# HOMEBREW_NO_AUTO_UPDATE: 1 # for 3.7 we need to update homebrew
221+
PYTHON: 3.8.0
222+
HOMEBREW_NO_AUTO_UPDATE: 1
223+
MACOSX_DEPLOYMENT_TARGET: 10.9
258224

259225
working_directory: ~/repo
260226

@@ -266,20 +232,11 @@ jobs:
266232
command: |
267233
brew install pyenv
268234
269-
- restore_cache:
270-
keys:
271-
- pyenv-{{ .Environment.CIRCLE_JOB }}
272-
273235
- run:
274236
name: install python
275237
command: |
276238
pyenv install $PYTHON -s
277239
278-
- save_cache:
279-
paths:
280-
- ~/.pyenv
281-
key: pyenv-{{ .Environment.CIRCLE_JOB }}
282-
283240
- run:
284241
name: create virtualenv
285242
command: |
@@ -305,44 +262,40 @@ jobs:
305262

306263
- run: *upload-template
307264

308-
build-osx-3.6:
265+
build-osx-3.7:
309266
<<: *osx-build-template
310267
environment:
311-
PYTHON: 3.6.5
268+
PYTHON: 3.7.4
312269
HOMEBREW_NO_AUTO_UPDATE: 1
270+
MACOSX_DEPLOYMENT_TARGET: 10.9
313271

314-
build-osx-3.5:
272+
build-osx-3.6:
315273
<<: *osx-build-template
316274
environment:
317-
PYTHON: 3.5.5
275+
PYTHON: 3.6.5
318276
HOMEBREW_NO_AUTO_UPDATE: 1
277+
MACOSX_DEPLOYMENT_TARGET: 10.9
319278

320-
build-osx-3.4:
279+
build-osx-3.5:
321280
<<: *osx-build-template
322281
environment:
323-
PYTHON: 3.4.8
282+
PYTHON: 3.5.5
324283
HOMEBREW_NO_AUTO_UPDATE: 1
284+
MACOSX_DEPLOYMENT_TARGET: 10.9
325285

326-
build-osx-2.7:
327-
<<: *osx-build-template
328-
environment:
329-
PYTHON: 2.7.15
330-
HOMEBREW_NO_AUTO_UPDATE: 1
331286

332287
workflows:
333288
version: 2
334289
test:
335290
jobs:
291+
- test-3.8
336292
- test-3.7
337293
- test-3.6
338294
- test-3.5
339-
- test-3.4
340-
- test-2.7
295+
- test-osx-3.8
341296
- test-osx-3.7
342297
- test-osx-3.6
343298
- test-osx-3.5
344-
- test-osx-3.4
345-
- test-osx-2.7
346299

347300
deploy:
348301
jobs:
@@ -358,31 +311,25 @@ workflows:
358311
only: /^[0-9]+(\.[0-9]+)*(\.dev([0-9]+)?)?$/
359312
branches:
360313
ignore: /.*/
361-
- build-osx-3.7:
362-
filters:
363-
tags:
364-
only: /^[0-9]+(\.[0-9]+)*(\.dev([0-9]+)?)?$/
365-
branches:
366-
ignore: /.*/
367-
- build-osx-3.6:
314+
- build-osx-3.8:
368315
filters:
369316
tags:
370317
only: /^[0-9]+(\.[0-9]+)*(\.dev([0-9]+)?)?$/
371318
branches:
372319
ignore: /.*/
373-
- build-osx-3.5:
320+
- build-osx-3.7:
374321
filters:
375322
tags:
376323
only: /^[0-9]+(\.[0-9]+)*(\.dev([0-9]+)?)?$/
377324
branches:
378325
ignore: /.*/
379-
- build-osx-3.4:
326+
- build-osx-3.6:
380327
filters:
381328
tags:
382329
only: /^[0-9]+(\.[0-9]+)*(\.dev([0-9]+)?)?$/
383330
branches:
384331
ignore: /.*/
385-
- build-osx-2.7:
332+
- build-osx-3.5:
386333
filters:
387334
tags:
388335
only: /^[0-9]+(\.[0-9]+)*(\.dev([0-9]+)?)?$/

python/dwave_qbsolv/dimod_wrapper.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,8 @@ def sample(self, bqm, num_repeats=50, seed=None, algorithm=None,
9595
verbosity=verbosity, timeout=timeout, solver_limit=solver_limit,
9696
solver=solver, target=target, find_max=find_max, sample_kwargs=sample_kwargs)
9797

98-
if hasattr(dimod.Response, 'from_dicts'):
99-
# dimod<=0.6.x
100-
response = dimod.Response.from_dicts(samples, {'energy': energies, 'num_occurrences': counts}, dimod.BINARY)
101-
response.change_vartype(bqm.vartype, {'energy': [offset] * len(energies)})
102-
else:
103-
# dimod>=0.7.x
104-
response = dimod.Response.from_samples(samples, {'energy': energies, 'num_occurrences': counts}, {}, dimod.BINARY)
105-
response.change_vartype(bqm.vartype, energy_offset=offset)
98+
response = dimod.SampleSet.from_samples(samples, energy=energies,
99+
num_occurrences=counts, vartype=dimod.BINARY)
100+
response.change_vartype(bqm.vartype, energy_offset=offset)
106101

107102
return response

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ def build_extensions(self):
7171
'Programming Language :: Python :: 3.7',
7272
]
7373

74-
python_requires = '>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*'
74+
python_requires = '>=3.5'
7575

7676
setup(
7777
name='dwave-qbsolv',
78-
version='0.2.10',
78+
version='0.3.0',
7979
packages=packages,
8080
package_dir={'dwave_qbsolv': 'python/dwave_qbsolv'},
81-
install_requires=['dimod>=0.6.10,<0.9.0'],
81+
install_requires=['dimod>=0.8.1,<0.10.0'],
8282
ext_modules=extensions,
8383
cmdclass={'build_ext': build_ext_compiler_check},
8484
long_description=open('README.rst').read(),

0 commit comments

Comments
 (0)