-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude non-rc pre-releases from qpy backwards compat tests #11572
Conversation
The QPY backwards compatibility tests are setup to verify that we can load qpy files generated with historical releases using the current version of Qiskit under development. This ensures we're meeting our backwards compatibility guarantees with QPY. However, the tests were over eagerly running on pre-releases that don't have any stability guarantees, mainly alpha and beta releases indicated by "a" and "b" suffixes respectively in the version number. This commit excludes these pre-release versions from the tests as it's not valid to run with these. Release candidate pre-releases should still be run because they have stable APIs and they're not skipped by this PR.
One or more of the the following people are requested to review this:
|
# Exclude any non-rc pre-releases as they don't have stable API guarantees | ||
if [[ $version == *"b"* || $version == *"a"* ]] ; then | ||
exit 0 | ||
fi | ||
|
||
# If the source version is newer than the version under test exit fast because | ||
# there is no QPY compatibility for loading a qpy file generated from a newer | ||
# release with an older release of Qiskit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just below these lines we call out to a Python script compare_versions.py
, which makes a general comparison. Maybe we ought to move the logic to there, and handle proper version normalisation in Python with packaging.version
? We intend to only use the canonical forms of versions, but the logic's all going to be easier to verify if it's in Python space with typed objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can move it to python space, but compare_versions.py
isn't actually using packaging.version
(to avoid needing to check the dependency) it's just using the regex to match the version parts. So I'd probably just basically be doing 'a' in match.group('pre') or 'b' in match.group('pre')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, fair enough, in that case let's just leave it in bash.
Pull Request Test Coverage Report for Build 7542647377
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's working correctly:
+ version=1.0.0b1
+ parts=(${version//./ })
++ ./qiskit_venv/bin/python -c 'import qiskit;print(qiskit.__version__)'
+ qiskit_version=1.0.0
+ qiskit_parts=(${qiskit_version//./ })
+ [[ 1 -eq 0 ]]
+ [[ 1.0.0b1 == *\b* ]]
+ exit 0
The QPY backwards compatibility tests are setup to verify that we can load qpy files generated with historical releases using the current version of Qiskit under development. This ensures we're meeting our backwards compatibility guarantees with QPY. However, the tests were over eagerly running on pre-releases that don't have any stability guarantees, mainly alpha and beta releases indicated by "a" and "b" suffixes respectively in the version number. This commit excludes these pre-release versions from the tests as it's not valid to run with these. Release candidate pre-releases should still be run because they have stable APIs and they're not skipped by this PR. (cherry picked from commit abb803f)
…11574) The QPY backwards compatibility tests are setup to verify that we can load qpy files generated with historical releases using the current version of Qiskit under development. This ensures we're meeting our backwards compatibility guarantees with QPY. However, the tests were over eagerly running on pre-releases that don't have any stability guarantees, mainly alpha and beta releases indicated by "a" and "b" suffixes respectively in the version number. This commit excludes these pre-release versions from the tests as it's not valid to run with these. Release candidate pre-releases should still be run because they have stable APIs and they're not skipped by this PR. (cherry picked from commit abb803f) Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Summary
The QPY backwards compatibility tests are setup to verify that we can load qpy files generated with historical releases using the current version of Qiskit under development. This ensures we're meeting our backwards compatibility guarantees with QPY. However, the tests were over eagerly running on pre-releases that don't have any stability guarantees, mainly alpha and beta releases indicated by "a" and "b" suffixes respectively in the version number. This commit excludes these pre-release versions from the tests as it's not valid to run with these. Release candidate pre-releases should still be run because they have stable APIs and they're not skipped by this PR.
Details and comments