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

Bump PyO3 and rust-numpy to latest release #8612

Merged
merged 3 commits into from
Oct 18, 2022
Merged

Conversation

mtreinish
Copy link
Member

Summary

PyO3 and rust-numpy just released version 0.17.0 respectively (and both
are linked). This commit bumps the version used of both libraries to the
latest release. For the changelogs see:

Details and comments

https://github.com/PyO3/pyo3/releases/tag/v0.17.0

and

https://github.com/PyO3/rust-numpy/releases/tag/v0.17.0

@mtreinish mtreinish added Changelog: None Do not include in changelog Rust This PR or issue is related to Rust code in the repository dependencies Pull requests that update a dependency file labels Aug 24, 2022
@mtreinish mtreinish requested a review from a team as a code owner August 24, 2022 17:50
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

@mtreinish
Copy link
Member Author

mtreinish commented Aug 24, 2022

Looks like the conversion behavior changed in pyo3 0.17.0:

test.python.result.test_counts.TestCounts.test_marginal_distribution_numpy_indices
----------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/tmp/terra-tests/test/python/result/test_counts.py", line 60, in test_marginal_distribution_numpy_indices
    result = utils.marginal_distribution(counts_obj, indices)

      File "/home/vsts/work/1/s/qiskit/result/utils.py", line 231, in marginal_distribution
    res = results_rs.marginal_counts(counts, indices)

    TypeError: argument 'indices': 'ndarray' object cannot be converted to 'Sequence'

looking at the migration guide I expect this is caused by the addition of the isinstance call on conversion: https://github.com/PyO3/pyo3/blob/v0.17.0/guide/src/migration.md#type-checks-have-been-changed-for-pymapping-and-pysequence-types as numpy arrays don't subclass Sequence and I don't think most C extension sequence types will either which will cause a problem. I'll report this upstream someone else beat me to it: PyO3/pyo3#2615

@mtreinish mtreinish added the on hold Can not fix yet label Aug 24, 2022
PyO3 and rust-numpy just released version 0.17.0 respectively (and both
are linked). This commit bumps the version used of both libraries to the
latest release. For the changelogs see:

https://github.com/PyO3/pyo3/releases/tag/v0.17.0

and

https://github.com/PyO3/rust-numpy/releases/tag/v0.17.0
@mtreinish mtreinish removed the on hold Can not fix yet label Oct 4, 2022
@mtreinish mtreinish added this to the 0.23.0 milestone Oct 4, 2022
@mtreinish
Copy link
Member Author

I've marked this as for 0.23.0 although I don't think there is actually a blocker for including it as part of 0.22.0. However, since the 0.22.0.rc1 is pending I say we merge this after main switches over to 0.23.0 and if we're happy with how it works on main we can consider backporting it to stable/0.22 for inclusion in the final 0.22.0 release. I'm mildly concerned there might be some performance overhead with the new version of PyO3.

@mtreinish mtreinish added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Oct 4, 2022
@coveralls
Copy link

coveralls commented Oct 4, 2022

Pull Request Test Coverage Report for Build 3274503710

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.003%) to 84.755%

Files with Coverage Reduction New Missed Lines %
qiskit/extensions/quantum_initializer/squ.py 2 79.78%
Totals Coverage Status
Change from base Build 3270304783: -0.003%
Covered Lines: 61931
Relevant Lines: 73071

💛 - Coveralls

@mtreinish mtreinish removed the stable backport potential The bug might be minimal and/or import enough to be port to stable label Oct 13, 2022
Copy link
Contributor

@kevinhartman kevinhartman left a comment

Choose a reason for hiding this comment

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

LGTM!

@mergify mergify bot merged commit 9674afd into Qiskit:main Oct 18, 2022
@mtreinish mtreinish deleted the new-pyo3 branch October 18, 2022 17:04
@mtreinish mtreinish added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Nov 2, 2022
mergify bot pushed a commit that referenced this pull request Nov 2, 2022
* Bump PyO3 and rust-numpy to latest release

PyO3 and rust-numpy just released version 0.17.0 respectively (and both
are linked). This commit bumps the version used of both libraries to the
latest release. For the changelogs see:

https://github.com/PyO3/pyo3/releases/tag/v0.17.0

and

https://github.com/PyO3/rust-numpy/releases/tag/v0.17.0

* Update Cargo.toml

(cherry picked from commit 9674afd)
mergify bot added a commit that referenced this pull request Nov 2, 2022
* Bump PyO3 and rust-numpy to latest release

PyO3 and rust-numpy just released version 0.17.0 respectively (and both
are linked). This commit bumps the version used of both libraries to the
latest release. For the changelogs see:

https://github.com/PyO3/pyo3/releases/tag/v0.17.0

and

https://github.com/PyO3/rust-numpy/releases/tag/v0.17.0

* Update Cargo.toml

(cherry picked from commit 9674afd)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
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 dependencies Pull requests that update a dependency file Rust This PR or issue is related to Rust code in the repository stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants