Skip to content

Commit

Permalink
Ensure up-to-date pip, setuptools and wheel in CI (Qiskit#9850)
Browse files Browse the repository at this point in the history
Up-to-date Python packages should not require this step, however there
are several packages, especially those that are optional for Terra
functionality, that do not yet contain `pyproject.toml` files when
building them from source.  In these cases, `pip` will begin erroring
out from version 23.1 if `wheel` is not installed.

This commit proactively ensures that the minimum build dependencies for
legacy Python packages is prepared and up-to-date before attempting
installations; this includes ensuring that these are updated _inside_
any created venvs as well as outside them.
  • Loading branch information
jakelishman authored Mar 27, 2023
1 parent 03473bd commit abfb53e
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .azure/lint-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
python -m pip install --upgrade pip setuptools wheel virtualenv
virtualenv test-job
source test-job/bin/activate
pip install -U pip setuptools wheel
pip install -U \
-c constraints.txt \
-r requirements.txt \
Expand Down
1 change: 1 addition & 0 deletions .azure/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ 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 pip setuptools wheel
# Install setuptools-rust for building sdist
pip install -U -c constraints.txt setuptools-rust
python setup.py sdist
Expand Down
1 change: 1 addition & 0 deletions .azure/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
python -m pip install --upgrade pip setuptools wheel virtualenv
virtualenv test-job
source test-job/bin/activate
pip install -U pip setuptools wheel
pip install -U \
-c constraints.txt \
-r requirements.txt \
Expand Down
1 change: 1 addition & 0 deletions .azure/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
python -m pip install --upgrade pip setuptools wheel virtualenv
virtualenv test-job
source test-job/Scripts/activate
pip install -U pip setuptools wheel
pip install -U \
-c constraints.txt \
-r requirements.txt \
Expand Down
2 changes: 1 addition & 1 deletion .azure/tutorials-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- bash: |
set -e
git clone https://github.com/Qiskit/qiskit-tutorials --depth=1
python -m pip install --upgrade pip
python -m pip install --upgrade pip setuptools wheel
pip install -U \
-c constraints.txt \
-r requirements.txt \
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ jobs:
cargo install grcov
sudo apt-get install lcov
# This is needed to support any requirements, particularly in the `optionals` set,
# that might not have 'pyproject.toml' files specifying their build requirements.
# Modern pip (23.1+) can error out if it doesn't have `wheel` and we ask for one
# of these legacy packages.
- name: Ensure basic build requirements
run: pip install --upgrade pip setuptools wheel

- name: Build and install qiskit-terra
run: pip install -e .
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/randomized_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
python-version: '3.8'
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -U -r requirements.txt -c constraints.txt
pip install -U -r requirements-dev.txt coveralls -c constraints.txt
pip install -c constraints.txt -e .
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/slow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
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 .
Expand Down

0 comments on commit abfb53e

Please sign in to comment.