Skip to content

Commit

Permalink
Pin dependency versions when installing historical versions
Browse files Browse the repository at this point in the history
Now that we're running Python 3.9 as the base version we are
encountering compatibility issues with some of our dependencies because
3.9 supports newer versions of things like numpy than older Qiskit
releases were compatible with. The only way to work around this is to
pin the versions when installing historical versions. To start this sets
a single constraints version since we can get away with using the same
version for everything. In the future though it is possible that we'll
need separate files for different historical releases.
  • Loading branch information
mtreinish committed Sep 6, 2024
1 parent 3eef5ab commit 31418ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/qpy_compat/process_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ if [[ ! -d qpy_$version ]] ; then
echo "Building venv for qiskit-terra $version"
python -m venv $version
if [[ ${parts[0]} -eq 0 ]] ; then
./$version/bin/pip install "qiskit-terra==$version"
./$version/bin/pip install -c qpy_test_constraints.txt "qiskit-terra==$version"
else
./$version/bin/pip install "qiskit==$version"
./$version/bin/pip install -c qpy_test_constraints.txt "qiskit==$version"
fi
mkdir qpy_$version
pushd qpy_$version
Expand Down
2 changes: 2 additions & 0 deletions test/qpy_compat/qpy_test_constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
numpy===1.24.4
scipy===1.10.1
2 changes: 1 addition & 1 deletion test/qpy_compat/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export PYTHONHASHSEED=$(python -S -c "import random; print(random.randint(1, 429
echo "PYTHONHASHSEED=$PYTHONHASHSEED"

python -m venv qiskit_venv
qiskit_venv/bin/pip install ../..
qiskit_venv/bin/pip install -c ../../constraints.txt ../..

parallel bash ./process_version.sh ::: `git tag --sort=-creatordate`

Expand Down

0 comments on commit 31418ae

Please sign in to comment.