Skip to content

Commit 36bad53

Browse files
committed
Support python 3.10
Raise minimum dimod version to 0.10.8 Add dwave-preprocessing as a dependency Raise minimum networkx version to 2.4
1 parent 7299ddf commit 36bad53

File tree

4 files changed

+35
-21
lines changed

4 files changed

+35
-21
lines changed

.circleci/config.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
parameters:
99
dimod-version:
1010
type: string
11+
networkx-version:
12+
type: string
1113
python-version:
1214
type: string
1315

@@ -30,10 +32,11 @@ jobs:
3032
pip install -r requirements.txt -r tests/requirements.txt
3133
3234
- run:
33-
name: Install specified dimod version
35+
name: Install dependencies
3436
command: |
3537
. env/bin/activate
3638
pip install --upgrade 'dimod<< parameters.dimod-version >>'
39+
pip install --upgrade 'networkx<< parameters.networkx-version >>'
3740
3841
- save_cache: &save-cache-env
3942
key: v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }}
@@ -58,7 +61,7 @@ jobs:
5861
type: string
5962

6063
macos:
61-
xcode: "12.2.0"
64+
xcode: "13.2.0"
6265

6366
environment:
6467
HOMEBREW_NO_AUTO_UPDATE: 1
@@ -72,27 +75,37 @@ jobs:
7275
brew install pyenv
7376
7477
- restore_cache: &restore-cache-pyenv
75-
key: v1-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-12.2.0
78+
key: v1-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-13.2.0
79+
80+
- when:
81+
# see https://github.com/pyenv/pyenv/issues/1643
82+
condition:
83+
equal: [3.6.8, << parameters.python-version >>]
84+
steps:
85+
- run: pyenv install --patch 3.6.8 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch)
7686

7787
- run:
7888
name: Install python
7989
command: |
8090
pyenv install << parameters.python-version>> -s
8191
82-
- run:
83-
name: Set system python
84-
command: |
85-
pyenv global << parameters.python-version >>
86-
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
87-
8892
- save_cache: &save-cache-pyenv
89-
key: v1-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-12.2.0
93+
key: v1-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-13.2.0
9094
paths:
9195
- ~/.pyenv
9296

9397
- restore_cache: *restore-cache-env
9498

95-
- run: *create-venv-install-deps
99+
- run:
100+
name: Create virtualenv and install dependencies
101+
command: |
102+
eval "$(pyenv init --path)"
103+
pyenv local << parameters.python-version >>
104+
python -m venv env
105+
. env/bin/activate
106+
python --version
107+
pip install pip --upgrade
108+
pip install -r requirements.txt -r tests/requirements.txt
96109
97110
- save_cache: *save-cache-env
98111

@@ -207,8 +220,9 @@ workflows:
207220
- test-linux:
208221
matrix:
209222
parameters:
210-
python-version: &python-versions [3.6.8, 3.7.9, 3.8.9, 3.9.4]
211-
dimod-version: [==0.8.0, <0.9, <0.10, <0.11]
223+
python-version: &python-versions [3.6.8, 3.7.9, 3.8.9, 3.9.4, 3.10.0]
224+
dimod-version: [==0.10.8, ~=0.10.0]
225+
networkx-version: [==2.4, <3.0]
212226
- test-osx:
213227
matrix:
214228
parameters:

dwave_networkx/algorithms/markov.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
# limitations under the License.
1414

1515
import dimod
16-
try:
17-
from dwave.preprocessing import FixVariablesComposite
18-
except ImportError:
19-
# fall back on dimod (<0.10) if dwave.preprocessing not installed
20-
from dimod import FixedVariableComposite as FixVariablesComposite
16+
17+
from dwave.preprocessing import FixVariablesComposite
2118

2219
from dwave_networkx.utils import binary_quadratic_model_sampler
2320

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
networkx==2.4
2-
dimod==0.8.0
2+
dimod==0.10.8
3+
dwave-preprocessing==0.3.2

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
'dwave_networkx.generators',
3030
]
3131

32-
install_requires = ['networkx>=2.0,<3.0',
33-
'dimod>=0.8.0,!=0.10.0,!=0.10.1,!=0.10.2,!=0.10.3,!=0.10.4',
32+
install_requires = ['networkx>=2.4,<3.0',
33+
'dimod>=0.10.8,<0.11.0',
34+
'dwave-preprocessing>=0.3.2,<0.4.0'
3435
]
3536

3637
python_requires = ">=3.6"
@@ -43,6 +44,7 @@
4344
'Programming Language :: Python :: 3.7',
4445
'Programming Language :: Python :: 3.8',
4546
'Programming Language :: Python :: 3.9',
47+
'Programming Language :: Python :: 3.10',
4648
]
4749

4850
setup(

0 commit comments

Comments
 (0)