Skip to content

Commit

Permalink
Merge pull request #34 from arcondello/dwave-samplers-dependency
Browse files Browse the repository at this point in the history
Move the source code to dwave-samplers
  • Loading branch information
arcondello authored Nov 22, 2022
2 parents ae83515 + dbd0f85 commit b6bda7c
Show file tree
Hide file tree
Showing 36 changed files with 92 additions and 2,022 deletions.
239 changes: 83 additions & 156 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,194 +1,121 @@
version: 2.1

parameters:
package:
type: string
default: dwave-greedy

orbs:
ocean: dwave/[email protected]
ocean: dwave/[email protected]
win: circleci/[email protected]

environment:
PIP_PROGRESS_BAR: 'off'

jobs:
test-install:
test-linux:
parameters:
python-version:
type: string

docker:
- image: circleci/python:3.7 # last version pip==8.1.0 works on
- image: circleci/python:<< parameters.python-version >>

working_directory: ~/repo

steps:
- checkout

- ocean/pip-install:
requirements: tests/requirements.txt
cache: true

- ocean/pip-install:
packages: .
cache: false

- ocean/coverage-run-unittest

test-macos:
parameters:
python-version:
type: string

executor:
name: ocean/macos
xcode: "13.2.0"

steps:
- checkout

- attach_workspace: &attach-dist
at: dist
- ocean/brew-install-pyenv

- ocean/pyenv-install-python:
python-version: << parameters.python-version >>
cache: true

- ocean/pip-install:
requirements: tests/requirements.txt
cache: true

- ocean/pip-install:
packages: .
cache: false

- ocean/coverage-run-unittest

deploy:
docker:
- image: circleci/python:3.7

working_directory: ~/repo

steps:
- checkout

- run:
# pip 19.0 is the first to support pyproject.toml build config *with*
# environment markers (note: we split numpy on py310), and
# *manylinux2010* wheels (required by the numpy version we use)
name: Install from sdist with pip==19.0
name: create virtual env
command: |
python -m venv env-sdist-pip19
. env-sdist-pip19/bin/activate
pip install 'pip==19.0'
pip install ./dist/dwave-greedy*.tar.gz
python -m venv env
- run:
name: Install from sdist with latest pip
name: verify version matches tag
command: |
python -m venv env-sdist
. env-sdist/bin/activate
pip install -U pip
pip install ./dist/dwave-greedy*.tar.gz
. env/bin/activate
pip install .
echo $CIRCLE_TAG
[[ "$(pip show dwave-greedy 2>/dev/null | grep Version)" == "Version: $CIRCLE_TAG" ]]
- run:
# pip 8.1.0 is the first version that supports manylinux1
name: Install from wheel with pip==8.1.0
name: build sdist and bdist
command: |
python -m venv env-wheel-pip8
. env-wheel-pip8/bin/activate
pip install 'pip==8.1.0'
# simulate install from wheel on pypi (but use local dist)
# (1) install greedy only (no deps) from local dist
pip install --no-index --find-links=dist --only-binary=dwave-greedy dwave-greedy --no-deps
# (2) install deps only from pypi
pip install --find-links=dist --only-binary=:all: dwave-greedy
. env/bin/activate
pip install -U pip setuptools wheel
python setup.py sdist
python setup.py bdist_wheel
- run:
name: Install from wheel with latest pip
name: upload
command: |
python -m venv env-wheel
. env-wheel/bin/activate
pip install -U pip
pip install -r requirements.txt
pip install --no-index --find-links=dist --only-binary=dwave-greedy dwave-greedy
. env/bin/activate
pip install twine
twine check dist/*
twine upload -u "$PYPI_USERNAME" -p "$PYPI_PASSWORD" --skip-existing ./dist/*
workflows:
build-test-deploy:
jobs:
- ocean/build-sdist:
filters: &always-run # required because it's indirectly required by the deploy job that runs on tags only
tags:
only: /.*/
version: 2

- ocean/build-manylinux-wheel:
name: build-<< matrix.manylinux-tag >>_<< matrix.manylinux-arch >>-py<< matrix.python-version >>
test:
jobs:
- test-linux:
matrix:
parameters:
manylinux-tag: ["manylinux1", "manylinux2014"]
manylinux-arch: ["x86_64"]
python-version: &python-versions ["3.7.9", "3.8.9", "3.9.4", "3.10.0"]
exclude:
# py310 not available in manylinux1_x86_64
- manylinux-tag: "manylinux1"
manylinux-arch: "x86_64"
python-version: "3.10.0"
filters:
<<: *always-run

