Skip to content

Commit 18693b7

Browse files
authored
Merge branch 'main' into doc_fix_get_standard_gate_name_mapping
2 parents 49d62b9 + 185383d commit 18693b7

File tree

634 files changed

+24450
-8225
lines changed

Some content is hidden

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

634 files changed

+24450
-8225
lines changed

.azure/lint_docs_qpy-linux.yml .azure/lint_docs-linux.yml

+2-23
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ parameters:
44
displayName: "Version of Python to use"
55

66
jobs:
7-
- job: 'Lint_Docs_QPY'
8-
displayName: 'Lint, documentation and QPY'
7+
- job: 'Lint_Docs'
8+
displayName: 'Lint and documentation'
99
pool: {vmImage: 'ubuntu-latest'}
1010

1111
variables:
@@ -43,24 +43,3 @@ jobs:
4343
artifactName: 'html_docs'
4444
Parallel: true
4545
ParallelCount: 8
46-
47-
- task: Cache@2
48-
inputs:
49-
key: 'qpy | test/qpy_compat/test_qpy.py | "$(Build.BuildNumber)"'
50-
restoreKeys: |
51-
qpy | test/qpy_compat/test_qpy.py
52-
path: qpy_files
53-
displayName: Cache old QPY files
54-
55-
- bash: |
56-
set -e
57-
# Reuse the docs environment to avoid needing to rebuild another
58-
# version of Qiskit.
59-
source .tox/docs/bin/activate
60-
mv qpy_files/* test/qpy_compat || :
61-
pushd test/qpy_compat
62-
./run_tests.sh
63-
popd
64-
mkdir -p qpy_files
65-
mv test/qpy_compat/qpy_* qpy_files/.
66-
displayName: 'Run QPY backwards compat tests'

.github/workflows/coverage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
lcov --add-tracefile python.info --add-tracefile rust.info --output-file coveralls.info
7272
7373
- name: Coveralls
74-
uses: coverallsapp/github-action@master
74+
uses: coverallsapp/github-action@v2.3.4
7575
with:
7676
github-token: ${{ secrets.GITHUB_TOKEN }}
7777
path-to-lcov: coveralls.info

.github/workflows/qpy.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: QPY
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- 'stable/*'
8+
pull_request:
9+
merge_group:
10+
concurrency:
11+
group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
12+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
13+
14+
jobs:
15+
backward_compat:
16+
if: github.repository_owner == 'Qiskit'
17+
name: Backwards compatibility
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.9'
26+
27+
- uses: dtolnay/rust-toolchain@stable
28+
29+
- uses: actions/cache@v4
30+
with:
31+
path: test/qpy_compat/qpy_cache
32+
# The hashing is this key can be too eager to invalidate the cache,
33+
# but since we risk the QPY tests failing to update if they're not in
34+
# sync, it's better safe than sorry.
35+
key: qpy-${{ hashFiles('test/qpy_compat/**') }}
36+
37+
- name: Run QPY backwards compatibility tests
38+
working-directory: test/qpy_compat
39+
run: ./run_tests.sh

.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
matrix:
2121
# Normally we test min and max version but we can't run python
2222
# 3.9 on arm64 until actions/setup-python#808 is resolved
23-
python-version: ["3.10", "3.12"]
23+
python-version: ["3.10", "3.13"]
2424
steps:
2525
- uses: actions/checkout@v4
2626
- name: Install Rust toolchain
@@ -44,7 +44,7 @@ jobs:
4444
python -m pip install -U -r requirements.txt -c constraints.txt
4545
python -m pip install -U -r requirements-dev.txt -c constraints.txt
4646
python -m pip install -c constraints.txt -e .
47-
if: matrix.python-version == '3.12'
47+
if: matrix.python-version == '3.13'
4848
- name: 'Install optionals'
4949
run: |
5050
python -m pip install -r requirements-optional.txt -c constraints.txt

.github/workflows/wheels-build.yml

+247
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
name: Build release artifacts
2+
on:
3+
workflow_call:
4+
inputs:
5+
default-action:
6+
description: >-
7+
The default action for each artifact.
8+
Choose from 'build' (default) or 'skip'.
9+
type: string
10+
default: "build"
11+
required: false
12+
13+
sdist:
14+
description: >-
15+
The action to take for the sdist.
16+
Choose from 'default', 'build' or 'skip'.
17+
type: string
18+
default: "default"
19+
required: false
20+
21+
wheels-tier-1:
22+
description: >-
23+
The action to take for Tier 1 wheels.
24+
Choose from 'default', 'build' or 'skip'.
25+
This builds multiple artifacts, which all match 'wheels-tier-1-*'.
26+
type: string
27+
default: "default"
28+
required: false
29+
30+
wheels-32bit:
31+
description: >-
32+
The action to take for Tier 1 wheels.
33+
Choose from 'default', 'build' or 'skip'.
34+
This builds multiple artifacts, which all match 'wheels-32bit-*'.
35+
type: string
36+
default: "default"
37+
required: false
38+
39+
wheels-linux-s390x:
40+
description: >-
41+
The action to take for Linux s390x wheels.
42+
Choose from 'default', 'build' or 'skip'.
43+
type: string
44+
default: "default"
45+
required: false
46+
47+
wheels-linux-ppc64le:
48+
description: >-
49+
The action to take for Linux ppc64le wheels.
50+
Choose from 'default', 'build' or 'skip'.
51+
type: string
52+
default: "default"
53+
required: false
54+
55+
wheels-linux-aarch64:
56+
description: >-
57+
The action to take for Linux AArch64 wheels.
58+
Choose from 'default', 'build' or 'skip'.
59+
type: string
60+
default: "default"
61+
required: false
62+
63+
artifact-prefix:
64+
description: "A prefix to give all artifacts uploaded with 'actions/upload-artifact'."
65+
type: string
66+
default: ""
67+
required: false
68+
69+
python-version:
70+
description: "The Python version to use to host the build runner."
71+
type: string
72+
default: "3.10"
73+
required: false
74+
75+
pgo:
76+
description: "Whether to enable profile-guided optimizations for supported platforms."
77+
type: boolean
78+
default: true
79+
required: false
80+
81+
82+
jobs:
83+
wheels-tier-1:
84+
name: "Wheels / Tier 1"
85+
if: (inputs.wheels-tier-1 == 'default' && inputs.default-action || inputs.wheels-tier-1) == 'build'
86+
runs-on: ${{ matrix.os }}
87+
strategy:
88+
fail-fast: false
89+
matrix:
90+
os:
91+
- ubuntu-latest
92+
# Used for the x86_64 builds.
93+
- macos-12
94+
# Used for the ARM builds.
95+
- macos-14
96+
- windows-latest
97+
steps:
98+
- uses: actions/checkout@v4
99+
- uses: actions/setup-python@v5
100+
with:
101+
python-version: ${{ inputs.python-version }}
102+
architecture: ${{ matrix.os == 'macos-14' && 'arm64' || 'x64' }}
103+
- uses: dtolnay/rust-toolchain@stable
104+
with:
105+
components: llvm-tools-preview
106+
- name: Configure PGO
107+
shell: bash
108+
if: inputs.pgo
109+
# The `$GITHUB_ENV` magic file uses some sort of custom parsing, so the variables shouldn't
110+
# be quoted like they would be if bash were interpreting them. You still need to use quotes
111+
# to avoid word splitting where appropriate in compound environment variables.
112+
#
113+
# Beware that the heredoc is configured to expand bash variables, but cibuildwheel has
114+
# special handling for certain variables (`$PATH`, in particular), so you may need to escape
115+
# some dollar signs to pass those through to cibuildwheel as variables, or use single quotes
116+
# to prevent shell expansion.
117+
run: |
118+
set -e
119+
mkdir -p "$PGO_WORK_DIR"
120+
121+
cat >>"$GITHUB_ENV" <<EOF
122+
CIBW_BEFORE_BUILD=bash ./tools/build_pgo.sh $PGO_WORK_DIR $PGO_OUT_PATH
123+
CIBW_ENVIRONMENT=RUSTUP_TOOLCHAIN=stable RUSTFLAGS='-Cprofile-use=$PGO_OUT_PATH -Cllvm-args=-pgo-warn-missing-function'
124+
CIBW_ENVIRONMENT_LINUX=RUSTUP_TOOLCHAIN=stable RUSTFLAGS='-Cprofile-use=$PGO_OUT_PATH -Cllvm-args=-pgo-warn-missing-function' PATH="\$PATH:\$HOME/.cargo/bin" CARGO_NET_GIT_FETCH_WITH_CLI="true"
125+
EOF
126+
env:
127+
PGO_WORK_DIR: ${{ github.workspace }}/pgo-data
128+
PGO_OUT_PATH: ${{ github.workspace }}/merged.profdata
129+
- uses: pypa/cibuildwheel@v2.21.3
130+
- uses: actions/upload-artifact@v4
131+
with:
132+
path: ./wheelhouse/*.whl
133+
name: ${{ inputs.artifact-prefix }}wheels-tier-1-${{ matrix.os }}
134+
135+
wheels-32bit:
136+
name: "Wheels / 32bit"
137+
if: (inputs.wheels-32bit == 'default' && inputs.default-action || inputs.wheels-32bit) == 'build'
138+
runs-on: ${{ matrix.os }}
139+
strategy:
140+
fail-fast: false
141+
matrix:
142+
os:
143+
- ubuntu-latest
144+
- windows-latest
145+
steps:
146+
- uses: actions/checkout@v4
147+
- uses: actions/setup-python@v5
148+
with:
149+
python-version: ${{ inputs.python-version }}
150+
- uses: dtolnay/rust-toolchain@stable
151+
with:
152+
components: llvm-tools-preview
153+
- name: Build wheels
154+
uses: pypa/cibuildwheel@v2.21.3
155+
env:
156+
CIBW_SKIP: 'pp* cp36-* cp37-* cp38-* *musllinux* *amd64 *x86_64'
157+
- uses: actions/upload-artifact@v4
158+
with:
159+
path: ./wheelhouse/*.whl
160+
name: ${{ inputs.artifact-prefix }}wheels-32bit-${{ matrix.os }}
161+
162+
wheels-linux-s390x:
163+
name: "Wheels / Linux s390x"
164+
if: (inputs.wheels-linux-s390x == 'default' && inputs.default-action || inputs.wheels-linux-s390x) == 'build'
165+
runs-on: ubuntu-latest
166+
steps:
167+
- uses: actions/checkout@v4
168+
- uses: actions/setup-python@v5
169+
name: Install Python
170+
with:
171+
python-version: ${{ inputs.python-version }}
172+
- uses: dtolnay/rust-toolchain@stable
173+
- uses: docker/setup-qemu-action@v3
174+
with:
175+
platforms: all
176+
- uses: pypa/cibuildwheel@v2.21.3
177+
env:
178+
CIBW_ARCHS_LINUX: s390x
179+
CIBW_TEST_SKIP: "cp*"
180+
- uses: actions/upload-artifact@v4
181+
with:
182+
path: ./wheelhouse/*.whl
183+
name: ${{ inputs.artifact-prefix }}wheels-linux-s390x
184+
185+
wheels-linux-ppc64le:
186+
name: "Wheels / Linux ppc64le"
187+
if: (inputs.wheels-linux-ppc64le == 'default' && inputs.default-action || inputs.wheels-linux-ppc64le) == 'build'
188+
runs-on: ubuntu-latest
189+
steps:
190+
- uses: actions/checkout@v4
191+
- uses: actions/setup-python@v5
192+
name: Install Python
193+
with:
194+
python-version: ${{ inputs.python-version }}
195+
- uses: dtolnay/rust-toolchain@stable
196+
- uses: docker/setup-qemu-action@v3
197+
with:
198+
platforms: all
199+
- uses: pypa/cibuildwheel@v2.21.3
200+
env:
201+
CIBW_ARCHS_LINUX: ppc64le
202+
CIBW_TEST_SKIP: "cp*"
203+
- uses: actions/upload-artifact@v4
204+
with:
205+
path: ./wheelhouse/*.whl
206+
name: ${{ inputs.artifact-prefix }}wheels-linux-ppc64le
207+
208+
wheels-linux-aarch64:
209+
name: "Wheels / Linux AArch64"
210+
if: (inputs.wheels-linux-aarch64 == 'default' && inputs.default-action || inputs.wheels-linux-aarch64) == 'build'
211+
runs-on: ubuntu-latest
212+
steps:
213+
- uses: actions/checkout@v4
214+
- uses: actions/setup-python@v5
215+
with:
216+
python-version: ${{ inputs.python-version }}
217+
- uses: dtolnay/rust-toolchain@stable
218+
- uses: docker/setup-qemu-action@v3
219+
with:
220+
platforms: all
221+
- uses: pypa/cibuildwheel@v2.21.3
222+
env:
223+
CIBW_ARCHS_LINUX: aarch64
224+
CIBW_TEST_COMMAND: cp -r {project}/test . && QISKIT_PARALLEL=FALSE stestr --test-path test/python run --abbreviate -n test.python.compiler.test_transpiler
225+
- uses: actions/upload-artifact@v4
226+
with:
227+
path: ./wheelhouse/*.whl
228+
name: ${{ inputs.artifact-prefix }}wheels-linux-aarch64
229+
230+
sdist:
231+
name: "sdist"
232+
if: (inputs.sdist == 'default' && inputs.default-action || inputs.sdist) == 'build'
233+
runs-on: ubuntu-latest
234+
steps:
235+
- uses: actions/checkout@v4
236+
- uses: actions/setup-python@v5
237+
with:
238+
python-version: ${{ inputs.python-version }}
239+
- name: Build sdist
240+
run: |
241+
set -e
242+
python -m pip install -U build
243+
python -m build --sdist .
244+
- uses: actions/upload-artifact@v4
245+
with:
246+
path: ./dist/*.tar.gz
247+
name: ${{ inputs.artifact-prefix }}sdist

.github/workflows/wheels-pr.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build wheels
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
# Above are the defaults for the PR trigger, below are our insertions.
10+
# Trigger on 'labeled' so we catch the initial manual labelling event.
11+
- labeled
12+
13+
concurrency:
14+
group: ${{ github.repository }}-${{ github.ref_name }}-${{ github.workflow }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
test-wheels:
19+
name: Build
20+
if: '${{ contains(github.event.pull_request.labels.*.name, ''ci: test wheels'') }}'
21+
uses: './.github/workflows/wheels-build.yml'
22+
with:
23+
default-action: "build"

0 commit comments

Comments
 (0)