Skip to content

Commit

Permalink
Merge pull request #405 from QE-Lab/finish-modularization
Browse files Browse the repository at this point in the history
Finish modularization, and lots of refactoring
  • Loading branch information
jvanstraten authored May 27, 2021
2 parents 85ba1e2 + 54c0d69 commit c498aca
Show file tree
Hide file tree
Showing 554 changed files with 47,786 additions and 58,602 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ openql.egg-info
lab
env
docs
cmake-build-*
145 changes: 77 additions & 68 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
strategy:
matrix:
python:
- '3.5'
- '3.6'
- '3.7'
- '3.8'
- '3.9'
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -28,13 +28,13 @@ jobs:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
brew install bison flex swig
brew install bison flex swig xquartz
echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH
echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH
python -m pip install --upgrade pip setuptools wheel
- name: Build wheel
env:
NPROCS: 100
NPROCS: 5
run: python setup.py bdist_wheel
- name: Wheel path
id: wheel
Expand Down Expand Up @@ -68,10 +68,10 @@ jobs:
manylinux:
- 2014
cpython_version:
- 'cp35-cp35m'
- 'cp36-cp36m'
- 'cp37-cp37m'
- 'cp38-cp38'
- 'cp39-cp39'
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -92,7 +92,7 @@ jobs:
run: curl -L https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz | tar xz --strip-components=1 -C /usr
- name: Build wheel
env:
NPROCS: 100
NPROCS: 5
run: |
/opt/python/${{ matrix.cpython_version }}/bin/python setup.py bdist_wheel
/opt/python/${{ matrix.cpython_version }}/bin/python -m auditwheel repair pybuild/dist/*.whl
Expand Down Expand Up @@ -120,10 +120,10 @@ jobs:
strategy:
matrix:
python:
- '3.5'
- '3.6'
- '3.7'
- '3.8'
- '3.9'
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -145,7 +145,7 @@ jobs:
choco install swig --version 4.0.1
- name: Build wheel
env:
NPROCS: 100
NPROCS: 5
run: python setup.py bdist_wheel
- name: Wheel path
id: wheel
Expand All @@ -165,60 +165,69 @@ jobs:
asset_name: ${{ steps.wheel.outputs.wheel }}
asset_content_type: application/zip

conda:
name: Conda wheels
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-2016
python-version:
- '3.6'
- '3.7'
- '3.8'
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniconda-version: "latest"
channel-priority: strict
channels: conda-forge
show-channel-urls: true
use-only-tar-bz2: true
- name: Install Windows dependencies
if: matrix.os == 'windows-2016'
run: choco install winflexbison3 --version 2.5.18.20190508
- name: Install conda dependencies
run: conda install conda-build conda-verify -y
- name: Build & test
env:
NPROCS: 100
run: conda build conda-recipe --python=${{ matrix.python-version }}
- name: Wheel path
id: wheel
run: |
python -c "import sys,os; print('##[set-output name=path;]' + os.path.abspath(sys.argv[1])); print('##[set-output name=wheel;]' + os.path.basename(sys.argv[1]));" "$(conda build conda-recipe --python=${{ matrix.python-version }} --output)"
python -c "import sys; print('##[set-output name=os;]' + ('linux' if sys.argv[1].startswith('ubuntu') else 'macos' if sys.argv[1].startswith('macos') else 'windows' if sys.argv[1].startswith('windows') else 0/0))" ${{ matrix.os }}
- uses: actions/upload-artifact@v2
with:
name: conda-${{ steps.wheel.outputs.os }}-py${{ matrix.python-version }}
path: ${{ steps.wheel.outputs.path }}
- uses: actions/upload-release-asset@v1
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.wheel.outputs.path }}
asset_name: ${{ steps.wheel.outputs.wheel }}
asset_content_type: application/x-bzip2
# NOTE: disabled conda completely because it is INCREDIBLY slow on CI (multiple
# hours!) and occasionally just breaks the runners entirely after ~6 hours. It
# also doesn't appear like anyone is actually using Conda within the lab
# (anymore), as everything goes through pycQED and it is pip-only.
#
# For a release, if conda is really still necessary, it will just have to be
# done manually.
#
# conda:
# name: Conda wheels
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os:
# - ubuntu-latest
# - macos-latest
# - windows-2016
# python-version:
# - '3.6'
# - '3.7'
# - '3.8'
# - '3.9'
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: recursive
# - name: Set up conda
# uses: conda-incubator/setup-miniconda@v2
# with:
# auto-update-conda: true
# miniconda-version: "latest"
# channel-priority: strict
# channels: conda-forge
# show-channel-urls: true
# use-only-tar-bz2: true
# - name: Install Windows dependencies
# if: matrix.os == 'windows-2016'
# run: choco install winflexbison3 --version 2.5.18.20190508
# - name: Install conda dependencies
# run: conda install conda-build conda-verify -y
# - name: Build & test
# env:
# NPROCS: 5
# run: conda build conda-recipe --python=${{ matrix.python-version }}
# - name: Wheel path
# id: wheel
# run: |
# python -c "import sys,os; print('##[set-output name=path;]' + os.path.abspath(sys.argv[1])); print('##[set-output name=wheel;]' + os.path.basename(sys.argv[1]));" "$(conda build conda-recipe --python=${{ matrix.python-version }} --output)"
# python -c "import sys; print('##[set-output name=os;]' + ('linux' if sys.argv[1].startswith('ubuntu') else 'macos' if sys.argv[1].startswith('macos') else 'windows' if sys.argv[1].startswith('windows') else 0/0))" ${{ matrix.os }}
# - uses: actions/upload-artifact@v2
# with:
# name: conda-${{ steps.wheel.outputs.os }}-py${{ matrix.python-version }}
# path: ${{ steps.wheel.outputs.path }}
# - uses: actions/upload-release-asset@v1
# if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: ${{ steps.wheel.outputs.path }}
# asset_name: ${{ steps.wheel.outputs.wheel }}
# asset_content_type: application/x-bzip2

publish:
name: Publish
Expand All @@ -227,18 +236,18 @@ jobs:
- macos
- manylinux
- windows
- conda
#- conda
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
id: download
- name: Publish to Anaconda cloud
run: |
conda install -c anaconda anaconda-client -y
conda run anaconda login --username ${{ secrets.ANACONDA_USER }} --password ${{ secrets.ANACONDA_PASSWORD }}
conda run anaconda upload ${{ steps.download.outputs.download-path }}/conda-*/*.bz2
conda run anaconda logout
#- name: Publish to Anaconda cloud
# run: |
# conda install -c anaconda anaconda-client -y
# conda run anaconda login --username ${{ secrets.ANACONDA_USER }} --password ${{ secrets.ANACONDA_PASSWORD }}
# conda run anaconda upload ${{ steps.download.outputs.download-path }}/conda-*/*.bz2
# conda run anaconda logout
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.3.1
with:
Expand Down
97 changes: 51 additions & 46 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Configure
run: cmake . -DCMAKE_BUILD_TYPE=Debug -DOPENQL_BUILD_TESTS=ON -DBUILD_SHARED_LIBS=OFF
- name: Build
run: cmake --build . --parallel
run: cmake --build . --parallel 5
- name: Test
run: ctest -C Debug --output-on-failure

Expand All @@ -57,7 +57,7 @@ jobs:
mkdir cbuild
cd cbuild && cmake ../examples/cpp-standalone-example
- name: Build
run: make -C cbuild -j
run: make -C cbuild -j 5
- name: Test
run: cd tests && ../cbuild/example

Expand All @@ -72,10 +72,10 @@ jobs:
- macos-latest
- windows-latest
python:
- '3.5'
- '3.6'
- '3.7'
- '3.8'
- '3.9'
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -91,7 +91,7 @@ jobs:
- name: Install dependencies
if: matrix.os == 'macos-latest'
run: |
brew install bison flex swig
brew install bison flex swig xquartz
echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH
echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH
- uses: actions/cache@v2
Expand All @@ -117,49 +117,54 @@ jobs:
run: echo "OPENQL_BUILD_TYPE=Debug" >> $GITHUB_ENV
- name: Build
env:
NPROCS: 100
NPROCS: 5
run: python -m pip install --verbose .
- name: Test
run: python -m pytest

conda:
name: Conda
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
#- windows-latest
#- windows-2016
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniconda-version: "latest"
channel-priority: strict
channels: conda-forge
show-channel-urls: true
use-only-tar-bz2: true
- name: Install Windows dependencies
if: matrix.os == 'windows-2016' || matrix.os == 'windows-latest'
run: choco install winflexbison3 --version 2.5.18.20190508
- name: Install conda dependencies
run: conda install conda-build conda-verify -y
- name: Build & test
env:
NPROCS: 100
run: conda build conda-recipe
- name: Install
# This doesn't seem to work on Windows in CI because everything appears
# to build in a non-default environment and conda is broken for that,
# see https://github.com/conda/conda/issues/7758
# Note that conda build already does a test install in a fresh
# environment, so this is a bit redundant anyway.
if: matrix.os != 'windows-2016' && matrix.os != 'windows-latest'
run: conda install openql --use-local
# NOTE: disabled conda completely because it is INCREDIBLY slow on CI (multiple
# hours!) and occasionally just breaks the runners entirely after ~6 hours. It
# also doesn't appear like anyone is actually using Conda within the lab
# (anymore), as everything goes through pycQED and it is pip-only.
#
# conda:
# name: Conda
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os:
# - ubuntu-latest
# - macos-latest
# #- windows-latest
# #- windows-2016
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: recursive
# - name: Set up conda
# uses: conda-incubator/setup-miniconda@v2
# with:
# auto-update-conda: true
# miniconda-version: "latest"
# channel-priority: strict
# channels: conda-forge
# show-channel-urls: true
# use-only-tar-bz2: true
# - name: Install Windows dependencies
# if: matrix.os == 'windows-2016' || matrix.os == 'windows-latest'
# run: choco install winflexbison3 --version 2.5.18.20190508
# - name: Install conda dependencies
# run: conda install conda-build conda-verify -y
# - name: Build & test
# env:
# NPROCS: 5
# run: conda build conda-recipe
# - name: Install
# # This doesn't seem to work on Windows in CI because everything appears
# # to build in a non-default environment and conda is broken for that,
# # see https://github.com/conda/conda/issues/7758
# # Note that conda build already does a test install in a fresh
# # environment, so this is a bit redundant anyway.
# if: matrix.os != 'windows-2016' && matrix.os != 'windows-latest'
# run: conda install openql --use-local
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ swig/openql/openql.py
swig/qutechopenql.egg-info

# Test files
test_output
test_output*
.ipynb_checkpoints
tests/visualizer/visualizer_example_output/

Expand Down
Loading

0 comments on commit c498aca

Please sign in to comment.