One aspect is covered here
https://pip.readthedocs.io/en/stable/reference/pip_install/#vcs-support (Updated link: https://pip.pypa.io/en/stable/topics/vcs-support/)
In particular, if setup.py is not in the root directory you have to specify the subdirectory where to find setup.py in the pip install command.
So if your repository layout is:
- pkg_dir/
- setup.py # setup.py for package pkg
- some_module.py
- other_dir/
- some_file
- some_other_file
You’ll need to use pip install -e vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir.