Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 namespace redirect hook for qiskit-aer #5089
Add namespace redirect hook for qiskit-aer #5089
Changes from 30 commits
2356149
3174149
990864b
6e896c5
0f985de
d2a93b9
32b5499
c17e0c1
fa1781e
9483708
208131e
5e493fc
e3866ea
f759582
4836642
643cbb6
90240d1
945bf7a
08cb82f
fe8f90a
c841200
1aa04ef
876c630
4cc552b
84166c0
8eb7ce7
5e43989
6ba893a
20c63c8
132c894
9e11213
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 suppose technically this might break some compatibility if some random package is extending the namespace with
qiskit.providers.aer_with_my_modifications
(stillstartswith("qiskit.providers.aer")
, but we probably don't need to care about that.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 not sure namespace packaging would work for someone trying to extend
qiskit.providers.aer
since aer itself doesn't add the same pkgutil hooks. In some cases someone probably could extend the namespace with their custom subpackage but not in all permutations of packaging as namespace packaging isn't reliable (this is why I couldn't remove the pkgutil calls otherwise I'd break compat with old/current aer releases).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 mean if somebody extends
qiskit.providers
with a name that starts withaer
, likeaer_but_actually_not
. I think it's probably not worth worrying about, though.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.
ah ok now I follow what you're saying. Yeah I should have done a proper regex match something like
^qiskit\.provider\.aer\.*
to match on exactly the aer namespace. But yeah I'm not too worried a potential name squatter like that. The bigger concern for me is how we deprecate and remove the pkgutil namespace hooks longer term. I know there are external users of it and trying to migrate them off will be a pain.