Skip to content

Commit fdd61f7

Browse files
authored
Merge pull request #215 from arcondello/py3.10
Test with python 3.10
2 parents 7299ddf + 307dbf6 commit fdd61f7

File tree

4 files changed

+43
-24
lines changed

4 files changed

+43
-24
lines changed

.circleci/config.yml

Lines changed: 35 additions & 16 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

@@ -18,7 +20,7 @@ jobs:
1820
- checkout
1921

2022
- restore_cache: &restore-cache-env
21-
key: v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }}
23+
key: pip-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }}
2224

2325
- run: &create-venv-install-deps
2426
name: Create virtual environment and install dependencies
@@ -30,15 +32,16 @@ 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
39-
key: v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }}
42+
key: pip-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }}
4043
paths:
41-
- env
44+
- ~/.cache/pip
4245

4346
- run: &run-tests
4447
name: Run unittests
@@ -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,42 @@ 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. We use an intermediate
82+
# file so we can use the --skip-existing without raising errors from curl
83+
condition:
84+
equal: [3.6.8, << parameters.python-version >>]
85+
steps:
86+
- run:
87+
name: Install Python 3.6 with a patch
88+
command: |
89+
curl -sSL https://github.com/python/cpython/commit/8ea6353.patch > tmp.txt
90+
pyenv install -s --patch 3.6.8 < tmp.txt
7691
7792
- run:
7893
name: Install python
7994
command: |
8095
pyenv install << parameters.python-version>> -s
8196
82-
- run:
83-
name: Set system python
84-
command: |
85-
pyenv global << parameters.python-version >>
86-
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
87-
8897
- save_cache: &save-cache-pyenv
89-
key: v1-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-12.2.0
98+
key: v1-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-13.2.0
9099
paths:
91100
- ~/.pyenv
92101

93102
- restore_cache: *restore-cache-env
94103

95-
- run: *create-venv-install-deps
104+
- run:
105+
name: Create virtualenv and install dependencies
106+
command: |
107+
eval "$(pyenv init --path)"
108+
pyenv local << parameters.python-version >>
109+
python -m venv env
110+
. env/bin/activate
111+
python --version
112+
pip install pip --upgrade
113+
pip install -r requirements.txt -r tests/requirements.txt
96114
97115
- save_cache: *save-cache-env
98116

@@ -207,8 +225,9 @@ workflows:
207225
- test-linux:
208226
matrix:
209227
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]
228+
python-version: &python-versions [3.6.8, 3.7.9, 3.8.9, 3.9.4, 3.10.0]
229+
dimod-version: [==0.10.8, ~=0.10.0]
230+
networkx-version: [==2.4, <3.0]
212231
- test-osx:
213232
matrix:
214233
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)