Make sure to explicitly show the export in the following manner (in bar.py):
from path import foo __all__ = ["foo"]