Skip to content

Commit

Permalink
Merge pull request #262 from entropicalabs/dev
Browse files Browse the repository at this point in the history
Pushing version v0.2.0 including separately installable plugins and other features
  • Loading branch information
KilianPoirier authored Sep 8, 2023
2 parents e2f83a5 + 750dce1 commit 3e2fc5f
Show file tree
Hide file tree
Showing 303 changed files with 12,796 additions and 6,864 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ jobs:
run: |
python -m pip install --upgrade pip build twine
pip install setuptools wheel twine
pip install .
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
run: |
scripts/push_package_pypi.sh __token__ ${{secrets.PYPI_API_TOKEN}}
7 changes: 3 additions & 4 deletions .github/workflows/test_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip
pip install .[tests]
make dev-install-tests
pip install ipykernel
- name: Setup IBMQ account
env:
Expand Down Expand Up @@ -63,8 +63,7 @@ jobs:
run: |
source env/bin/activate
ipython kernel install --name "env" --user
pytest tests/ -m 'not (qpu or sim)' --cov --cov-report=xml:coverage.xml
pytest tests/ src/*/tests -m 'not (qpu or sim)' --cov -n auto
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
with:
Expand All @@ -87,7 +86,7 @@ jobs:
- name: Install OpenQAOA
run: |
python -m pip install --upgrade pip
pip install .[docs]
make dev-install-docs
- name: Install qvm
run: |
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/test_dev_ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ jobs:
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip
pip install .[tests]
make local-install
pip install -e ./src/openqaoa-core[tests]
pip install ipykernel
- name: Run tests
run: |
source env/bin/activate
ipython kernel install --name "env" --user
pytest tests/ -v -m 'not (qpu or docker_aws or api or sim or braket_api)'
pytest tests/ src/*/tests/ -v -m 'not (qpu or docker_aws or api or sim or braket_api)'
docs-ext:
runs-on: ubuntu-latest
Expand All @@ -70,7 +71,8 @@ jobs:
- name: Install OpenQAOA
run: |
python -m pip install --upgrade pip
pip install .[docs]
pip install .
pip install -e ./src/openqaoa-core[docs]
- name: Install qvm
run: |
Expand All @@ -95,4 +97,4 @@ jobs:
mkdir ./docs/source/notebooks
cp ./examples/*.ipynb ./docs/source/notebooks/
cd docs/
make html SPHINXOPTS="-W --keep-going"
make html SPHINXOPTS="-W --keep-going"
6 changes: 3 additions & 3 deletions .github/workflows/test_main_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip
pip install .[tests]
make dev-install-tests
pip install ipykernel
- name: Setup IBMQ account
env:
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
run: |
source env/bin/activate
ipython kernel install --name "env" --user
pytest tests/ -m 'not (qpu or sim)' --cov --cov-report=xml:coverage.xml
pytest tests/ src/*/tests -m 'not (qpu or sim)' --cov --cov-report=xml:coverage.xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
Expand All @@ -91,7 +91,7 @@ jobs:
- name: Install OpenQAOA
run: |
python -m pip install --upgrade pip
pip install .[docs]
make dev-install-docs
- name: Install qvm
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_main_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ jobs:
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip
pip install .[tests]
make dev-install-tests
pip install ipykernel
- name: Run tests
run: |
source env/bin/activate
ipython kernel install --user --name "env"
pytest tests/ -m 'not (qpu or api or docker_aws or braket_api or sim)'
pytest tests/ src/*/tests -m 'not (qpu or api or docker_aws or braket_api or sim)'
5 changes: 3 additions & 2 deletions .github/workflows/test_main_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade setuptools
pip install wheel
pip install .[tests]
make dev-install-tests
pip install ipykernel
# Install Rigetti Forest SDK and launch QUILC + QVM services
Expand All @@ -63,4 +63,5 @@ jobs:
run: |
.\env\Scripts\Activate.ps1
ipython kernel install --name "env" --user
pytest tests/ -m 'not (qpu or api or docker_aws or braket_api or sim)'
pytest \tests -m 'not (qpu or api or docker_aws or braket_api or sim)'
Get-ChildItem -Directory | ForEach-Object { pytest $_.FullName -m 'not (qpu or api or docker_aws or braket_api or sim)'}
31 changes: 30 additions & 1 deletion .github/workflows/test_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,37 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install OpenQAOA-Core
run: |
pip install openqaoa-core
python -c 'from openqaoa._version import __version__; print(__version__)'
- name: Install OpenQAOA-Qiskit
run: |
pip install openqaoa-qiskit
python -c 'from openqaoa._version import __version__; print(__version__)'
- name: Install OpenQAOA-Pyquil
run: |
pip install openqaoa-pyquil
python -c 'from openqaoa._version import __version__; print(__version__)'
- name: Install OpenQAOA-Braket
run: |
pip install openqaoa-braket
python -c 'from openqaoa._version import __version__; print(__version__)'
- name: Install OpenQAOA-Azure
run: |
pip install openqaoa-azure
python -c 'from openqaoa._version import __version__; print(__version__)'
- name: Install OpenQAOA
- name: Install OpenQAOA (Full)
run: |
pip install openqaoa
python -c 'from openqaoa._version import __version__; print(__version__)'
62 changes: 62 additions & 0 deletions .github/workflows/test_pypi_prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Test the PyPi pre-release install weekly

on:
# schedule:
# - cron: "0 0 * * 1,3,5" #“At 00:00 on Monday, Wednesday, and Friday.” https://crontab.guru/#0_0_*_*_1,3,5
workflow_dispatch:

jobs:
test_pypi:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ['3.8', '3.9', '3.10', '3.11']
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}

# Define job steps
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Check-out repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install OpenQAOA-Core release candidate
run: |
pip install --pre openqaoa-core
python -c 'from openqaoa._version import __version__; print(__version__)'
- name: Install OpenQAOA-Qiskit release candidate
run: |
pip install --pre openqaoa-qiskit
python -c 'from openqaoa._version import __version__; print(__version__)'
- name: Install OpenQAOA-Pyquil release candidate
run: |
pip install --pre openqaoa-pyquil
python -c 'from openqaoa._version import __version__; print(__version__)'
- name: Install OpenQAOA-Braket release candidate
run: |
pip install --pre openqaoa-braket
python -c 'from openqaoa._version import __version__; print(__version__)'
- name: Install OpenQAOA-Azure release candidate
run: |
pip install --pre openqaoa-azure
python -c 'from openqaoa._version import __version__; print(__version__)'
- name: Install OpenQAOA (Full) release candidate
run: |
pip install --pre openqaoa
python -c 'from openqaoa._version import __version__; print(__version__)'
10 changes: 9 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ sphinx:
python:
install:
- method: pip
path: .
path: ./src/openqaoa-core
extra_requirements:
- docs
- method: pip
path: ./src/openqaoa-qiskit
- method: pip
path: ./src/openqaoa-pyquil
- method: pip
path: ./src/openqaoa-azure
- method: pip
path: ./src/openqaoa-braket
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## Version v0.2.0 (September 8th, 2023)

This new version brings an import change to OpenQAOA, separately installable plugins to access
different providers.

## What's changed

This version brings the following new features:
* Independently installable plugins
* New problem classes
* Sherrington-Kirkpatrick (SK)
* k-Coloring (KColor)
* TSP in linear programming (TSP_LP)
* Error mitigation technique implementation
* SPAM twirling
* Improved Github workflows for internal/external release testing
* Additional bug fixes

## Version v0.1.3 (April 21st, 2023)
This version brings a set of new features in OpenQAOA

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# The dockerfile for OpenQAOA braket jobs
FROM 292282985366.dkr.ecr.us-east-1.amazonaws.com/amazon-braket-pytorch-jobs:1.9.1-gpu-py38-cu111-ubuntu20.04
FROM 292282985366.dkr.ecr.us-east-1.amazonaws.com/amazon-braket-base-jobs:1.0-cpu-py39-ubuntu22.04

RUN mkdir -p /openqaoa

ADD ./ /openqaoa/

RUN pip3 install /openqaoa/.
RUN cd openqaoa && make dev-install
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include README.md
include _version.py
56 changes: 56 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#This file stores instructions to install openqaoa in developer mode.
#Currently can only install all packages together for developer mode.

.PHONY: local-install
local-install:
pip install ./src/openqaoa-core
pip install ./src/openqaoa-qiskit
pip install ./src/openqaoa-pyquil
pip install ./src/openqaoa-braket
pip install ./src/openqaoa-azure
pip install .

.PHONY: dev-install
dev-install:
pip install -e ./src/openqaoa-core
pip install -e ./src/openqaoa-qiskit
pip install -e ./src/openqaoa-pyquil
pip install -e ./src/openqaoa-braket
pip install -e ./src/openqaoa-azure
pip install -e .

.PHONY: dev-install-tests
dev-install-tests:
pip install -e ./src/openqaoa-core[tests]
pip install -e ./src/openqaoa-qiskit
pip install -e ./src/openqaoa-pyquil
pip install -e ./src/openqaoa-braket
pip install -e ./src/openqaoa-azure
pip install -e .

.PHONY: dev-install-docs
dev-install-docs:
pip install -e ./src/openqaoa-core[docs]
pip install -e ./src/openqaoa-qiskit
pip install -e ./src/openqaoa-pyquil
pip install -e ./src/openqaoa-braket
pip install -e ./src/openqaoa-azure
pip install -e .

.PHONY: dev-install-all
dev-install-all:
pip install -e ./src/openqaoa-core[all]
pip install -e ./src/openqaoa-qiskit
pip install -e ./src/openqaoa-pyquil
pip install -e ./src/openqaoa-braket
pip install -e ./src/openqaoa-azure
pip install -e .

.PHONY: dev-uninstall
dev-uninstall:
pip uninstall openqaoa -y
pip uninstall openqaoa-core -y
pip uninstall openqaoa-qiskit -y
pip uninstall openqaoa-pyquil -y
pip uninstall openqaoa-braket -y
pip uninstall openqaoa-azure -y
Loading

0 comments on commit 3e2fc5f

Please sign in to comment.