- ocean/cibw-build-linux-aarch64-wheel:
name: build-<< matrix.manylinux-tag >>_aarch64-py<< matrix.python-version >>
matrix:
parameters:
manylinux-tag: ["manylinux2014"]
python-version: *python-versions
filters:
<<: *always-run

- ocean/test-linux-from-dist:
name: test-linux-py<< matrix.python-version >>|<< matrix.constraints >>
requires:
- ocean/build-sdist
- ocean/build-manylinux-wheel
- ocean/cibw-build-linux-aarch64-wheel
post-steps:
- run: make -C tests/
matrix:
parameters:
python-version: *python-versions
package: [<< pipeline.parameters.package >>]
constraints: ["dimod~=0.9.0,>=0.9.2 dwave-system~=1.9.0", "dimod~=0.10.0", "dimod==0.11.0"]
exclude:
# dimod < 0.10 not supported on py310
- python-version: "3.10.0"
package: << pipeline.parameters.package >>
constraints: "dimod~=0.9.0,>=0.9.2 dwave-system~=1.9.0"
filters:
<<: *always-run

- test-install:
requires:
- ocean/build-sdist
- ocean/build-manylinux-wheel
filters:
<<: *always-run

- ocean/test-docs:
name: test-docs
requires:
- ocean/build-sdist
- ocean/build-manylinux-wheel
matrix:
parameters:
package: [<< pipeline.parameters.package >>]
filters:
<<: *always-run

- ocean/cibw-build-macos-wheel:
name: build-macos-py<< matrix.python-version >>
matrix:
parameters:
python-version: *python-versions
cibw-archs: ["x86_64 universal2"]
filters:
<<: *always-run

- ocean/test-macos-from-dist:
name: test-macos-py<< matrix.python-version >>
requires:
- ocean/build-sdist
- ocean/cibw-build-macos-wheel
post-steps:
- run: make -C tests/
- test-macos:
matrix:
parameters:
python-version: *python-versions
xcode: ["13.2.0"]
package: [<< pipeline.parameters.package >>]
filters:
<<: *always-run

- ocean/build-windows-wheel:
name: build-win-<< matrix.python-arch >>-py<< matrix.python-version >>
matrix:
parameters:
python-version: *python-versions
python-arch: &python-archs-win [""]
filters:
<<: *always-run

- ocean/test-windows-from-dist:
name: test-win-<< matrix.python-arch >>-py<< matrix.python-version >>
requires:
- ocean/build-windows-wheel
matrix:
parameters:
python-version: *python-versions
python-arch: *python-archs-win
package: [<< pipeline.parameters.package >>]
filters:
<<: *always-run

- ocean/pypi-deploy:
requires:
- ocean/test-linux-from-dist
- ocean/test-macos-from-dist
- ocean/test-windows-from-dist
- ocean/test-docs
- test-install
filters:
deploy:
jobs:
- deploy:
filters: &deploy-filters
tags:
only: /^[0-9]+(\.[0-9]+)*((\.dev|rc)([0-9]+)?)?$/
only: /^[0-9]+(\.[0-9]+)*(\.dev([0-9]+)?)?$/
branches:
ignore: /.*/
12 changes: 0 additions & 12 deletions .readthedocs.yml

This file was deleted.

2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

20 changes: 2 additions & 18 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> :warning: **Note**: *dwave-greedy* is deprecated in favor of `dwave-samplers <https://github.com/dwavesystems/dwave-samplers>`_.

.. image:: https://circleci.com/gh/dwavesystems/dwave-greedy.svg?style=svg
:target: https://circleci.com/gh/dwavesystems/dwave-greedy
:alt: Linux/MacOS/Windows build status
Expand Down Expand Up @@ -58,24 +60,6 @@ Install from a package on PyPI:
pip install dwave-greedy
or install from source:

.. code-block:: bash
pip install git+https://github.com/dwavesystems/dwave-greedy.git#egg=dwave-greeedy
Note: installation from source involves a "cythonization" step. To install
project requirements automatically, make sure to use a PEP-517 compliant pip,
e.g. ``pip>=10.0``.

To build from source:

.. code-block:: bash
pip install -r requirements.txt
python setup.py build_ext --inplace
python setup.py install
.. installation-end-marker
Expand Down
Loading

0 comments on commit b6bda7c

Please sign in to comment.