-
-
Notifications
You must be signed in to change notification settings - Fork 586
namespace packages are broken in rules_python
py_binary/py_test rules ([email protected])
#2757
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
I agree, with @aignas, most of your issues with very complex packages will be duplicates of the well-known issue described above related to lack of site-packages layouts causing friction. So please follow along there for updates. However, a small fyi, your issue message is not related to When I update
And typically, the workarounds for now are to patch the packages (either inside bazel, or outside bazel and published to a private mirror). |
aha, thanks for pointing out that namespace clash. from a downstream consumer POV, I see #2156 as a feature implementation (e.g. a roadmap item) - where as #2757 reports a concrete failure mode (e.g. a bug in the current state impl that others might find in the event they hit the same or similar issue). iow, maybe "#2156 closes #2757" where post #2156 the repro in #2757 would succeed and thus be closed - but #2156 isn't necessarily guaranteed to solve this without explicitly testing it prior to close. additionally, the two other linked issues in torch in #2156 remain open and presumably would be validated in the same manner. but perhaps you all prefer to manage your issue tracking oriented at the developer team modality vs the user experience. I'm not opinionated either way, just pointing out the thought process behind taking the time to file this separate bug report. |
My goals here with linking issues and having only a single issue is:
|
Yup, I also agree it's a duplicate fwiw. Even more so now the issue is entirely unrelated to namespaces. :) It's just another duplicate of the same, well-known problem, with the same workarounds that work fine today. User-space patching to dependencies that assume a site-packages layout. And by marking as duplicate, we do still keep a historical linkage. |
aha, I was not aware of that - for some reason I was thinking this project was at least partially staffed/supported by Google since it seems pretty intrinsic to Bazel and was previously under the |
🐞 bug report
Affected Rule
The issue is caused by the rule:
py_binary
,py_test
inrules_python==1.3.0
Is this a regression?
I don't believe so.
Description
when attempting to use namespace packages with
rules_py
, the transitive 3rdparty environment is not setup as expected which leads to immediate import failures:with
bazel run
against apy_binary
:with
bazel test
against apy_test
:namespace packages are a popular way to modularize libraries that have many underlying sub-deps, which enables each modularized dep to be versioned independently (and enables e.g. multi-team development workflows). in our case, we hit this with NVIDIA's IsaacSim's IsaacLab libraries which heavily depend on this basic python packaging feature.
Expected Result
the
from isaaclab.app import AppLauncher
import should be able to import all of it's transitive deps, as demonstrated in this uv-based reproduction:🔬 Minimal Reproduction
A minimal repro has been provided in the rules_python_1.3.0_no_rules_py branch of this repo.
Reproduction one-liner:
🔥 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: