Skip to content

Commit

Permalink
Merge remote-tracking branch 'ibm/main' into fix-float-truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelishman committed Nov 18, 2022
2 parents 1ec448c + 4c5a755 commit 7deb927
Show file tree
Hide file tree
Showing 858 changed files with 49,484 additions and 10,398 deletions.
12 changes: 2 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 All @@ -39,6 +29,8 @@ jobs:
- bash: |
tox -edocs
displayName: 'Run Docs build'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- task: ArchiveFiles@2
inputs:
Expand Down
23 changes: 12 additions & 11 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 @@ -34,22 +24,33 @@ jobs:
pip install -U -r requirements.txt -r requirements-dev.txt -c constraints.txt
pip install -U -c constraints.txt -e .
pip install -U "qiskit-aer" -c constraints.txt
python setup.py build_ext --inplace
pip install -e .
displayName: 'Install dependencies'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- 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'
21 changes: 8 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 All @@ -71,6 +61,8 @@ jobs:
set -e
source test-job/bin/activate
pip install -U -r requirements.txt -r requirements-dev.txt -c constraints.txt
# Install setuptools-rust for building sdist
pip install -U -c constraints.txt setuptools-rust
python setup.py sdist
pip install -U -c constraints.txt dist/qiskit-terra*.tar.gz
displayName: "Install Terra from sdist"
Expand All @@ -82,14 +74,15 @@ jobs:
pip install -U -r requirements.txt -r requirements-dev.txt -c constraints.txt
pip install -U -c constraints.txt -e .
displayName: "Install Terra directly"
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- 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 @@ -104,10 +97,10 @@ 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
RUST_BACKTRACE: 1
displayName: 'Run tests'
- bash: |
Expand Down Expand Up @@ -165,6 +158,8 @@ jobs:
sudo apt-get install -y graphviz pandoc
image_tests/bin/pip check
displayName: 'Install dependencies'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- bash: image_tests/bin/python -m unittest discover -v test/ipynb
displayName: 'Run image test'
17 changes: 4 additions & 13 deletions .azure/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parameters:
jobs:
- job: "MacOS_Tests_Python${{ replace(parameters.pythonVersion, '.', '') }}"
displayName: "Test macOS Python ${{ parameters.pythonVersion }}"
pool: {vmImage: 'macOS-10.15'}
pool: {vmImage: 'macOS-11'}

variables:
QISKIT_SUPPRESS_PACKAGING_WARNINGS: Y
Expand All @@ -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 All @@ -46,19 +36,20 @@ jobs:
source test-job/bin/activate
pip install -U -r requirements.txt -r requirements-dev.txt -c constraints.txt
pip install -U -c constraints.txt -e .
python setup.py build_ext --inplace
pip check
displayName: 'Install dependencies'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- bash: |
set -e
source test-job/bin/activate
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
displayName: "Run tests"
- bash: |
Expand Down
5 changes: 3 additions & 2 deletions .azure/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ jobs:
pip install -r requirements.txt -r requirements-dev.txt -c constraints.txt
pip install -c constraints.txt -e .
pip install "z3-solver" -c constraints.txt
python setup.py build_ext --inplace
pip check
displayName: 'Install dependencies'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- bash: |
set -e
Expand All @@ -47,11 +48,11 @@ 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'
QISKIT_PARALLEL: FALSE
RUST_BACKTRACE: 1
displayName: 'Run tests'
- bash: |
Expand Down
14 changes: 3 additions & 11 deletions .azure/tutorials-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,19 @@ 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
python setup.py build_ext --inplace
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
displayName: 'Install dependencies'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- bash: |
set -e
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
9 changes: 5 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ 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 @nkanazawa1989
pulse/ @Qiskit/terra-core @eggerdj @nkanazawa1989 @danpuzzuoli
scheduler/ @Qiskit/terra-core @eggerdj @nkanazawa1989 @danpuzzuoli
visualization/ @Qiskit/terra-core @nonhermitian @nkanazawa1989
qpy/ @Qiskit/terra-core
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
# Override the release notes directories to have _no_ code owners, so any review
# from somebody with write access is acceptable.
Expand Down
42 changes: 37 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,44 @@ jobs:
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 tox coveragepy-lcov
- name: Run coverage report
run: tox -ecoverage
- name: Convert to lcov
run: coveragepy-lcov --output_file_path coveralls.info
run: |
pip install coveragepy-lcov
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
rm *profraw
env:
QISKIT_TEST_CAPTURE_STREAMS: 1
QISKIT_PARALLEL: FALSE
PYTHON: "coverage3 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 -o combined.info
lcov --remove combined.info "target/*" -o coveralls.info
- name: Coveralls
uses: coverallsapp/github-action@master
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/randomized_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ jobs:
pip install -c constraints.txt -e .
pip install "qiskit-ibmq-provider" -c constraints.txt
pip install "qiskit-aer"
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- name: Run randomized tests
run: make test_randomized
env:
RUST_BACKTRACE: 1
- name: Create comment on failed test run
if: ${{ failure() }}
uses: peter-evans/create-or-update-comment@v1
Expand Down
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
2 changes: 1 addition & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ pull_request_rules:
actions:
backport:
branches:
- stable/0.21
- stable/0.22
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 7deb927

Please sign in to comment.