Skip to content

Commit 7252891

Browse files
committed
Checking dependencies
1 parent a0a5c50 commit 7252891

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

run.py

+16
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,22 @@
5454
'''
5555

5656

57+
def check_pip_deps():
58+
'''Check installed pip dependencies.
59+
60+
Make sure that the installed pip packages match what is in
61+
requirements.txt, prompting the user to upgrade if not.
62+
'''
63+
req = subprocess.check_output(["cat", "requirements.txt"]).splitlines()
64+
try:
65+
pkg_resources.require(req)
66+
except VersionConflict as e:
67+
print(DEPS_VERSION_HELP % e)
68+
except DistributionNotFound as e:
69+
print(DEPS_NOTFOUND_HELP % e)
70+
else:
71+
return True
72+
5773

5874
def config_validator():
5975
'''Make sure the config file is ready.'''

0 commit comments

Comments
 (0)