-
Notifications
You must be signed in to change notification settings - Fork 737
Stop using namespace packages #559
Description
Informations
- Qiskit version: >= 0.7
- Python version: All
- Operating system: All
What is the current behavior?
Python namespace packaging is inherently unreliable and is a constant source of problems for users. What might work in a fresh python environment over time pip and python packaging almost surely mess things up so it will no longer see sub elements. This is an inherent issue with python packages which is most clearly demonstrated by: https://github.com/pypa/sample-namespace-packages/blob/master/table.md which shows all the possible ways that namespace packages can be installed when the system is working as expected (which it often doesn't). This is the reason we've had bugs like Qiskit/qiskit#2483 and we've had to land PRs like Qiskit/qiskit#2842 and Qiskit/qiskit#374 to try and communicate that namespacing doesn't work in python packaging. At least for me personally it's one of the biggest issues I have to field from people trying to develop or use qiskit.
Suggested solutions
Since we don't want to have a single repo for all the qiskit elements the best path forward would be to just abandon namespace packaging altogether. Having everything in the same namespace is not necessary for distinct elements to work together to work together. The pattern that all the elements used prior to the integrated names with using a separate package like qiskit_aer
, qiskit_ignis
, and qiskit_aqua
worked fine and avoided all these packaging issues. If we moved back to this model each element was self contained and inherited from qiskit
(from terra) would work perfectly well without ever having to worry about pip, setuptools, distutils, etc messing up the namespace and making things disappear.