Skip to content
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

Skip uninstallable tags in QPY backwards compatibility tests #13202

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

jakelishman
Copy link
Member

Summary

When a tag has been made, but the package has not yet landed on PyPI, the QPY job fails in the environment-building step. This is not actually a failure of the QPY backwards-compatibility guarantees, and it isn't the job of the QPY tests to detect a bad tag anyway.

Details and comments

Since this commit is an acknowledgement that not every tag might be a valid version, and my editor was complaining about the safety of the various script calls, I made the variable expansion safe against word splitting, just in case.

When a tag has been made, but the package has not yet landed on PyPI,
the QPY job fails in the environment-building step.  This is not
actually a failure of the QPY backwards-compatibility guarantees, and
it isn't the job of the QPY tests to detect a bad tag anyway.
@jakelishman jakelishman added type: qa Issues and PRs that relate to testing and code quality stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: None Do not include in changelog labels Sep 20, 2024
@jakelishman jakelishman requested a review from a team as a code owner September 20, 2024 15:58
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core
  • @mtreinish
  • @nkanazawa1989

@coveralls
Copy link

coveralls commented Sep 20, 2024

Pull Request Test Coverage Report for Build 11013854521

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 34 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.04%) to 88.758%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
qiskit/transpiler/passes/synthesis/unitary_synthesis.py 2 88.26%
crates/qasm2/src/lex.rs 6 92.23%
qiskit/synthesis/two_qubit/xx_decompose/decomposer.py 7 90.91%
crates/qasm2/src/parse.rs 18 96.23%
Totals Coverage Status
Change from base Build 10966478124: -0.04%
Covered Lines: 73460
Relevant Lines: 82764

💛 - Coveralls

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit concerned about incorrectly skipping something we shouldn't and that masking our coverage for a version. I feel like we need to be a bit more intentional about when we're skipping as it should only be if we have yet to upload the package to pypi not for any other installation failure. The other changes here look fine to me though.

test/qpy_compat/process_version.sh Outdated Show resolved Hide resolved
@jakelishman jakelishman added the on hold Can not fix yet label Sep 23, 2024
@jakelishman jakelishman force-pushed the skip-uninstallable-qpy branch 3 times, most recently from fe4de79 to ca25cb1 Compare September 23, 2024 19:14
The logic we actually want for versions to test is "find the versions
that _should_ be installable", rather than "try it and see"; the latter
is susceptible to silently suppressing errors.  This new form now
queries PyPI to find what versions of Qiskit are available in binary
distributions for this platform, and filters based on that.
Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks fine to me. I personally find the new variable naming for the venvs and python in the bash scripts a bit harder to parse, but that's probably just how I think about working with this things is a bit more explicit in file paths. I only left one inline question about a change in behavior around rc releases. I'm fine if that's the direction you want to move here, but since it is a change I wanted to make sure it was intentional.

test/qpy_compat/get_versions.py Outdated Show resolved Hide resolved


