-
Notifications
You must be signed in to change notification settings - Fork 543
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
Bazel Python can't do namespaces with google.cloud #65
Comments
It may be related to #55 |
Bug #55 actually diagnoses this better and completely than my previous comment, so I'm removing it. |
Getting the same issue! Any thoughts on a workaround? One idea is to make To get around this disadvantage, I suppose we could preserve the existing Thoughts? |
There is a lot of discussion happening about a ground-up rewrite of these rules: https://groups.google.com/forum/#!forum/bazel-sig-python The workaround I'm using at the moment, which I don't necessarily recommend, is I wrote our own set of rules: https://github.com/TriggerMail/rules_pyz |
Thanks Evan! Playing around with various options; I appreciate the pointer to your solution, which I will definitely look into... |
Just want to note that this issue is blocking me from adopting Bazel for our python codebase. |
@brandjon is this somewhere on the roadmap? |
Actually, this seems to work now. I just had to declare all the transitive dependencies, so for py_library(
name = "google-cloud-storage",
deps = [
requirement("cachetools"),
requirement("certifi"),
requirement("chardet"),
requirement("google-api-core"),
requirement("google-auth"),
requirement("google-cloud-core"),
requirement("google-resumable-media"),
requirement("google-cloud-storage"),
requirement("googleapis-common-protos"),
requirement("idna"),
requirement("protobuf"),
requirement("pyasn1"),
requirement("pyasn1-modules"),
requirement("pytz"),
requirement("requests"),
requirement("rsa"),
requirement("setuptools"),
requirement("six"),
requirement("urllib3"),
]
) |
@tcwalther The bug still exists. To recreate, try
It should be importing from the py_pypi__google_cloud_storage. My guess is that each requirement is sandboxed while the various "google-*" requirements assume the modules will be merged into a common google.cloud namespace. See #93 |
I think we can close this as a duplicate of #93. |
I'm trying to use
google-cloud-bigquery
, but my code fails to findbigquery
ingoogle.cloud
.I am able to import
google.cloud
, but that loadspypi__google_cloud_core_0_28_0
only, and not the other dependencies that add togoogle.cloud
, despitepypi__google_cloud_bigquery_0_29_0
and all other transitive dependencies being in the runfiles.Here is a debugging session:
My BUILD rule is
Where
jupyter.py
starts an IPython REPL.The text was updated successfully, but these errors were encountered: