TL;DR
Here\'s an example repository that is set up as described in the first diagram (below): https://github.com/Poddster/package_problems
I
To run it from both command line and act like library while allowing nosetest to operate in a standard manner, I believe you will have to do a double up approach on Imports.
For example, the Python files will require:
try:
import f
except ImportError:
import tools.f as f
I went through and made a PR off the github you linked with all test cases working.
https://github.com/Poddster/package_problems/pull/1
Edit: Forgot the imports in __init__.py
to be properly usable in other packages, added. Now should be able to do:
import tools
tools.c.do_something()