-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add warning when qiskit package not installed #11230
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
Add warning when qiskit package not installed #11230
Conversation
Starting in Qiskit 1.0 the qiskit-terra package will no longer be published anymore. This is a major change in the packaging because since December 2018 users have been able rely on just the qiskit-terra package if they were only depending on the core functionality in qiskit. But as we're . This commit adds a warning on import of the `qiskit` namespace if the `qiskit` package is not installed to inform users that starting in 1.0.0 qiskit-terra will not recieve updates. There will still be releases for the 0.46.x release series (while it's still supported). The other aspect with this migration is there is **not** a safe direct upgrade path from qiskit < 1.0.0 to qiskit>=1.0.0 due to limitations in `pip`. This means that users will not be able to upgrade the `qiskit` package in place. A `critical` section (the first time we've used it) release note is added to document the upgrade path for users.
One or more of the the following people are requested to review this:
|
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 thinking for documentation strategy, perhaps we should make a "preparing for Qiskit 1.0" blog post?
try: | ||
version("qiskit") | ||
except PackageNotFoundError: | ||
warnings.warn( | ||
"The `qiskit` package is not installed, only `qiskit-terra` is installed. " | ||
"Starting in Qiskit 1.0.0 only the `qiskit` package will be published. Migrate " | ||
"any requirements files still using `qiskit-terra` to use `qiskit` instead. Also " | ||
"when upgrading ensure you create a new venv instead of trying to " | ||
"upgrade in place.", | ||
FutureWarning, | ||
stacklevel=2, | ||
) |
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.
We can probably bikeshed around the exact message here, but my thoughts reading it were that it's not immediately clear to me what the remediation steps are (they're implied, not stated, for a user making their own venv rather than a library author). I'm thinking perhaps we should have an external documentation link / Qiskit blog post / whatever explaining this is in more detail that we link to from the message?
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 think linking to some place with more detail makes sense. I didn't want to write 10k words about the upgrade in a warning message, so linking to a location that has full details makes a lot of sense.
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 just going to merge this as-is, then we'll refactor the checking and the message a little to join up relevant components as #11617 gets merged up to 0.46 as well.
Summary
Starting in Qiskit 1.0 the qiskit-terra package will no longer be published anymore. This is a major change in the packaging because since December 2018 users have been able rely on just the qiskit-terra package if they were only depending on the core functionality in qiskit. But as we're . This commit adds a warning on import of the
qiskit
namespace if theqiskit
package is not installed to inform users that starting in 1.0.0 qiskit-terra will not recieve updates. There will still be releases for the 0.46.x release series (while it's still supported).The other aspect with this migration is there is not a safe direct upgrade path from qiskit < 1.0.0 to qiskit>=1.0.0 due to limitations in
pip
. This means that users will not be able to upgrade theqiskit
package in place. Acritical
section (the first time we've used it) release note is added to document the upgrade path for users.Details and comments