-
-
Notifications
You must be signed in to change notification settings - Fork 611
Closed
Copy link
Labels
Description
🐞 bug report
Affected Rule
I'm assuming there's some issue in py_binary
or py_library
. Not sure.
Is this a regression?
Yes, 1.4.1 appears to work, but 1.5.0-rc4 does not.
Description
I can no longer import the kfp.compiler
module.
🔬 Minimal Reproduction
Check out the reproduction here: https://github.com/philsc/rules_python-repro/tree/repro-kfp-1.5.0-rc4
The README showcases the issue I'm running into.
🔥 Exception or Error
Doing this:
import kfp
print(kfp)
import kfp.compiler
print(kfp.compiler)
And having this BUILD target:
py_binary(
name = "bin",
srcs = ["bin.py"],
deps = [
requirement("kfp"),
],
)
results in this error:
<module 'kfp' from '/data/phil_cache/bazel/_bazel_philipp.schrader/29d62092ea113224b51636420449a2d3/execroot/__main__/bazel-out/k8-fastbuild/bin/bin.runfiles/my_deps_kfp_pipeline_spec/site-packages/kfp/__init__.py'>
Traceback (most recent call last):
File "/data/phil_cache/bazel/_bazel_philipp.schrader/29d62092ea113224b51636420449a2d3/execroot/__main__/bazel-out/k8-fastbuild/bin/bin.runfiles/__main__/bin.py", line 4, in <module>
import kfp.compiler
ModuleNotFoundError: No module named 'kfp.compiler'
Rules_python version:
1.5.0
Workaround
Set pip.parse.enable_implicit_namespace_pkgs = True
in 1.5
Note that this will have to be changed to False in subsequent versions; the bug is an inverted logic check after some refactoring.