Skip to content

Commit 76f4809

Browse files
authored
Merge pull request #402 from ProjectQ-Framework/release/0.6.0
Release version 0.6.0
2 parents 2354150 + e0ff304 commit 76f4809

File tree

268 files changed

+17044
-7018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

268 files changed

+17044
-7018
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
trim_trailing_whitespace = true
6+
insert_final_newline = false
7+
indent_style = space
8+
indent_size = 4
9+
10+
[*.{yml,yaml}]
11+
indent_style = space
12+
indent_size = 2

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
ignore:
8+
# Optional: Official actions have moving tags like v1;
9+
# if you use those, you don't need updates.
10+
- dependency-name: "actions/*"

.github/workflows/ci.yml

Lines changed: 353 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,353 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
- develop
10+
- v*
11+
12+
jobs:
13+
standard:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
runs-on: [ubuntu-latest, windows-latest, macos-latest]
18+
python:
19+
- 3.6
20+
- 3.7
21+
- 3.8
22+
- 3.9
23+
24+
name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
25+
runs-on: ${{ matrix.runs-on }}
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
30+
- name: Get history and tags for SCM versioning to work
31+
run: |
32+
git fetch --prune --unshallow
33+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
34+
35+
- name: Setup Python ${{ matrix.python }}
36+
uses: actions/setup-python@v2
37+
with:
38+
python-version: ${{ matrix.python }}
39+
architecture: 'x64'
40+
41+
- name: Get pip cache dir
42+
id: pip-cache
43+
run: |
44+
echo "::set-output name=dir::$(python -m pip cache dir)"
45+
46+
- name: Cache wheels
47+
uses: actions/cache@v2
48+
with:
49+
path: ${{ steps.pip-cache.outputs.dir }}
50+
key: ${{ runner.os }}-${{ matrix.python }}-pip-${{ hashFiles('**/setup.cfg') }}
51+
restore-keys: ${{ runner.os }}-${{ matrix.python }}-pip-
52+
53+
- name: Generate requirement file (Unix)
54+
if: runner.os != 'Windows'
55+
run: |
56+
python setup.py gen_reqfile --include-extras=test,braket,revkit
57+
58+
- name: Generate requirement file (Windows)
59+
if: runner.os == 'Windows'
60+
run: |
61+
python setup.py gen_reqfile --include-extras=test,braket
62+
63+
- name: Prepare env
64+
run: |
65+
python -m pip install -r requirements.txt --prefer-binary
66+
python -m pip install coveralls
67+
68+
- name: Setup annotations on Linux
69+
if: runner.os == 'Linux'
70+
run: python -m pip install pytest-github-actions-annotate-failures
71+
72+
- name: Build and install package (Unix)
73+
if: runner.os != 'Windows'
74+
run: python -m pip install -ve .[braket,revkit,test]
75+
76+
- name: Build and install package (Windows)
77+
if: runner.os == 'Windows'
78+
run: python -m pip install -ve .[braket,test]
79+
80+
- name: Pytest
81+
run: |
82+
echo 'backend: Agg' > matplotlibrc
83+
python -m pytest -p no:warnings --cov=projectq
84+
85+
- name: Coveralls.io
86+
run: coveralls --service=github
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
COVERALLS_FLAG_NAME: python-${{ matrix.python }}-${{ matrix.runs-on }}-x64
90+
COVERALLS_PARALLEL: true
91+
92+
93+
finish:
94+
needs: standard
95+
runs-on: ubuntu-latest
96+
container: python:3-slim
97+
steps:
98+
- name: Coveralls Finished
99+
run: |
100+
pip3 install --upgrade coveralls
101+
coveralls --finish
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
105+
106+
clang:
107+
runs-on: ubuntu-latest
108+
strategy:
109+
fail-fast: false
110+
matrix:
111+
clang:
112+
- 3.5 # version for full C++14 support (3.4 fails because of -fstack-protector-strong)
113+
- 5 # earliest version for reasonable C++17 support
114+
- 10 # version for full C++17 support (with patches)
115+
- latest
116+
env:
117+
CC: clang
118+
CXX: clang++
119+
PROJECTQ_CLEANUP_COMPILER_FLAGS: ${{ (matrix.clang < 10) && 1 || 0 }}
120+
121+
name: "🐍 3 • Clang ${{ matrix.clang }} • x64"
122+
container: "silkeh/clang:${{ matrix.clang }}"
123+
124+
steps:
125+
- uses: actions/checkout@v2
126+
127+
- name: Get history and tags for SCM versioning to work
128+
run: |
129+
git fetch --prune --unshallow
130+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
131+
132+
- name: Prepare env
133+
run: >
134+
apt-get update && apt-get install -y python3-dev python3-pip python3-setuptools python3-wheel
135+
python3-numpy python3-scipy python3-matplotlib python3-requests python3-networkx
136+
python3-pytest python3-pytest-cov python3-flaky
137+
--no-install-recommends
138+
139+
- name: Prepare Python env
140+
run: |
141+
python3 setup.py gen_reqfile --include-extras=test,braket
142+
python3 -m pip install -r requirements.txt --prefer-binary
143+
144+
- name: Upgrade pybind11 and flaky
145+
run: python3 -m pip install --upgrade pybind11 flaky --prefer-binary
146+
147+
- name: Build and install package
148+
run: python3 -m pip install -ve .[braket,test]
149+
150+
- name: Pytest
151+
run: |
152+
echo 'backend: Agg' > matplotlibrc
153+
python3 -m pytest -p no:warnings
154+
155+
156+
gcc:
157+
runs-on: ubuntu-latest
158+
strategy:
159+
fail-fast: false
160+
matrix:
161+
gcc:
162+
- 7 # C++17 earliest version
163+
- latest
164+
165+
name: "🐍 3 • GCC ${{ matrix.gcc }} • x64"
166+
container: "gcc:${{ matrix.gcc }}"
167+
168+
steps:
169+
- uses: actions/checkout@v2
170+
171+
- name: Get history and tags for SCM versioning to work
172+
run: |
173+
git fetch --prune --unshallow
174+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
175+
176+
- name: Prepare env
177+
run: >
178+
apt-get update && apt-get install -y python3-dev python3-pip python3-setuptools python3-wheel
179+
python3-numpy python3-scipy python3-matplotlib python3-requests python3-networkx
180+
python3-pytest python3-pytest-cov python3-flaky
181+
--no-install-recommends
182+
183+
- name: Prepare Python env
184+
run: |
185+
python3 setup.py gen_reqfile --include-extras=test,braket
186+
python3 -m pip install -r requirements.txt --prefer-binary
187+
188+
- name: Upgrade pybind11 and flaky
189+
run: python3 -m pip install --upgrade pybind11 flaky --prefer-binary
190+
191+
- name: Build and install package
192+
run: python3 -m pip install -ve .[braket,test]
193+
194+
- name: Pytest
195+
run: |
196+
echo 'backend: Agg' > matplotlibrc
197+
python3 -m pytest -p no:warnings
198+
199+
200+
# Testing on CentOS (manylinux uses a centos base, and this is an easy way
201+
# to get GCC 4.8, which is the manylinux1 compiler).
202+
centos:
203+
runs-on: ubuntu-latest
204+
strategy:
205+
fail-fast: false
206+
matrix:
207+
centos:
208+
- 7 # GCC 4.8
209+
- 8
210+
211+
name: "🐍 3 • CentOS ${{ matrix.centos }} • x64"
212+
container: "centos:${{ matrix.centos }}"
213+
214+
steps:
215+
- name: Enable cache for yum
216+
run: echo 'keepcache=1' >> /etc/yum.conf
217+
218+
- name: Setup yum cache
219+
uses: actions/cache@v2
220+
with:
221+
path: |
222+
/var/cache/yum/
223+
/var/cache/dnf/
224+
key: ${{ runner.os }}-centos${{ matrix.centos }}-yum-${{ secrets.yum_cache }}
225+
226+
- name: Add Python 3 and other dependencies
227+
run: yum update -y && yum install -y python3-devel gcc-c++ make
228+
229+
- name: Setup Endpoint repository (CentOS 7 only)
230+
if: matrix.centos == 7
231+
run: yum -y install https://packages.endpoint.com/rhel/7/os/x86_64/endpoint-repo-1.7-1.x86_64.rpm
232+
233+
- name: Install Git > 2.18
234+
run: yum install -y git
235+
236+
- uses: actions/checkout@v2
237+
238+
- name: Get history and tags for SCM versioning to work
239+
run: |
240+
git fetch --prune --unshallow
241+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
242+
243+
- name: Create pip cache dir
244+
run: mkdir -p ~/.cache/pip
245+
246+
- name: Cache wheels
247+
uses: actions/cache@v2
248+
with:
249+
path: ~/.cache/pip
250+
key: ${{ runner.os }}-centos${{ matrix.centos }}-pip-${{ hashFiles('**/setup.cfg') }}
251+
restore-keys: ${{ runner.os }}-centos-pip-
252+
253+
- name: Update pip
254+
run: python3 -m pip install --upgrade pip
255+
256+
- name: Install dependencies
257+
run: |
258+
python3 setup.py gen_reqfile --include-extras=test,braket
259+
python3 -m pip install -r requirements.txt --prefer-binary
260+
261+
- name: Build and install package
262+
run: python3 -m pip install -ve .[braket,test]
263+
264+
- name: Pytest
265+
run: |
266+
echo 'backend: Agg' > matplotlibrc
267+
python3 -m pytest -p no:warnings
268+
269+
270+
documentation:
271+
name: "Documentation build test"
272+
runs-on: ubuntu-latest
273+
274+
steps:
275+
- uses: actions/checkout@v2
276+
277+
- name: Create pip cache dir
278+
run: mkdir -p ~/.cache/pip
279+
280+
- name: Cache wheels
281+
uses: actions/cache@v2
282+
with:
283+
path: ~/.cache/pip
284+
key: ${{ runner.os }}-doc-pip-${{ hashFiles('**/setup.cfg') }}
285+
restore-keys: ${{ runner.os }}-doc-pip-
286+
287+
- name: Get history and tags for SCM versioning to work
288+
run: |
289+
git fetch --prune --unshallow
290+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
291+
292+
- uses: actions/setup-python@v2
293+
294+
- name: Install docs & setup requirements
295+
run: |
296+
python3 -m pip install .[docs]
297+
298+
- name: Build docs
299+
run: python3 -m sphinx -b html docs docs/.build
300+
301+
- name: Make SDist
302+
run: python3 setup.py sdist
303+
304+
305+
win32-msvc2017:
306+
name: "🐍 ${{ matrix.python }} • MSVC 2017 • x64"
307+
runs-on: windows-2016
308+
strategy:
309+
fail-fast: false
310+
matrix:
311+
python:
312+
- 3.6
313+
- 3.7
314+
- 3.8
315+
- 3.9
316+
317+
steps:
318+
- uses: actions/checkout@v2
319+
320+
- name: Get history and tags for SCM versioning to work
321+
run: |
322+
git fetch --prune --unshallow
323+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
324+
325+
- name: Get pip cache dir
326+
id: pip-cache
327+
run: |
328+
echo "::set-output name=dir::$(python -m pip cache dir)"
329+
330+
- name: Cache wheels
331+
uses: actions/cache@v2
332+
with:
333+
path: ${{ steps.pip-cache.outputs.dir }}
334+
key: ${{ runner.os }}-${{ matrix.python }}-pip-${{ hashFiles('**/setup.cfg') }}
335+
restore-keys: ${{ runner.os }}-${{ matrix.python }}-pip-
336+
337+
- name: Setup 🐍 ${{ matrix.python }}
338+
uses: actions/setup-python@v2
339+
with:
340+
python-version: ${{ matrix.python }}
341+
342+
- name: Prepare env
343+
run: |
344+
python setup.py gen_reqfile --include-extras=test,braket
345+
python -m pip install -r requirements.txt --prefer-binary
346+
347+
- name: Build and install package
348+
run: python -m pip install -ve .[braket,test]
349+
350+
- name: Run all checks
351+
run: |
352+
echo 'backend: Agg' > matplotlibrc
353+
python3 -m pytest -p no:warnings

0 commit comments

Comments
 (0)