Skip to content

Instantly share code, notes, and snippets.

@brennv
Last active July 20, 2017 08:46
Show Gist options
  • Save brennv/59fdfa503a9f621bcabaea5cbabd472d to your computer and use it in GitHub Desktop.
Save brennv/59fdfa503a9f621bcabaea5cbabd472d to your computer and use it in GitHub Desktop.
pif: A simple diff wrapper for pip
# Diff pip freeze after pip install or uninstall
# Example usage: pif install foo
pif() {
if [[ $@ == *'install'* ]]; then
r1=$(mktemp) && pip freeze > r1
pip "$@"
r2=$(mktemp) && pip freeze > r2
echo ' Pip freeze diff:'
diff r1 r2
rm -f r1 r2
else
pip "$@"
fi
}
@brennv
Copy link
Author

brennv commented Jul 20, 2017

For maintaining requirements.txt I recommend pipreqs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment