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

Upgrade PyO3 and numpy to 0.16.2 #569

Merged
merged 7 commits into from
Mar 25, 2022

Conversation

mtreinish
Copy link
Member

This commit updates pyo3 and numpy to the latest release 0.16.0. The
details on these releases can be found here:

https://pyo3.rs/v0.16.0/changelog.html

and

https://github.com/PyO3/rust-numpy/blob/main/CHANGELOG.md

Unfortunately there are a number of breaking changes and deprecations we
will have to update our usage to account for. This commit starts the
process by fixing the compiler errors due to changes in behavior a
subsequent commit will address the deprecation warnings.

This commit updates pyo3 and numpy to the latest release 0.16.0. The
details on these releases can be found here:

https://pyo3.rs/v0.16.0/changelog.html

and

https://github.com/PyO3/rust-numpy/blob/main/CHANGELOG.md

Unfortunately there are a number of breaking changes and deprecations we
will have to update our usage to account for. This commit starts the
process by fixing the compiler errors due to changes in behavior a
subsequent commit will address the deprecation warnings.
@IvanIsCoding
Copy link
Collaborator

IvanIsCoding commented Mar 4, 2022

Deprecate the #[pyproto] traits. (https://github.com/PyO3/pyo3/pull/2173)

I think that will be the most amount of work from moving to PyO3 0.16 as most of our custom return types use #[pyproto]. The removal is only going to happen around the PyO3 0.18 release, but it would good to move from #[pyproto] to #[pymethod] before that.

@mtreinish
Copy link
Member Author

Yeah, that's what my next step was to tackle all of those pyproto deprecation warnings. They will fail the clippy run in ci without fixing all the deprecation warnings (it's why I tagged it on hold). But I wanted to push up what I had after tracking down all the private pyfunctions.

@IvanIsCoding
Copy link
Collaborator

Yeah, that's what my next step was to tackle all of those pyproto deprecation warnings. They will fail the clippy run in ci without fixing all the deprecation warnings (it's why I tagged it on hold). But I wanted to push up what I had after tracking down all the private pyfunctions.

We can temporarily use #![allow(deprecated)] (along the lines of PyO3/pyo3#2173) and open a separate issue to migrate away from #[pyproto]

@georgios-ts
Copy link
Collaborator

I just pushed 58ab94e to fix pyproto deprecation warnings. For the most part the changes were straightforward. I just had to redefine our own version of the deprecated pyo3::gc::PyGCProtocol since it's the most convenient way to adjust the behavior of each class regarding garbage collection.

@coveralls
Copy link

coveralls commented Mar 7, 2022

Pull Request Test Coverage Report for Build 2041335979

  • 136 of 155 (87.74%) changed or added relevant lines in 19 files are covered.
  • 5 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.1%) to 98.411%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/iterators.rs 58 77 75.32%
Files with Coverage Reduction New Missed Lines %
src/generators.rs 1 98.52%
src/isomorphism/vf2.rs 2 96.24%
src/iterators.rs 2 93.15%
Totals Coverage Status
Change from base Build 1912407011: -0.1%
Covered Lines: 10959
Relevant Lines: 11136

💛 - Coveralls

@mtreinish mtreinish removed the on hold label Mar 7, 2022
@mtreinish mtreinish changed the title Upgrade PyO3 and numpy to 0.16.0 Upgrade PyO3 and numpy to 0.16.2 Mar 25, 2022
@mtreinish mtreinish merged commit 71e34d1 into Qiskit:main Mar 25, 2022
@mtreinish mtreinish deleted the bump-pyo3-and-numpy branch March 25, 2022 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants