-
Notifications
You must be signed in to change notification settings - Fork 65
Support Windows .pyd targets for Python Wheel Packaging
#113
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
Conversation
|
What's about this instead ? |
|
@Mizux Let me try this once I get home, I believe merging in that patch should work. However, I don't think the |
|
IIRC It could be needed when your C++ pybind11 bind some methods and you want numpy support etc... |
|
After some testing and fiddling, it looks like that patch does not work. The problem appears to be due to the native.py_library(
name = name,
data = select({
"@platforms//os:windows": [":" + name + ".pyd"],
"//conditions:default": [":" + name + ".so"],
}),
deps = py_deps,
visibility = visibility,
)Specifically, the data is not triggering the genrule to create the I like the idea of wrapping the macro using the |
|
@Andrewyx after doing few tests on a windows laptop it seems that:
=> leading to this PR:
|
|
Looks good and appears to be working on my end too! I'll go ahead and close this issue now. Thanks for the help! 😄 |
sorry for the ping, just to say I'm not done to play with .pyd windows support |
Hello! This PR provides extended support for projects which use
pybind11_bazelto produce Python wheels.As a developer on PyScreenReader, it was discovered that the current implementation of
pybind11_bazeland its method of copying.sopybind_extensionto.pydfile formats usingcopy_filedoes not work for therules_pythonpy_wheelrule. The reason for this appears to be that the generated.pydfile is not a true target which can be referred to by thepy_wheelrule, or the dependency resolution graph struggles with this generated file strategy. This seems to have resulted in no one in the community developing Windows-based Python packages using pybind11 and Bazel.Regardless, the solution here is to use a similar strategy mentioned in #74 which used a genrule to create a valid target for the aliasing.