Skip to content

Instantly share code, notes, and snippets.

@nnja
Created October 2, 2017 01:19
Show Gist options
  • Save nnja/5ce68f0312caf6607bba15dde2c28f02 to your computer and use it in GitHub Desktop.
Save nnja/5ce68f0312caf6607bba15dde2c28f02 to your computer and use it in GitHub Desktop.
Git Hook: Example post-merge hook that checks for updates to requirements.txt
#!/usr/bin/env python
import sys
import subprocess
diff_requirements = 'git diff ORIG_HEAD HEAD --exit-code -- requirements.txt'
exit_code = subprocess.call(diff_requirements.split())
if exit_code == 1:
print 'The requirements file has changed! Remember to install new dependencies.'
else:
print 'No new dependencies.'
@lastmaj
Copy link

lastmaj commented Oct 20, 2022

@mojtabasalehiyan if by some chance you are still looking for a possible answer, then maybe creating a bash scripts that activates your virtual environments and then creates migration could solve your problem.

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