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

[Do Not Merge] Namespace no more v3 #1587

Closed
wants to merge 18 commits into from

Conversation

hhorii
Copy link
Collaborator

@hhorii hhorii commented Aug 29, 2022

Summary

This PR is just for debugging CI errors in #1526.

Details and comments

mtreinish added 13 commits July 26, 2022 10:52
Namespace packages are constant source of problems for users. The python
packaging ecosystem around splitting packages across namespaces is
fragile at the best of times and can often leave a you with an
environment that isn't recoverable (especially when mixing install
methods). There is also a performance hit whenever there is a piece of
the namespace we allow external packages to extend since it requires
doing a full python path search which can be slow depending on the
backing I/O and the number of paths in sys.path for an environment. This
commit addresses the piece from the aer perspective by moving
qiskit.providers.aer to it's own package and namespace 'qiskit_aer'.

This is coupled with a custom namespace module that implements a
custom import loader at the root of the namespace. This has 2 advantages
it removes the use of namespace packages so the fragility and
performance impact are fixed since every element will be renamed to use
'qiskit_' instead of 'qiskit.' (aer being the only one remaining).

This is the second attempt at doing this namespace rename, the first
failed attempt in Qiskit#840 was trying to migrate all the former qiskit
elements at the same time and was too difficult to migrate everything at
once without causing breaking api changes. This commit is mechanically
the same (renaming qiskit.providers.aer -> qiskit_aer), but how it
integrates with qiskit-terra is changed. With Qiskit/qiskit#5089
qiskit-terra, the
package which owns the 'qiskit.*' namespace, adds a metaimporter that
will redirect imports from qiskit.providers.aer to qiskit_aer. This
means before we can merge this commit Qiskit/qiskit#5089 will need
to be released first to ensure that for backwards compatibility existing
users will be able to access aer from the old namespace.

Fixes Qiskit/qiskit#559
@hhorii hhorii force-pushed the namespace-no-more-v3 branch 2 times, most recently from dd73fd3 to 6dfb376 Compare August 29, 2022 16:25
@hhorii hhorii force-pushed the namespace-no-more-v3 branch from 6dfb376 to d2cc39e Compare August 29, 2022 17:24
@hhorii hhorii force-pushed the namespace-no-more-v3 branch from 2bf9c59 to 3a96e68 Compare August 30, 2022 00:58
@mtreinish
Copy link
Member

I've integrated the fixes here into #1526 so I'm going to close this as we can merge #1526 now

@mtreinish mtreinish closed this Aug 30, 2022
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.

2 participants