Skip to content

Commit

Permalink
Merge remote-tracking branch 'ibm/main' into latex-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelishman committed Jan 17, 2023
2 parents 34dfee5 + c89b66a commit baf5a5d
Show file tree
Hide file tree
Showing 785 changed files with 28,727 additions and 10,577 deletions.
10 changes: 0 additions & 10 deletions .azure/docs-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ jobs:
versionSpec: '${{ parameters.pythonVersion }}'
displayName: 'Use Python ${{ parameters.pythonVersion }}'

- task: Cache@2
inputs:
key: 'pip | "$(Agent.OS)" | "${{ parameters.pythonVersion }}" | "$(Build.BuildNumber)"'
restoreKeys: |
pip | "$(Agent.OS)" | "${{ parameters.pythonVersion }}"
pip | "$(Agent.OS)"
pip
path: $(PIP_CACHE_DIR)
displayName: Cache pip

- bash: |
set -e
python -m pip install --upgrade pip setuptools wheel
Expand Down
18 changes: 8 additions & 10 deletions .azure/lint-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ jobs:
versionSpec: '${{ parameters.pythonVersion }}'
displayName: 'Use Python ${{ parameters.pythonVersion }}'

- task: Cache@2
inputs:
key: 'pip | "$(Agent.OS)" | "${{ parameters.pythonVersion }}" | "$(Build.BuildNumber)"'
restoreKeys: |
pip | "$(Agent.OS)" | "${{ parameters.pythonVersion }}"
pip | "$(Agent.OS)"
pip
path: $(PIP_CACHE_DIR)
displayName: Cache pip

- bash: |
set -e
python -m pip install --upgrade pip setuptools wheel virtualenv
Expand All @@ -42,17 +32,25 @@ jobs:
- bash: |
set -e
source test-job/bin/activate
echo "Running black, any errors reported can be fixed with 'tox -eblack'"
black --check qiskit test tools examples setup.py
echo "Running rustfmt check, any errors reported can be fixed with 'cargo fmt'"
cargo fmt --check
displayName: "Formatting"
- bash: |
set -e
source test-job/bin/activate
echo "Running pylint"
pylint -rn qiskit test tools
echo "Running Cargo Clippy"
cargo clippy -- -D warnings
echo "Running license header check"
tools/verify_headers.py qiskit test
echo "Running check for optional imports on bare 'import qiskit'"
python tools/find_optional_imports.py
echo "Running check for release notes in incorrect directories"
tools/find_stray_release_notes.py
echo "Running reno lint"
reno lint
displayName: 'Lint'
19 changes: 6 additions & 13 deletions .azure/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,6 @@ jobs:
versionSpec: '${{ parameters.pythonVersion }}'
displayName: 'Use Python ${{ parameters.pythonVersion }}'

- task: Cache@2
inputs:
key: 'pip | "$(Agent.OS)" | "${{ parameters.pythonVersion }}" |"$(Build.BuildNumber)"'
restoreKeys: |
pip | "$(Agent.OS)" | "${{ parameters.pythonVersion }}"
pip | "$(Agent.OS)"
pip
path: $(PIP_CACHE_DIR)
displayName: "Cache pip"

- task: Cache@2
inputs:
key: 'stestr | "$(Agent.OS)" | "${{ parameters.pythonVersion }}" | "$(Build.BuildNumber)"'
Expand Down Expand Up @@ -90,10 +80,9 @@ jobs:
- bash: |
set -e
source test-job/bin/activate
pip install -U "cplex" "qiskit-aer" "z3-solver" -c constraints.txt
pip install -U "cplex;python_version < '3.11'" "qiskit-aer" "z3-solver" -c constraints.txt
mkdir -p /tmp/terra-tests
cp -r test /tmp/terra-tests/.
cp tools/verify_parallel_map.py /tmp/terra-tests/.
cp .stestr.conf /tmp/terra-tests/.
cp -r .stestr /tmp/terra-tests/. || :
sudo apt-get update
Expand All @@ -108,7 +97,6 @@ jobs:
export PYTHONHASHSEED=$(python -S -c "import random; print(random.randint(1, 4294967295))")
echo "PYTHONHASHSEED=$PYTHONHASHSEED"
stestr run
python ./verify_parallel_map.py
popd
env:
QISKIT_PARALLEL: FALSE
Expand Down Expand Up @@ -175,3 +163,8 @@ jobs:
- bash: image_tests/bin/python -m unittest discover -v test/ipynb
displayName: 'Run image test'
env:
# Needed to suppress a warning in jupyter-core 5.x by eagerly migrating to
# a new internal interface that will be the default in jupyter-core 6.x.
# This variable should become redundant on release of jupyter-core 6.
JUPYTER_PLATFORM_DIRS: 1
11 changes: 0 additions & 11 deletions .azure/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ jobs:
versionSpec: '${{ parameters.pythonVersion }}'
displayName: 'Use Python ${{ parameters.pythonVersion }}'

- task: Cache@2
inputs:
key: 'pip | "$(Agent.OS)" | "${{ parameters.pythonVersion }}" | "$(Build.BuildNumber)"'
restoreKeys: |
pip | "$(Agent.OS)" | "${{ parameters.pythonVersion }}"
pip | "$(Agent.OS)"
pip
path: $(PIP_CACHE_DIR)
displayName: "Cache pip"

- task: Cache@2
inputs:
key: 'stestr | "$(Agent.OS)" | "${{ parameters.pythonVersion }}" | "$(Build.BuildNumber)"'
Expand Down Expand Up @@ -57,7 +47,6 @@ jobs:
export PYTHONHASHSEED=$(python -S -c "import random; print(random.randint(1, 4294967295))")
echo "PYTHONHASHSEED=$PYTHONHASHSEED"
stestr run
python ./tools/verify_parallel_map.py
env:
QISKIT_PARALLEL: FALSE
RUST_BACKTRACE: 1
Expand Down
1 change: 0 additions & 1 deletion .azure/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
export PYTHONHASHSEED=$(python -S -c "import random; print(random.randint(1, 1024))")
echo "PYTHONHASHSEED=$PYTHONHASHSEED"
stestr run
python ./tools/verify_parallel_map.py
env:
LANG: 'C.UTF-8'
PYTHONIOENCODING: 'utf-8:backslashreplace'
Expand Down
11 changes: 1 addition & 10 deletions .azure/tutorials-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,13 @@ jobs:
versionSpec: '${{ parameters.pythonVersion }}'
displayName: 'Use Python ${{ parameters.pythonVersion }}'

- task: Cache@2
inputs:
key: 'pip | "$(Agent.OS)" | "${{ parameters.pythonVersion }}"'
restoreKeys: |
pip | "$(Agent.OS)"
pip
path: $(PIP_CACHE_DIR)
displayName: Cache pip

- bash: |
set -e
git clone https://github.com/Qiskit/qiskit-tutorials --depth=1
python -m pip install --upgrade pip
pip install -U -r requirements.txt -r requirements-dev.txt -c constraints.txt
pip install -c constraints.txt -e .
pip install "qiskit-ibmq-provider" "qiskit-aer" "z3-solver" "qiskit-ignis" "matplotlib>=3.3.0" sphinx nbsphinx sphinx_rtd_theme cvxpy -c constraints.txt
pip install "qiskit-ibmq-provider" "qiskit-aer" "z3-solver" "networkx" "matplotlib>=3.3.0" sphinx nbsphinx sphinx_rtd_theme cvxpy -c constraints.txt
sudo apt-get update
sudo apt-get install -y graphviz pandoc
pip check
Expand Down
4 changes: 2 additions & 2 deletions .azure/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:

- name: pool
type: object

- name: env
type: object
default: {}
Expand All @@ -25,7 +25,7 @@ jobs:
- bash: |
set -e
python -m pip install --upgrade pip
pip install cibuildwheel==2.3.1
pip install cibuildwheel==2.11.2
pip install -U twine
cibuildwheel --output-dir wheelhouse .
Expand Down
5 changes: 3 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
* @Qiskit/terra-core

# Qiskit folders (also their corresponding tests)
algorithms/ @Qiskit/terra-core @manoelmarques @woodsp-ibm
algorithms/ @Qiskit/terra-core @manoelmarques @woodsp-ibm @ElePT
opflow/ @Qiskit/terra-core @manoelmarques @woodsp-ibm @ikkoham
qiskit/utils/ @Qiskit/terra-core @manoelmarques @woodsp-ibm
providers/ @Qiskit/terra-core @jyu00
quantum_info/ @Qiskit/terra-core @ikkoham
qpy/ @Qiskit/terra-core
pulse/ @Qiskit/terra-core @eggerdj @wshanks
pulse/ @Qiskit/terra-core @eggerdj @wshanks
synthesis/ @Qiskit/terra-core @alexanderivrii @ShellyGarion
scheduler/ @Qiskit/terra-core @eggerdj @wshanks
visualization/ @Qiskit/terra-core @nonhermitian
primitives/ @Qiskit/terra-core @ikkoham @t-imamichi
Expand Down
41 changes: 17 additions & 24 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,54 @@ jobs:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: default
components: llvm-tools-preview

