|git clone https://github.com/[OWNER]/[REPO].git --branch [SPECIFIC BRANCH] --single-branch|
|python setup.py develop|
|# Usually, restart dev server to prevent it using already loaded site-packages modules.|
|# Hack away on code in [REPO], python will use this one rather than the one in site-packages.|
|# When done, to switch back:|
|python setup.py develop --uninstall|
|rm -rf [REPO]|
Avoids having to hack and unhack the site-packages version and/or uninstall via pip and pip install a branch using the -e syntax (and the reverse).
Useful for testing a new release before it hits PyPI, or testing a PR in a real use prior to submitting it to the upstream repo.
In a Vagrant setup where your editor and repo are on the host, with the repo dir mounted within Vagrant, it's convenient to be able to edit the third party package in your editor. To avoid it showing up as an untracked directory in git you can add