Skip to content
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

Don't use namespace packages #151

Closed
bamarsha opened this issue Aug 26, 2022 · 1 comment · Fixed by #170
Closed

Don't use namespace packages #151

bamarsha opened this issue Aug 26, 2022 · 1 comment · Fixed by #170
Assignees
Labels
bug Something isn't working
Milestone

Comments

@bamarsha
Copy link
Contributor

Namespace packages have poor tooling support. We are stuck using old pkgutil-style namespace packages because Maturin doesn't and won't support the new native namespace packages (PyO3/maturin#811). Meanwhile, mypy supports only native namespace packages and not pkgutil-style ones (python/mypy#9393).

I think we should use pyqir_generator, pyqir_parser, pyqir_evaluator instead of pyqir.generator, pyqir.parser, pyqir.evaluator. It's simpler and just works in more scenarios.

@bamarsha bamarsha added the bug Something isn't working label Aug 26, 2022
@bamarsha
Copy link
Contributor Author

One idea to avoid a breaking change is to create the pyqir module once in the metawheel, and from there re-export pyqir_parser as parser, pyqir_generator as generator, pyqir_evaluator as evaluator. This works like a backwards compatibility shim.

However, that only works if you have the metawheel installed, which depends on all three pyqir components. If you only want to depend on one or two of them, you wouldn't have access to the backwards compatibility shim. We could define a separate wheel that provides the pyqir module without depending on anything, and conditionally tries to import and re-export each component, ignoring missing ones.

Both of these ideas have flaws and probably aren't worth the trouble, since the breaking change itself is pretty simple to adapt to...

@bamarsha bamarsha added this to the v0.7.0 milestone Oct 24, 2022
@bamarsha bamarsha self-assigned this Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant