Closed tgeng closed 2 months ago
I think this is due to the Aspect py_library
adding imports = ["."]
by default. Does setting imports = []
on //foo:my_foo
resolve this?
Yep I can confirm passing imports = []
fixed it. Thanks!
Can imports = []
be set as the default then? I assume more people trying to adopt rules_py will encounter similar issues. Also adding every directory to PYTHONPATH seems to be a questionable default behavior.
Yes, this diff set the default to []
.
https://github.com/aspect-build/rules_py/pull/367
What happened?
Consider the following file tree and content
Then you can see different results between native py_binary and aspect's py_binary: official py_binary fails since my_foo is not qualified and hence cannot be found. Yet with aspect_py_binary,
my_foo
is found.Looking into the generated venv, I see the following.
But I think the
../../../../_main/tgeng_test/foo
should not be there.Version
Development (host) and target OS/architectures:
Output of
bazel --version
:Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:0.7.3
Language(s) and/or frameworks involved:
How to reproduce
No response
Any other information?
No response