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

🐛 fix deprecated Loader.load_module() #9078

Merged
merged 4 commits into from
Nov 10, 2022

Conversation

burgholzer
Copy link
Contributor

@burgholzer burgholzer commented Nov 5, 2022

Summary

This PR ports a fix from Qiskit/rustworkx#728 that fixes the following ImportWarning under Python>=3.10

ImportWarning: QiskitLoader.exec_module() not found; falling back to load_module()

Details and comments

Some further context can be found in the corresponding retworkx PR Qiskit/rustworkx#728.
The underlying code was introduced in #5089.

Fixes #8853.

@burgholzer burgholzer requested a review from a team as a code owner November 5, 2022 10:43
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Nov 5, 2022
@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:

  • @Qiskit/terra-core

jakelishman
jakelishman previously approved these changes Nov 5, 2022
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Thanks - I always forget the exact particulars of the import system, but this looks about right to me. I don't think there are any modules that are supposed to be "executed" (like programs) in Qiskit anyway.

@jakelishman jakelishman added stable backport potential The bug might be minimal and/or import enough to be port to stable automerge Changelog: None Do not include in changelog labels Nov 5, 2022
@coveralls
Copy link

coveralls commented Nov 5, 2022

Pull Request Test Coverage Report for Build 3437210643

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.0008%) to 84.568%

Totals Coverage Status
Change from base Build 3436589478: 0.0008%
Covered Lines: 62427
Relevant Lines: 73819

💛 - Coveralls

@burgholzer
Copy link
Contributor Author

Just saw that CI wasn't really happy. Added a corresponding docstring to please the linter.

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Ah, thanks - sorry, I'd also not noticed that the PR had got stuck. It's a bit of a silly lint rule for things like this, but elsewhere it does help ensure that all our public API gets at least some documentation.

@mergify mergify bot merged commit ee0b036 into Qiskit:main Nov 10, 2022
mergify bot pushed a commit that referenced this pull request Nov 10, 2022
* 🐛 fix deprecated `Loader.load_module()`

* 📝add docstring to please linter

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit ee0b036)
@jakelishman jakelishman added Changelog: Bugfix Include in the "Fixed" section of the changelog and removed Changelog: None Do not include in changelog labels Nov 10, 2022
levbishop pushed a commit that referenced this pull request Nov 11, 2022
* 🐛 fix deprecated `Loader.load_module()`

* 📝add docstring to please linter

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit ee0b036)
mergify bot added a commit that referenced this pull request Nov 11, 2022
* 🐛 fix deprecated `Loader.load_module()`

* 📝add docstring to please linter

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit ee0b036)

Co-authored-by: Lukas Burgholzer <lukas.burgholzer@jku.at>
Cryoris pushed a commit to Cryoris/qiskit-terra that referenced this pull request Jan 12, 2023
* 🐛 fix deprecated `Loader.load_module()`

* 📝add docstring to please linter

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

ImportWarning when grabbing a FakeBackend
4 participants