-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use relative import for _accelerate
#12546
Conversation
One or more of the following people are relevant to this code:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this, especially if it's helping you. Black can probably join together some of the lines now, since they're shorter.
import qiskit._accelerate | ||
from . import _accelerate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this line, we probably don't actually need to change qiskit._accelerate
into _accelerate
, because this line still causes _accelerate
to be a name that's defined on the qiskit
object.
But also, I don't mind at all.
Pull Request Test Coverage Report for Build 9468397965Details
💛 - Coveralls |
Sorry, I will fix this. I fixed it once, but I messed it up again when I when to rebase to the latest |
Pull Request Test Coverage Report for Build 9469996422Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9475648590Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
* Use relative import for `_accelerate` * Fix black * Disable wrong-import-order in `__init__.py`
Summary
I don't understand the python import mechanism enough to understand why, but this PR fixes some problems for me with importing from Rust code when on Fedora or RHEL.
Details and comments
If one tries to run
tox -epy
from a dependent of Qiskit on Fedora or RHEL, there will be lots of errors aboutqiskit._accelerate
. For the sake of example, we will use the circuit-knitting-toolbox as an example of a Qiskit dependent, but I've also been able to reproduce this with qiskit-experiments.Here is a Dockerfile that tries to do this using the current latest commit on Qiskit
main
:When one attempts to build this image using
docker build -f Dockerfile.qiskit-main .
, the following error is raised repeatedly:If one instead uses a Dockerfile that points to this fork (same as above except one line),
then the errors are very different:
which is a different, known, issue (but I am having a hard time finding a link at the moment). EDIT: I believe it may be related to symengine/symengine-wheels#16.
Thus, I propose that the current PR is merged to get Qiskit one step closer to working properly on Fedora and RHEL.