-
Notifications
You must be signed in to change notification settings - Fork 528
feat: pyo3 support module prefix + naming #3726
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
base: main
Are you sure you want to change the base?
Conversation
7a660ad to
3a98fed
Compare
35bc452 to
e19bd9c
Compare
UebelAndre
left a comment
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.
Thanks! Just one question
UebelAndre
left a comment
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.
One more question for you guys!
| name = "module_prefix", | ||
| srcs = ["bar.rs"], | ||
| edition = "2021", | ||
| imports = ["."], |
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.
Can you explain how this interacts with imports? Is imports = ["."] required? What happens if a subdirectory is added? Does it make the module not imported?
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.
Import values behave just like they do for regular Python library import paths under Bazel.
I reworked the test to use the default import path (the repo root) instead of the package's dir. The python test case is adjusted accordingly so it looks like the rest of the test cases in the pyo3 extension workspace.
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.
What happens if a subdirectory is added? Does it make the module not imported?
As in something like imports = ["some_dir"]? It'd try to strip this off of the prefix of the module path for python. Since the shared lib is being placed in a directory with a module path prefix turned to dirs it would effectively try to trim the module name prefixes this PR is adding support for.
Adds support for specifying the module name + module prefix for pyo3 extensions.