Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Move IBMQ provider to its own package#718

Closed
mtreinish wants to merge 4 commits into
Qiskit:masterfrom
mtreinish:namespace-no-more
Closed

Move IBMQ provider to its own package#718
mtreinish wants to merge 4 commits into
Qiskit:masterfrom
mtreinish:namespace-no-more

Conversation

@mtreinish
Copy link
Copy Markdown
Member

Summary

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.ibmq to it's own package and namespace
'qiskit_ibmq_provider'.

This will be coupled with a change in terra that removes the arbitrary
namespace hook points and hard coding the element namespace maps via 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.', but it also makes it explicit where we
extend the namespace. The previous method allowed any package to extend
qiskit.* and qiskit.providers.* with whatever they wanted. This commit
will need to be coordinated with the terra change to ensure we don't
block development, because while it's not breaking for end users as a
coordinated code release, piecewise it's a breaking change for each
element, including the IBMQ provider.

Details and comments

Depends-On: Qiskit/qiskit#4767
Fixes Qiskit/qiskit#559

@mtreinish mtreinish added the on hold Can not fix yet label Jul 21, 2020
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.ibmq to it's own package and namespace
'qiskit_ibmq_provider'.

This will be coupled with a change in terra that removes the arbitrary
namespace hook points and hard coding the element namespace maps via 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.*', but it also makes it explicit where we
extend the namespace. The previous method allowed any package to extend
qiskit.* and qiskit.providers.* with whatever they wanted. This commit
will need to be coordinated with the terra change to ensure we don't
block development, because while it's not breaking for end users as a
coordinated code release, piecewise it's a breaking change for each
element, including the IBMQ provider.

Depends-On: Qiskit/qiskit#4767
Fixes Qiskit/qiskit#559
@mtreinish mtreinish removed the on hold Can not fix yet label Aug 31, 2020
@mtreinish
Copy link
Copy Markdown
Member Author

Besides all the issues and CI here, this is failing unittests on aer because of a weird circular import error. While I think we could work through most of the ibmq provider failures pretty quickly I have no idea on the source of the aer failure as of yet. Since this will likely take me some time to debug I'm setting this as on hold as a revert is proposed at Qiskit/qiskit#5006

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop using namespace packages

2 participants