diff --git a/.circleci/config.yml b/.circleci/config.yml index dc12519f..93d09796 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,8 @@ jobs: parameters: dimod-version: type: string + networkx-version: + type: string python-version: type: string @@ -30,10 +32,11 @@ jobs: pip install -r requirements.txt -r tests/requirements.txt - run: - name: Install specified dimod version + name: Install dependencies command: | . env/bin/activate pip install --upgrade 'dimod<< parameters.dimod-version >>' + pip install --upgrade 'networkx<< parameters.networkx-version >>' - save_cache: &save-cache-env key: v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }} @@ -58,7 +61,7 @@ jobs: type: string macos: - xcode: "12.2.0" + xcode: "13.2.0" environment: HOMEBREW_NO_AUTO_UPDATE: 1 @@ -72,27 +75,36 @@ jobs: brew install pyenv - restore_cache: &restore-cache-pyenv - key: v1-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-12.2.0 + key: v1-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-13.2.0 + + - when: + condition: + equal: [3.6.8, << parameters.python-version >>] + steps: + - run: pyenv install --patch 3.6.8 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch) - run: name: Install python command: | pyenv install << parameters.python-version>> -s - - run: - name: Set system python - command: | - pyenv global << parameters.python-version >> - echo 'eval "$(pyenv init -)"' >> ~/.bash_profile - - save_cache: &save-cache-pyenv - key: v1-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-12.2.0 + key: v1-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-13.2.0 paths: - ~/.pyenv - restore_cache: *restore-cache-env - - run: *create-venv-install-deps + - run: + name: Create virtualenv and install dependencies + command: | + eval "$(pyenv init --path)" + pyenv local << parameters.python-version >> + python -m venv env + . env/bin/activate + python --version + pip install pip --upgrade + pip install -r requirements.txt -r tests/requirements.txt - save_cache: *save-cache-env @@ -207,8 +219,9 @@ workflows: - test-linux: matrix: parameters: - python-version: &python-versions [3.6.8, 3.7.9, 3.8.9, 3.9.4] - dimod-version: [==0.8.0, <0.9, <0.10, <0.11] + python-version: &python-versions [3.6.8, 3.7.9, 3.8.9, 3.9.4, 3.10.0] + dimod-version: [==0.10.8, ~=0.10.0] + networkx-version: [==2.4, <3.0] - test-osx: matrix: parameters: diff --git a/dwave_networkx/algorithms/markov.py b/dwave_networkx/algorithms/markov.py index a945b316..c5c8592b 100644 --- a/dwave_networkx/algorithms/markov.py +++ b/dwave_networkx/algorithms/markov.py @@ -13,11 +13,8 @@ # limitations under the License. import dimod -try: - from dwave.preprocessing import FixVariablesComposite -except ImportError: - # fall back on dimod (<0.10) if dwave.preprocessing not installed - from dimod import FixedVariableComposite as FixVariablesComposite + +from dwave.preprocessing import FixVariablesComposite from dwave_networkx.utils import binary_quadratic_model_sampler diff --git a/requirements.txt b/requirements.txt index ec0b31fa..ed4186ec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ networkx==2.4 -dimod==0.8.0 \ No newline at end of file +dimod==0.10.8 +dwave-preprocessing==0.3.2 diff --git a/setup.py b/setup.py index dccca341..1151ba69 100644 --- a/setup.py +++ b/setup.py @@ -29,8 +29,9 @@ 'dwave_networkx.generators', ] -install_requires = ['networkx>=2.0,<3.0', - 'dimod>=0.8.0,!=0.10.0,!=0.10.1,!=0.10.2,!=0.10.3,!=0.10.4', +install_requires = ['networkx>=2.4,<3.0', + 'dimod>=0.10.8,<0.11.0', + 'dwave-preprocessing>=0.3.2,<0.4.0' ] python_requires = ">=3.6" @@ -43,6 +44,7 @@ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', ] setup(