Skip to content

Commit

Permalink
Checking dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
karlcow committed Mar 25, 2015
1 parent a0a5c50 commit 7252891
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@
'''


def check_pip_deps():
'''Check installed pip dependencies.
Make sure that the installed pip packages match what is in
requirements.txt, prompting the user to upgrade if not.
'''
req = subprocess.check_output(["cat", "requirements.txt"]).splitlines()
try:
pkg_resources.require(req)
except VersionConflict as e:
print(DEPS_VERSION_HELP % e)
except DistributionNotFound as e:
print(DEPS_NOTFOUND_HELP % e)
else:
return True


def config_validator():
'''Make sure the config file is ready.'''
Expand Down

0 comments on commit 7252891

Please sign in to comment.