def main():
"""main"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah, I like this docstring

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

passive aggressive suppression of the pylint warning haha

@jakelishman
Copy link
Member Author

For the bash scripts venv renaming: the main problem for me locally was that they were all making a lot of strong assumptions about the working directory they were executed from, and one of them was making assumptions about the existence of a Python venv at a particular relative path, which meant I had to keep recreating the entire CI setup in order to test a single script. I generally agree the changes make it not as pleasant to read, but they decouple the scripts from particular working directories, and let me pass more information explicitly into each script, so it was easier to run things locally.

@jakelishman
Copy link
Member Author

@Mergifyio backport stable/1.2 stable/0.46

Copy link
Contributor

mergify bot commented Sep 24, 2024

backport stable/1.2 stable/0.46

✅ Backports have been created

@mtreinish mtreinish added this pull request to the merge queue Sep 24, 2024
Merged via the queue into Qiskit:main with commit 1344cdd Sep 24, 2024
15 checks passed
mergify bot pushed a commit that referenced this pull request Sep 24, 2024
* Skip uninstallable tags in QPY backwards compatibility tests

When a tag has been made, but the package has not yet landed on PyPI,
the QPY job fails in the environment-building step.  This is not
actually a failure of the QPY backwards-compatibility guarantees, and
it isn't the job of the QPY tests to detect a bad tag anyway.

* Query PyPI to find versions to test

The logic we actually want for versions to test is "find the versions
that _should_ be installable", rather than "try it and see"; the latter
is susceptible to silently suppressing errors.  This new form now
queries PyPI to find what versions of Qiskit are available in binary
distributions for this platform, and filters based on that.

* Include release candidates in testing

(cherry picked from commit 1344cdd)

# Conflicts:
#	test/qpy_compat/process_version.sh
#	test/qpy_compat/run_tests.sh
mergify bot pushed a commit that referenced this pull request Sep 24, 2024
* Skip uninstallable tags in QPY backwards compatibility tests

When a tag has been made, but the package has not yet landed on PyPI,
the QPY job fails in the environment-building step.  This is not
actually a failure of the QPY backwards-compatibility guarantees, and
it isn't the job of the QPY tests to detect a bad tag anyway.

* Query PyPI to find versions to test

The logic we actually want for versions to test is "find the versions
that _should_ be installable", rather than "try it and see"; the latter
is susceptible to silently suppressing errors.  This new form now
queries PyPI to find what versions of Qiskit are available in binary
distributions for this platform, and filters based on that.

* Include release candidates in testing

(cherry picked from commit 1344cdd)

# Conflicts:
#	test/qpy_compat/process_version.sh
#	test/qpy_compat/run_tests.sh
@jakelishman jakelishman deleted the skip-uninstallable-qpy branch September 24, 2024 14:47
eliarbel pushed a commit to eliarbel/qiskit that referenced this pull request Sep 24, 2024
…skit#13202)

* Skip uninstallable tags in QPY backwards compatibility tests

When a tag has been made, but the package has not yet landed on PyPI,
the QPY job fails in the environment-building step.  This is not
actually a failure of the QPY backwards-compatibility guarantees, and
it isn't the job of the QPY tests to detect a bad tag anyway.

* Query PyPI to find versions to test

The logic we actually want for versions to test is "find the versions
that _should_ be installable", rather than "try it and see"; the latter
is susceptible to silently suppressing errors.  This new form now
queries PyPI to find what versions of Qiskit are available in binary
distributions for this platform, and filters based on that.

* Include release candidates in testing

(cherry picked from commit 1344cdd)
github-merge-queue bot pushed a commit that referenced this pull request Sep 25, 2024
…#13202) (#13217)

* Skip uninstallable tags in QPY backwards compatibility tests (#13202)

* Skip uninstallable tags in QPY backwards compatibility tests

When a tag has been made, but the package has not yet landed on PyPI,
the QPY job fails in the environment-building step.  This is not
actually a failure of the QPY backwards-compatibility guarantees, and
it isn't the job of the QPY tests to detect a bad tag anyway.

* Query PyPI to find versions to test

The logic we actually want for versions to test is "find the versions
that _should_ be installable", rather than "try it and see"; the latter
is susceptible to silently suppressing errors.  This new form now
queries PyPI to find what versions of Qiskit are available in binary
distributions for this platform, and filters based on that.

* Include release candidates in testing

(cherry picked from commit 1344cdd)

# Conflicts:
#	test/qpy_compat/process_version.sh
#	test/qpy_compat/run_tests.sh

* Resolve conflicts

* Add qpy_teest_constraints.txt

---------

Co-authored-by: Jake Lishman <[email protected]>
Co-authored-by: Eli Arbel <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Sep 25, 2024
…#13202) (#13216)

* Skip uninstallable tags in QPY backwards compatibility tests (#13202)

* Skip uninstallable tags in QPY backwards compatibility tests

When a tag has been made, but the package has not yet landed on PyPI,
the QPY job fails in the environment-building step.  This is not
actually a failure of the QPY backwards-compatibility guarantees, and
it isn't the job of the QPY tests to detect a bad tag anyway.

* Query PyPI to find versions to test

The logic we actually want for versions to test is "find the versions
that _should_ be installable", rather than "try it and see"; the latter
is susceptible to silently suppressing errors.  This new form now
queries PyPI to find what versions of Qiskit are available in binary
distributions for this platform, and filters based on that.

* Include release candidates in testing

(cherry picked from commit 1344cdd)

# Conflicts:
#	test/qpy_compat/process_version.sh
#	test/qpy_compat/run_tests.sh

* Resolve conflicts and add qpy_test_constraints.txt

---------

Co-authored-by: Jake Lishman <[email protected]>
Co-authored-by: Eli Arbel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog stable backport potential The bug might be minimal and/or import enough to be port to stable type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants