Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update depcheck feature for more accurate comparation #240

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions dep_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,26 @@ def check_dependency():
pip_list = sorted([(i.key) for i in pip.get_installed_distributions()])

for req_dep in list_deps:
if req_dep not in pip_list:
missing_deps.append(req_dep)
compare_char = ["==", ">=", "<=", ">", "<", "!="]
for c in compare_char:
if c in req_dep:
pkg = req_dep.split(c)
if pkg[0] not in pip_list:
missing_deps.append(req_dep)
break
else:
installed_ver = pkg_resources.get_distribution(pkg[0]).version
if self.get_truth(installed_ver, c, pkg[1]):
break
else:
missing_deps.append(req_dep)
else:
if req_dep not in pip_list:
# Why this package is not in get_installed_distributions ?
if str(req_dep) == "argparse":
pass
else:
missing_deps.append(req_dep)

if missing_deps:
print "You are missing a module for Datasploit. Please install them using: "
Expand Down