I want to run tests/modules in my Python project without installing them. I have this on top of every file in my project:
import sys
from os.path import expanduser
sys.path.append(expanduser("~") + "/myproject")
I tried putting this in 'setup.py' or 'init.py' of the folder containing the file, but that doesn't work. So I want to nice way of adding project root to path so it's there before running anything in the project. I should be able to import any module/file in the project like this:
from dir1.file1. import MyClass
As mentioned in the Title, I don't want to 'pip install' my project and the solution should work if I want to install it later.