Skip to content

Commit

Permalink
Move IBMQ provider to its own package
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mtreinish committed Jul 21, 2020
1 parent 63c0fa0 commit bf28022
Show file tree
Hide file tree
Showing 79 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include LICENSE.txt README.md
include qiskit/providers/ibmq/VERSION.txt
include qiskit_ibmq_provider/VERSION.txt
recursive-include test *.py
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 3 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import os

from setuptools import setup
from setuptools import setup, find_packages

REQUIREMENTS = [
"nest-asyncio>=1.0.0,!=1.1.0",
Expand All @@ -30,7 +30,7 @@

# Handle version.
VERSION_PATH = os.path.join(os.path.dirname(__file__),
"qiskit", "providers", "ibmq", "VERSION.txt")
"qiskit_ibmq_provider", "VERSION.txt")
with open(VERSION_PATH, "r") as version_file:
VERSION = version_file.read().strip()

Expand Down Expand Up @@ -68,19 +68,7 @@
"Topic :: Scientific/Engineering",
],
keywords="qiskit sdk quantum api ibmq",
packages=['qiskit.providers.ibmq',
'qiskit.providers.ibmq.api',
'qiskit.providers.ibmq.api.clients',
'qiskit.providers.ibmq.api.rest',
'qiskit.providers.ibmq.api.rest.utils',
'qiskit.providers.ibmq.credentials',
'qiskit.providers.ibmq.job',
'qiskit.providers.ibmq.managed',
'qiskit.providers.ibmq.utils',
'qiskit.providers.ibmq.visualization',
'qiskit.providers.ibmq.visualization.interactive',
'qiskit.providers.ibmq.jupyter',
'qiskit.providers.ibmq.jupyter.dashboard'],
packages=find_packages(exclude=['test*']),
install_requires=REQUIREMENTS,
include_package_data=True,
python_requires=">=3.5",
Expand Down

0 comments on commit bf28022

Please sign in to comment.