Skip to content

Commit

Permalink
Consolidate pip install calls in CI (#9757)
Browse files Browse the repository at this point in the history
* Remove unnecessary `pip install` in CI

* Consolidate `pip install` calls in CI

* Add back `-U`

* Go back to editable install so Rust is in debug mode

* Add RUST_DEBUG env var so we can avoid editable install

* Remove SETUPTOOLS_ENABLE_FEATURES and also Aer from lint job

* See if editable install fixes Pylint

* Give up on not using editable installs in CI

I don't know why they're causing issues with loading the Rust extension. But it's not a priority
to figure that out. This PR is still some forward progress.
  • Loading branch information
Eric-Arellano authored Mar 17, 2023
1 parent 2afcebc commit e2f6606
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 19 deletions.
9 changes: 5 additions & 4 deletions .azure/lint-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ jobs:
python -m pip install --upgrade pip setuptools wheel virtualenv
virtualenv test-job
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 .
pip install -U "qiskit-aer" -c constraints.txt
pip install -e .
pip install -U \
-c constraints.txt \
-r requirements.txt \
-r requirements-dev.txt \
-e .
displayName: 'Install dependencies'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
Expand Down
26 changes: 19 additions & 7 deletions .azure/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,37 @@ jobs:
# Use stable Rust, rather than MSRV, to spot-check that stable builds properly.
rustup override set stable
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
pip install -U \
-c constraints.txt \
-r requirements.txt \
-r requirements-dev.txt \
dist/qiskit-terra*.tar.gz
displayName: "Install Terra from sdist"
- ${{ if eq(parameters.installFromSdist, false) }}:
- bash: |
set -e
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 .
pip install -U \
-c constraints.txt \
-r requirements.txt \
-r requirements-dev.txt \
-e .
displayName: "Install Terra directly"
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- bash: |
set -e
source test-job/bin/activate
pip install -U "cplex;python_version < '3.11'" "qiskit-aer" "z3-solver" -c constraints.txt
pip install -U \
-c constraints.txt \
"cplex;python_version < '3.11'" \
"qiskit-aer" \
"z3-solver"
mkdir -p /tmp/terra-tests
cp -r test /tmp/terra-tests/.
cp .stestr.conf /tmp/terra-tests/.
Expand Down Expand Up @@ -162,8 +172,10 @@ jobs:
- bash: |
set -e
virtualenv image_tests
image_tests/bin/pip install -U -r requirements.txt -c constraints.txt
image_tests/bin/pip install -U -c constraints.txt -e ".[visualization]"
image_tests/bin/pip install -U \
-c constraints.txt \
-r requirements.txt \
-e ".[visualization]"
sudo apt-get update
sudo apt-get install -y graphviz pandoc
image_tests/bin/pip check
Expand Down
7 changes: 5 additions & 2 deletions .azure/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ jobs:
python -m pip install --upgrade pip setuptools wheel virtualenv
virtualenv test-job
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 .
pip install -U \
-c constraints.txt \
-r requirements.txt \
-r requirements-dev.txt \
-e .
pip check
displayName: 'Install dependencies'
env:
Expand Down
9 changes: 6 additions & 3 deletions .azure/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ jobs:
python -m pip install --upgrade pip setuptools wheel virtualenv
virtualenv test-job
source test-job/Scripts/activate
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
pip install -U \
-c constraints.txt \
-r requirements.txt \
-r requirements-dev.txt \
"z3-solver" \
-e .
pip check
displayName: 'Install dependencies'
env:
Expand Down
17 changes: 14 additions & 3 deletions .azure/tutorials-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,20 @@ jobs:
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" "networkx" "matplotlib>=3.3.0" sphinx nbsphinx sphinx_rtd_theme cvxpy -c constraints.txt
pip install -U \
-c constraints.txt \
-r requirements.txt \
-r requirements-dev.txt \
"qiskit-ibmq-provider" \
"qiskit-aer" \
"z3-solver" \
"networkx" \
"matplotlib>=3.3.0" \
sphinx \
nbsphinx \
sphinx_rtd_theme \
cvxpy \
-e .
sudo apt-get update
sudo apt-get install -y graphviz pandoc
pip check
Expand Down

0 comments on commit e2f6606

Please sign in to comment.