ripe-gigabyte-88964
03/29/2023, 4:13 PMmypackage/__init__.py
mypackage/hello.py
mypackage/tests/test_hello.py
However, when we try to run the test file using pants, it complains it cannot import module mypackage.hello
. However, pants dependencies --transitive mypackage/tests/test_hello.py
shows all `mypackage/hello.py`'s dependencies as well, only the module itself is missing. So it seems like pants is correctly inferring that test_hello.py
depends on hello.py
but then not adding hello.py
in as a dependency?broad-processor-92400
03/29/2023, 7:12 PMripe-gigabyte-88964
03/29/2023, 7:13 PMfrom mypackage.hello import hello_world
ripe-gigabyte-88964
03/29/2023, 7:14 PMBUILD
file in mypackage
has a python_sources
(among other stuff) and the BUILD
in tests only has python_tests
ripe-gigabyte-88964
03/29/2023, 7:14 PMmypackage
is a source rootripe-gigabyte-88964
03/29/2023, 7:16 PMmypackage
(which is the root for the repo)?broad-processor-92400
03/29/2023, 7:18 PM/foo/bar.py
and /foo
is a source root, then import bar
works to load that file, not import foo.bar