plain-carpet-73994
05/01/2021, 12:37 AMutils
with an __init__.py
that looks like this:
from .require import require
from .foo import foo
__all__ = ['require', 'foo']
and the foo.py
and require.py
files exist and can be imported from other packages as expected (e.g. import utils.require
). I added a unit test for foo
which does not use require
. require
currently doesn't have any unit tests. My BUILD file is super simple:
python_library()
python_tests(name='test')
When I try to run the tests in utils
I get:
E ModuleNotFoundError: No module named 'utils.require'
My theory is that since I'm not using require
in any tests that file doesn't get put in my sandbox so it's not available and I therefore get the error. But adding a dependencies=['./:utils']
to my python_tests
target doesn't help either. Having an __init__.py
that exports a bunch of things some of which may not have unit tests seems fairly common so I suspect I'm doing something wrong. Any advice?hundreds-father-404
05/01/2021, 12:38 AM__init__.py
files, I suspect that this is the issue
We still have a TODO to make the default more sensibleplain-carpet-73994
05/01/2021, 12:39 AMhundreds-father-404
05/01/2021, 12:45 AMplain-carpet-73994
05/01/2021, 1:00 AM