Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Fix pip environment resolution (#798)
Browse files Browse the repository at this point in the history
Calling `pip install` multiple times can (deeply unfortunately) allow an
environment to become out-of-sync; `pip` doesn't "remember" the
constraints of previous installation commands.

One of the largest effects here is that doing `pip install -e .`
_followed_ by `pip install git+<qiskit>@main` installs `qiskit-terra`
from the initial installation (via `qiskit==0.45.2`), then installs
`qiskit==1.0.0.dev0` from Git, which is an incompatible environment.
Doing the whole environment resolution in a single `pip install` command
fixes this, as the `qiskit` dependency is correctly resolved to be
_only_ the `1.0.0.dev0` version.

Co-authored-by: Kevin Tian <[email protected]>
  • Loading branch information
jakelishman and kt474 authored Jan 22, 2024
1 parent e237158 commit fc0c4ae
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c constraints.txt -e .
pip install -U -c constraints.txt -r requirements-dev.txt
pip install -c constraints.txt -r requirements-dev.txt -e .
- name: Run black
run: make style
- name: Run lint
Expand Down Expand Up @@ -91,8 +90,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c constraints.txt -e .
pip install -U -c constraints.txt -r requirements-dev.txt
pip install -c constraints.txt -r requirements-dev.txt -e .
- name: Run unit tests
run: make unit-test-coverage
- name: Report coverage to coveralls.io
Expand Down Expand Up @@ -134,8 +132,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r requirements-dev.txt
pip install -c constraints.txt -e . -r requirements-dev.txt
- name: Run integration tests 1
run: make integration-test-1
integration-tests-2:
Expand Down Expand Up @@ -170,8 +167,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r requirements-dev.txt
pip install -c constraints.txt -e . -r requirements-dev.txt
- name: Run integration tests 2
run: make integration-test-2
integration-tests-3:
Expand Down Expand Up @@ -206,8 +202,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r requirements-dev.txt
pip install -c constraints.txt -e . -r requirements-dev.txt
- name: Run integration tests 3
run: make integration-test-3
tests-finished:
Expand All @@ -220,4 +215,4 @@ jobs:
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
parallel-finished: true
5 changes: 2 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r requirements-dev.txt
pip install -c constraints.txt -e . -r requirements-dev.txt
- name: Run e2e tests
run: make e2e-test
run: make e2e-test
8 changes: 3 additions & 5 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r requirements-dev.txt
pip install -c constraints.txt -e . -r requirements-dev.txt
- name: Run integration tests 1
run: make integration-test-1
integration-tests-2:
Expand Down Expand Up @@ -81,8 +80,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r requirements-dev.txt
pip install -c constraints.txt -e . -r requirements-dev.txt
- name: Run integration tests 2
run: make integration-test-2
integration-tests-3:
Expand Down Expand Up @@ -118,4 +116,4 @@ jobs:
pip install -e .
pip install -r requirements-dev.txt
- name: Run integration tests 3
run: make integration-test-3
run: make integration-test-3
9 changes: 4 additions & 5 deletions .github/workflows/unit-tests-terra-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
jobs:
unit-tests-latest-qiskit-terra:
if: github.repository_owner == 'Qiskit'
name: Run unit tests with latest code of qiskit-terra
name: Run unit tests with latest code of Qiskit
runs-on: "ubuntu-latest"
env:
LOG_LEVEL: DEBUG
Expand All @@ -35,10 +35,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c constraints.txt -e .
pip install -U -c constraints.txt -r requirements-dev.txt
pip install -U git+https://github.com/Qiskit/qiskit-terra.git
# Install all in one go to force pip's resolver to avoid invalid states.
pip install -c constraints.txt -e . -r requirements-dev.txt git+https://github.com/Qiskit/qiskit.git
- name: Run tests
# running unit tests against latest (non-released) code of qiskit-terra gives a basic level
# of confidence that the integration between qiskit-ibm-provider and qiskit-terra works
run: make unit-test
run: make unit-test

0 comments on commit fc0c4ae

Please sign in to comment.