- name: Install dependencies
run: |
pip install coveragepy-lcov
cargo install grcov
sudo apt-get install lcov
- name: Download grcov for rust coverage
run: curl -L https://github.com/mozilla/grcov/releases/download/v0.8.11/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar xj
- name: Build and install qiskit-terra
run: pip install -e .
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "qiskit-%p-%m.profraw"
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"

- name: Generate unittest coverage report
run: |
set -e
pip install -r requirements-dev.txt qiskit-aer
stestr run
./grcov . --binary-path ./target/debug/ -s . --llvm --parallel -t lcov --branch --ignore-not-existing --ignore "/*" -o ./rust_unittest.info
mkdir rust_lcov
mv ./rust_unittest.info rust_lcov/.
rm *profraw
# We set the --source-dir to '.' because we want all paths to appear relative to the repo
# root (we need to combine them with the Python ones), but we only care about `grcov`
# keeping the `src/*` files; we don't care about coverage in dependencies.
grcov . --binary-path target/debug/ --source-dir . --output-type lcov --output-path rust.info --llvm --branch --parallel --keep-only 'src/*'
env:
QISKIT_TEST_CAPTURE_STREAMS: 1
QISKIT_PARALLEL: FALSE
PYTHON: "coverage3 run --source qiskit --parallel-mode"
- name: Generate parallel_map test
run: |
set -e
coverage3 run --source qiskit --parallel-mode ./tools/verify_parallel_map.py
./grcov . --binary-path ./target/debug/ -s . --llvm --parallel -t lcov --branch --ignore-not-existing --ignore "/*" -o ./rust_parallel_map.info
mv rust_lcov/rust_unittest.info .
env:
QISKIT_TEST_CAPTURE_STREAMS: 1
QISKIT_PARALLEL: FALSE
PYTHON: "coverage3 run --source qiskit --parallel-mode"
PYTHON: "coverage run --source qiskit --parallel-mode"

- name: Convert to lcov and combine data
run: |
set -e
coverage3 combine
coveragepy-lcov --output_file_path python.info
lcov --add-tracefile python.info -a rust_unittest.info -a rust_parallel_map.info -o combined.info
lcov --remove combined.info "target/*" -o coveralls.info
coverage combine
coverage lcov -o python.info
lcov --add-tracefile python.info --add-tracefile rust.info --output-file coveralls.info
- name: Coveralls
uses: coverallsapp/github-action@master
with:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/slow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Slow nightly tests
on:
schedule:
- cron: '42 3 * * *'
workflow_dispatch:
jobs:
slow-tests:
name: Full-test-run-with-slow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -U -r requirements.txt -c constraints.txt
pip install -U -r requirements-dev.txt -c constraints.txt
pip install -c constraints.txt -e .
pip install "qiskit-aer" "z3-solver" "cplex" -c constraints.txt
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- name: Run all tests including slow
run: stestr run
env:
RUST_BACKTRACE: 1
QISKIT_TESTS: "run_slow"
- name: Create comment on failed test run
if: ${{ failure() }}
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: 7864
body: |
Nightly slow test run failed at commit ${{ github.sha }}.
_Logs_: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}.
6 changes: 3 additions & 3 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v2.3.1
uses: pypa/cibuildwheel@v2.11.2
env:
CIBW_ARCHS_LINUX: s390x
CIBW_TEST_SKIP: "cp*"
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v2.3.1
uses: pypa/cibuildwheel@v2.11.2
env:
CIBW_ARCHS_LINUX: ppc64le
CIBW_TEST_SKIP: "cp*"
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v2.3.1
uses: pypa/cibuildwheel@v2.11.2
env:
CIBW_ARCHS_LINUX: aarch64
- uses: actions/upload-artifact@v2
Expand Down
8 changes: 5 additions & 3 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ unsafe-load-any-extension=no
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-allow-list=retworkx, numpy, tweedledum, qiskit._accelerate

extension-pkg-allow-list=retworkx, numpy, tweedledum, qiskit._accelerate, rustworkx
generated-modules=retworkx.visualization,retwork.visit
ignore-modules=retworkx,retworkx.visualization,retworkx.visit

[MESSAGES CONTROL]

Expand Down Expand Up @@ -72,7 +73,8 @@ disable=spelling, # way too noisy
no-else-return, # relax "elif" after a clause with a return
docstring-first-line-empty, # relax docstring style
import-outside-toplevel,
bad-continuation, bad-whitespace # differences of opinion with black
bad-continuation, bad-whitespace, # differences of opinion with black
import-error # overzealous with our optionals/dynamic packages



Expand Down
Loading

0 comments on commit baf5a5d

Please sign in to comment.