-
-
Notifications
You must be signed in to change notification settings - Fork 586
Namespace package __path__ manipulation breaks packages using __init__.py to define code #1464
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
Comments
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
This is still an active issues, please keep open |
Potentially related: #2156 I'm not completely sure that this is caused by lack of site-packages, so I won't close this as a duplicate. |
I was able to get around this by setting |
To follow up on my comment above, while this does allow the import to work, it wipes any data directories that don't have any python files. There's some flink directories that contain only java archive files. Still discovering when precisely those are needed. |
I've got to the bottom of the issue here. The issue here is indeed solved (or handled better) by #2156 Therefore, closing as duplicate. Root cause:
This only works by accident outside bazel, because pip and others all just unzip the files into the same site-packages folder π Suggestions here would be:
Further references:
|
π bug report
Affected Rule
https://github.com/bazelbuild/rules_python/blob/fe33a4582c37499f3caeb49a07a78fc7948a8949/python/pip_install/tools/wheel_installer/namespace_pkgs.py#L90-L99
Is this a regression?
Not sure, first time I have tried this.
Description
The code in the package's source init.py seems to get overwritten. I'm not fully sure why, it appears that https://github.com/bazelbuild/rules_python/blob/fe33a4582c37499f3caeb49a07a78fc7948a8949/python/pip_install/tools/wheel_installer/namespace_pkgs.py#L87-L88 is trying to guard against it.
If possible, it would be nice to lay out a site_packages that is less hacky.
π¬ Minimal Reproduction
https://github.com/dzbarsky/rules_python_pylink_bug
bazel test //:flink_import_test
π₯ Exception or Error
π Your Environment
Operating System:
Output of
bazel version
:Rules_python version:
Anything else relevant?
The text was updated successfully, but these errors were encountered: