Installing with pip, I can write the following requirements.txt file:
pip
requirements.txt
git+https://repo@branch#egg=foo&subdirectory=this/bar/foo nump