Skip to content

Commit

Permalink
Run pkg_resources check in seperate process
Browse files Browse the repository at this point in the history
  • Loading branch information
AjayP13 committed Nov 8, 2018
1 parent 56a7d28 commit 6a02ba4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import fnmatch
import hashlib
import importlib
import os
import pkg_resources
import shutil
import sys
import subprocess
Expand Down Expand Up @@ -213,11 +211,17 @@ def download_and_install_wheel():
version = os.path.basename(ewhl).split('-')[1]
requirement = package_name + ">=" + version
print("Checking if requirement is met: ", requirement)
try:
pkg_resources.require(requirement)
importlib.import_module(package_name)
req_rc = subprocess.Popen([
sys.executable,
'-c',
"import importlib;"
"import pkg_resources;"
"pkg_resources.require('" + requirement + "');"
"importlib.import_module('" + package_name + "');"
])
if req_rc == 0:
print("Requirement met...skipping install of: ", package_name)
except BaseException:
else:
print("Requirement not met...installing: ", package_name)
exitcodes.append(install_wheel(ewhl))
print("Installing wheel: ", dl_path)
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version_info__ = ('0', '1', '113')
__version_info__ = ('0', '1', '114')
__version__ = '.'.join(__version_info__)

0 comments on commit 6a02ba4

Please sign in to comment.