echoing-farmer-1563007/02/2021, 4:26 PM
)_ as well as b and c (which look like
). root directories a,b,c have SOURCE_ROOT set and a BUILD for
, and all three
directories have a BUILD for
. I will say that
don't have a BUILD because there are no source files there (including an
because I didn't want it to conflict with
Okay. AAaaaanyway, I have a few
targets that use
, and they seem to run OK (the
and relevant files, and the tests run).
But I have one irritating test that isn't playing nice:
and all files that I think I'm importing, but running the test fails with the equivalent of
So I don't quite understand what's gone wrong. I've stared at comparable BUILD files to try and understand what's different. Is there a way to force rebuilding of the test pex just to make sure there's not a caching issue? Or something else I should look at?
module/tests/test_file.py:2: in <module>
from ns.b.submodule.submodule import Thing
E: ModuleNotFoundError: No module named `ns.b`
into the working target which shows
as importable (and
as importable). But in the failing test target,
isn't importable, but
shows some elements like
of the base package
, which isn't listed anywhere in the dependencies!
enough-analyst-5443407/02/2021, 4:35 PM
files / do they have namespace package declarations in them and nothing else?
files to get proper implicit namespace packages.
echoing-farmer-1563007/02/2021, 4:40 PM
but no others could or it would be overwritten, but what may well be the case is that no packages in the namespace can have an
in the main namespace. Let me try that, because that indeed is where the collision seems to be happening (looking at the failed test, it's bringing in something in the main package, where the passing test isn't).
and the test passed. Some refactoring required.
Thanks; not a pants issue at all; I just misunderstood
enough-analyst-5443407/02/2021, 4:43 PM
containing one of these:
Or else use implicit namespace packages (aka delete your