From d4288d68597408c20afcc9a17ad08cc5a6215ff6 Mon Sep 17 00:00:00 2001 From: Radomir Stevanovic Date: Fri, 23 Dec 2022 03:12:42 -0800 Subject: [PATCH 1/4] Update dev and package requirements for Python 3.11 --- requirements.txt | 28 +++++++++++++++++++++------- setup.py | 1 + 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index d00fdf4..15b338b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,25 @@ -dimod==0.10.13 +# the big split on 3.11 is required due to dwave-samplers switch, and hard +# dependency on narrow dimod version range (also dwave-preprocessing) +# see :pr:284 + +dimod==0.10.13; python_version<"3.11" +dimod==0.12.3; python_version>="3.11" +dwave-preprocessing==0.3.2; python_version<"3.11" +dwave-preprocessing==0.5.4; python_version>="3.11" numpy>=1.19.1 -minorminer==0.2.7 -dwave-system==1.13.0 -dwave-neal==0.5.9 -dwave-tabu==0.4.3 -dwave-greedy==0.2.3 -dwave-preprocessing==0.3.2 + +dwave-neal==0.5.9; python_version<"3.11" +dwave-neal>=0.6.0; python_version>="3.11" +dwave-tabu==0.4.5; python_version<"3.11" +dwave-tabu>=0.5.0; python_version>="3.11" +dwave-greedy==0.2.5; python_version<"3.11" +dwave-greedy>=0.3.0; python_version>="3.11" + +minorminer==0.2.7; python_version<"3.11" +minorminer==0.2.10; python_version>="3.11" +dwave-system==1.13.0; python_version<"3.11" +dwave-system==1.18.0; python_version>="3.11" + networkx dwave-networkx==0.8.10 click diff --git a/setup.py b/setup.py index 9b02785..603ebba 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,7 @@ 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ] setup( From 51ec94aa6f1f55c63962d6cfc78d24b93098215a Mon Sep 17 00:00:00 2001 From: Radomir Stevanovic Date: Fri, 23 Dec 2022 03:17:03 -0800 Subject: [PATCH 2/4] Run tests on py311 --- .appveyor.yml | 1 + .circleci/config.yml | 31 +++++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index dc59ebd..4eeb8f9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -4,6 +4,7 @@ environment: - PYTHON: "C:\\Python38-x64" - PYTHON: "C:\\Python39-x64" - PYTHON: "C:\\Python310-x64" + - PYTHON: "C:\\Python311-x64" matrix: fast_finish: true diff --git a/.circleci/config.yml b/.circleci/config.yml index 611a603..7d8482b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,7 @@ jobs: type: string docker: - - image: circleci/python:<< parameters.python-version >> + - image: cimg/python:<< parameters.python-version >> steps: - checkout @@ -70,6 +70,16 @@ jobs: - checkout # install `python-version` and cache it + - when: + condition: + matches: + pattern: "^3\\.[123][123456789].*$" + value: << parameters.python-version >> + steps: + - run: + name: Update brew to get latest pyenv + command: brew update + - run: &brew-install-pyenv name: Install pyenv command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pyenv @@ -112,7 +122,7 @@ jobs: test-docs: docker: - - image: circleci/python:3.7 + - image: cimg/python:3.7 steps: - checkout @@ -158,7 +168,7 @@ jobs: pypi-deploy: docker: - - image: circleci/python:3.9 + - image: cimg/python:3.9 steps: - checkout @@ -188,11 +198,20 @@ workflows: name: test-linux-<< matrix.python-version >> | << matrix.pip-constraints >> matrix: parameters: - python-version: &python-versions ["3.7.9", "3.8.6", "3.9.0", "3.10.0"] + python-version: &python-versions ["3.7.9", "3.8.6", "3.9.0", "3.10.0", "3.11.0"] pip-constraints: - "dimod==0.10.13" - - "dimod~=0.10.0 dwave-system~=1.0" - - "dimod==0.11.0 dwave-preprocessing==0.4.0 dwave-system~=1.0" + - "dimod~=0.10.0 dwave-preprocessing~=0.3.0 dwave-system~=1.0" + - "dimod~=0.11.0 dwave-preprocessing~=0.4.0 dwave-system~=1.0" + - "dimod~=0.12.0 dwave-preprocessing~=0.5.0 dwave-system~=1.0" + exclude: + # dimod < 0.12 not supported on py311+ + - python-version: "3.11.0" + pip-constraints: "dimod==0.10.13" + - python-version: "3.11.0" + pip-constraints: "dimod~=0.10.0 dwave-preprocessing~=0.3.0 dwave-system~=1.0" + - python-version: "3.11.0" + pip-constraints: "dimod~=0.11.0 dwave-preprocessing~=0.4.0 dwave-system~=1.0" - test-macos: name: test-macos-<< matrix.python-version >> From cb4082c797951aaafd65ccaf8d0877fd9b6f05d3 Mon Sep 17 00:00:00 2001 From: Radomir Stevanovic Date: Fri, 23 Dec 2022 03:31:35 -0800 Subject: [PATCH 3/4] Drop AppVeyor; run windows tests on CircleCi --- .appveyor.yml | 24 --------------------- .circleci/config.yml | 51 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 24 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 4eeb8f9..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,24 +0,0 @@ -environment: - matrix: - - PYTHON: "C:\\Python37-x64" - - PYTHON: "C:\\Python38-x64" - - PYTHON: "C:\\Python39-x64" - - PYTHON: "C:\\Python310-x64" - - PYTHON: "C:\\Python311-x64" - -matrix: - fast_finish: true - -cache: - - '%PYTHON%\Lib\site-packages -> requirements.txt, tests\requirements.txt' - - '%AppData%\pip-cache' - -build_script: - - "%PYTHON%\\python.exe -m pip install -r requirements.txt --cache-dir %AppData%\\pip-cache" - - "%PYTHON%\\python.exe -m pip install -r tests\\requirements.txt --cache-dir %AppData%\\pip-cache" - -before_test: - - "%PYTHON%\\python.exe -m pip install ." - -test_script: - - "%PYTHON%\\python.exe -m unittest discover" diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d8482b..9030a9c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,11 @@ version: 2.1 +orbs: + win: circleci/windows@2.2 + +environment: + PIP_PROGRESS_BAR: 'off' + jobs: test-linux: parameters: @@ -120,6 +126,51 @@ jobs: - run: *run-python-tests + test-windows: + parameters: + python-version: + type: string + + executor: + name: win/default + + steps: + - checkout + + - restore_cache: + keys: + - v1-nuget-python-<< parameters.python-version >>-{{ .Environment.CIRCLE_JOB }} + + - run: + name: Install python and create virtualenv + command: | + nuget install python -Version << parameters.python-version >> + python.<< parameters.python-version >>\tools\python -m venv env + + - save_cache: + key: v1-nuget-python-<< parameters.python-version >>-{{ .Environment.CIRCLE_JOB }} + paths: + - python.<< parameters.python-version >> + + - run: + name: Install requirements + command: | + env\Scripts\activate.ps1 + pip install -U pip + pip install -r requirements.txt -r tests\requirements.txt + + - run: + name: Install package + command: | + env\Scripts\activate.ps1 + pip install . + + - run: + name: Run tests + command: | + env\Scripts\activate.ps1 + coverage run -m unittest discover + test-docs: docker: - image: cimg/python:3.7 From f5edb6eedc85ee4059ea3172a0732028a5909d7d Mon Sep 17 00:00:00 2001 From: Radomir Stevanovic Date: Fri, 23 Dec 2022 03:44:08 -0800 Subject: [PATCH 4/4] Use generation caching in circleci --- .circleci/config.yml | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9030a9c..58ebc0a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,10 @@ version: 2.1 +parameters: + cache-generation: + type: integer + default: 1 + orbs: win: circleci/windows@2.2 @@ -21,7 +26,7 @@ jobs: - checkout - restore_cache: &restore-cache-env - key: v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }} + key: v<< pipeline.parameters.cache-generation >>-pip-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }} - run: &create-virtualenv name: Create virtual environment @@ -38,7 +43,7 @@ jobs: pip install wheel twine - save_cache: &save-cache-env - key: v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }} + key: v<< pipeline.parameters.cache-generation >>-pip-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }} paths: - env @@ -68,6 +73,7 @@ jobs: type: string xcode: type: string + default: "13.2.0" macos: xcode: << parameters.xcode >> @@ -92,7 +98,7 @@ jobs: - restore_cache: &restore-cache-pyenv keys: - - v1-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-<< parameters.xcode >> + - v<< pipeline.parameters.cache-generation >>-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-<< parameters.xcode >> - run: &pyenv-install-python name: Install python @@ -107,7 +113,7 @@ jobs: pyenv global << parameters.python-version >> - save_cache: &save-cache-pyenv - key: v1-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-<< parameters.xcode >> + key: v<< pipeline.parameters.cache-generation >>-pyenv-{{ .Environment.CIRCLE_JOB }}-xcode-<< parameters.xcode >> paths: - ~/.pyenv @@ -139,7 +145,7 @@ jobs: - restore_cache: keys: - - v1-nuget-python-<< parameters.python-version >>-{{ .Environment.CIRCLE_JOB }} + - v<< pipeline.parameters.cache-generation >>-nuget-python-<< parameters.python-version >>-{{ .Environment.CIRCLE_JOB }} - run: name: Install python and create virtualenv @@ -148,7 +154,7 @@ jobs: python.<< parameters.python-version >>\tools\python -m venv env - save_cache: - key: v1-nuget-python-<< parameters.python-version >>-{{ .Environment.CIRCLE_JOB }} + key: v<< pipeline.parameters.cache-generation >>-nuget-python-<< parameters.python-version >>-{{ .Environment.CIRCLE_JOB }} paths: - python.<< parameters.python-version >> @@ -179,7 +185,7 @@ jobs: - checkout - restore_cache: - key: v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum "docs/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }} + key: v<< pipeline.parameters.cache-generation >>-pip-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum "docs/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }} - run: *create-virtualenv @@ -190,7 +196,7 @@ jobs: command: env/bin/pip install -r docs/requirements.txt - save_cache: - key: v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum "docs/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }} + key: v<< pipeline.parameters.cache-generation >>-pip-{{ checksum "requirements.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum "docs/requirements.txt" }}-{{ .Environment.CIRCLE_JOB }} paths: - env @@ -265,11 +271,14 @@ workflows: pip-constraints: "dimod~=0.11.0 dwave-preprocessing~=0.4.0 dwave-system~=1.0" - test-macos: - name: test-macos-<< matrix.python-version >> matrix: parameters: python-version: *python-versions - xcode: ["13.2.0"] + + - test-windows: + matrix: + parameters: + python-version: *python-versions - test-docs