Skip to content

Deprecate old paths for module-availability testers#7954

Merged
mergify[bot] merged 2 commits into
Qiskit:mainfrom
jakelishman:deprecate/old-optional-paths
Apr 20, 2022
Merged

Deprecate old paths for module-availability testers#7954
mergify[bot] merged 2 commits into
Qiskit:mainfrom
jakelishman:deprecate/old-optional-paths

Conversation

@jakelishman
Copy link
Copy Markdown
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
Copy Markdown
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: Deprecated Add a "Deprecated" entry in the GitHub Release changelog. label Apr 19, 2022
@jakelishman jakelishman added this to the 0.21 milestone Apr 19, 2022
@coveralls
Copy link
Copy Markdown

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
Copy Markdown
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: Deprecated Add a "Deprecated" entry in the GitHub Release changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants