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

Deprecate old paths for module-availability testers #7954

Merged
merged 2 commits into from
Apr 20, 2022

Conversation

jakelishman
Copy link
Member

Summary

The canonical location for all of these is qiskit.utils.optionals,
along with all the other import testers. Historically these objects
were available from qiskit.visualization just because they were reused
in several places within that module, and now a few downstream packages
have begun importing from there. The alternate path was made available
in Terra 0.20.

Details and comments

Follow-on from #7525. Uses the Python 3.7+ module-level __getattr__ to make Matt happy!

The canonical location for all of these is `qiskit.utils.optionals`,
along with all the other import testers.  Historically these objects
were available from `qiskit.visualization` just because they were reused
in several places within that module, and now a few downstream packages
have begun importing from there.  The alternate path was made available
in Terra 0.20.
@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:

@jakelishman jakelishman added the Changelog: Deprecation Include in "Deprecated" section of changelog label Apr 19, 2022
@jakelishman jakelishman added this to the 0.21 milestone Apr 19, 2022
@coveralls
Copy link

coveralls commented Apr 19, 2022

Pull Request Test Coverage Report for Build 2198457317

  • 5 of 8 (62.5%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 84.238%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/visualization/init.py 5 8 62.5%
Totals Coverage Status
Change from base Build 2196260958: 0.002%
Covered Lines: 54000
Relevant Lines: 64104

💛 - 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.

LGTM, glad to see a module level __getattr__ finally being used.

@mergify mergify bot merged commit dde6126 into Qiskit:main Apr 20, 2022
@jakelishman jakelishman deleted the deprecate/old-optional-paths branch August 19, 2022 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Deprecation Include in "Deprecated" section of changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants