Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
304 changed files
with
27,803 additions
and
8,229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Braket | ||
braket | ||
te | ||
Ket | ||
ket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
trim_trailing_whitespace = true | ||
insert_final_newline = false | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.{yml,yaml}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
ignore: | ||
# Optional: Official actions have moving tags like v1; | ||
# if you use those, you don't need updates. | ||
- dependency-name: "actions/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,324 @@ | ||
--- | ||
|
||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
- v* | ||
|
||
jobs: | ||
standard: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runs-on: [ubuntu-latest, windows-latest, macos-latest] | ||
python: | ||
- 3.7 | ||
- 3.8 | ||
- 3.9 | ||
- '3.10' | ||
|
||
name: "Python ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}" | ||
runs-on: ${{ matrix.runs-on }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get history and tags for SCM versioning to work | ||
if: ${{ !env.ACT }} | ||
run: | | ||
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Setup Python ${{ matrix.python }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
architecture: 'x64' | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
setup.cfg | ||
pyproject.toml | ||
- name: Generate requirement file (Unix) | ||
if: runner.os != 'Windows' | ||
run: | | ||
python setup.py gen_reqfile --include-extras=test,azure-quantum,braket,revkit | ||
- name: Generate requirement file (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
python setup.py gen_reqfile --include-extras=test,azure-quantum,braket | ||
- name: Prepare env | ||
run: | | ||
python -m pip install -U pip setuptools wheel pybind11 | ||
cat requirements.txt | ||
python -m pip install -r requirements.txt --prefer-binary | ||
python -m pip install coveralls | ||
- name: Setup annotations on Linux | ||
if: runner.os == 'Linux' | ||
run: python -m pip install pytest-github-actions-annotate-failures | ||
|
||
- name: Build and install package (Unix) | ||
if: runner.os != 'Windows' | ||
run: python -m pip install -ve .[azure-quantum,braket,revkit,test] | ||
|
||
- name: Build and install package (Windows) | ||
if: runner.os == 'Windows' | ||
run: python -m pip install -ve .[azure-quantum,braket,test] | ||
|
||
- name: Pytest | ||
run: | | ||
echo 'backend: Agg' > matplotlibrc | ||
python -m pytest -p no:warnings --cov=projectq | ||
- name: Coveralls.io | ||
run: coveralls --service=github | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_FLAG_NAME: python-${{ matrix.python }}-${{ matrix.runs-on }}-x64 | ||
COVERALLS_PARALLEL: true | ||
|
||
finish: | ||
needs: standard | ||
runs-on: ubuntu-latest | ||
container: python:3-slim | ||
steps: | ||
- name: Coveralls Finished | ||
run: | | ||
pip3 install --upgrade coveralls | ||
coveralls --finish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
clang: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
clang: | ||
- 3.5 # version for full C++14 support (3.4 fails because of -fstack-protector-strong) | ||
- 5 # earliest version for reasonable C++17 support | ||
- 10 # version for full C++17 support (with patches) | ||
- latest | ||
env: | ||
CC: clang | ||
CXX: clang++ | ||
PROJECTQ_CLEANUP_COMPILER_FLAGS: ${{ (matrix.clang < 10) && 1 || 0 }} | ||
|
||
name: "Python 3 • Clang ${{ matrix.clang }} • x64" | ||
container: "silkeh/clang:${{ matrix.clang }}" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get history and tags for SCM versioning to work | ||
if: ${{ !env.ACT }} | ||
run: | | ||
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Prepare env | ||
run: > | ||
apt-get update && apt-get install -y python3-dev python3-pip python3-setuptools python3-wheel | ||
python3-numpy python3-scipy python3-matplotlib python3-requests python3-networkx | ||
python3-pytest python3-pytest-cov python3-flaky | ||
libomp-dev | ||
--no-install-recommends | ||
- name: Prepare Python env | ||
run: | | ||
python3 -m pip install -U pip setuptools wheel | ||
python3 setup.py gen_reqfile --include-extras=test,azure-quantum,braket | ||
cat requirements.txt | ||
python3 -m pip install -r requirements.txt --prefer-binary | ||
- name: Upgrade pybind11 and flaky | ||
run: python3 -m pip install --upgrade pybind11 flaky --prefer-binary | ||
|
||
- name: Build and install package | ||
run: python3 -m pip install -ve .[azure-quantum,braket,test] | ||
|
||
- name: Pytest | ||
run: | | ||
echo 'backend: Agg' > matplotlibrc | ||
python3 -m pytest -p no:warnings | ||
gcc: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
gcc: | ||
- 7 # C++17 earliest version | ||
- latest | ||
|
||
name: "Python 3 • GCC ${{ matrix.gcc }} • x64" | ||
container: "gcc:${{ matrix.gcc }}" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get history and tags for SCM versioning to work | ||
if: ${{ !env.ACT }} | ||
run: | | ||
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Prepare env | ||
run: > | ||
apt-get update && apt-get install -y python3-dev python3-pip python3-setuptools python3-wheel | ||
python3-numpy python3-scipy python3-matplotlib python3-requests python3-networkx | ||
python3-pytest python3-pytest-cov python3-flaky | ||
--no-install-recommends | ||
- name: Prepare Python env | ||
run: | | ||
python3 -m pip install -U pip setuptools wheel | ||
python3 setup.py gen_reqfile --include-extras=test,azure-quantum,braket | ||
cat requirements.txt | ||
python3 -m pip install -r requirements.txt --prefer-binary | ||
- name: Upgrade pybind11 and flaky | ||
run: python3 -m pip install --upgrade pybind11 flaky --prefer-binary | ||
|
||
- name: Build and install package | ||
run: python3 -m pip install -ve .[azure-quantum,braket,test] | ||
|
||
- name: Pytest | ||
run: | | ||
echo 'backend: Agg' > matplotlibrc | ||
python3 -m pytest -p no:warnings | ||
# Testing on CentOS (manylinux uses a centos base, and this is an easy way | ||
# to get GCC 4.8, which is the manylinux1 compiler). | ||
centos: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
centos: | ||
- 7 # GCC 4.8 | ||
- 8 | ||
include: | ||
- centos: 7 | ||
python_pkg: rh-python38-python-pip rh-python38-python-devel | ||
enable_repo: --enablerepo=centos-sclo-rh | ||
- centos: 8 | ||
python_pkg: python38-devel | ||
|
||
|
||
name: "Python 3 • CentOS ${{ matrix.centos }} • x64" | ||
container: "centos:${{ matrix.centos }}" | ||
|
||
steps: | ||
- name: Enable cache for yum | ||
run: echo 'keepcache=1' >> /etc/yum.conf | ||
|
||
- name: Setup yum cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
/var/cache/yum/ | ||
/var/cache/dnf/ | ||
key: ${{ runner.os }}-centos${{ matrix.centos }}-yum-${{ secrets.yum_cache }} | ||
|
||
- name: Fix repository URLs (CentOS 8 only) | ||
if: matrix.centos == 8 | ||
run: | | ||
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* | ||
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* | ||
- name: Update YUM/DNF | ||
run: yum update -y | ||
|
||
- name: Enable extra repositories && modify PATH (CentOS 7) | ||
if: matrix.centos == 7 | ||
run: | | ||
yum install -y centos-release-scl-rh | ||
yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm | ||
echo '/opt/rh/rh-python38/root/usr/bin' >> $GITHUB_PATH | ||
- name: Add Python 3 and other dependencies | ||
run: yum install -y ${{ matrix.enable_repo }} ${{ matrix.python_pkg }} gcc-c++ make | ||
|
||
- name: Install Git > 2.18 | ||
run: | | ||
yum install -y git | ||
git config --global --add safe.directory /__w/ProjectQ/ProjectQ | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get history and tags for SCM versioning to work | ||
if: ${{ !env.ACT }} | ||
run: | | ||
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Create pip cache dir | ||
run: mkdir -p ~/.cache/pip | ||
|
||
- name: Cache wheels | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-centos${{ matrix.centos }}-pip-${{ hashFiles('**/setup.cfg', '**/pyproject.toml') }} | ||
restore-keys: ${{ runner.os }}-centos-pip- | ||
|
||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install -U pip setuptools wheel | ||
python3 setup.py gen_reqfile --include-extras=test,azure-quantum,braket | ||
cat requirements.txt | ||
python3 -m pip install -r requirements.txt --prefer-binary | ||
- name: Build and install package | ||
run: python3 -m pip install -ve .[azure-quantum,braket,test] | ||
|
||
- name: Pytest | ||
run: | | ||
echo 'backend: Agg' > matplotlibrc | ||
python3 -m pytest -p no:warnings | ||
documentation: | ||
name: "Documentation build test" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get history and tags for SCM versioning to work | ||
if: ${{ !env.ACT }} | ||
run: | | ||
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
architecture: 'x64' | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
setup.cfg | ||
pyproject.toml | ||
- name: Install docs & setup requirements | ||
run: | | ||
python3 -m pip install .[docs] | ||
- name: Build docs | ||
run: python3 -m sphinx -b html docs docs/.build | ||
|
||
- name: Make SDist | ||
run: python3 setup.py sdist |
Oops, something went wrong.