Remove pip helper object since its not used

Change-Id: Ic6c5bcf9e08bfd67ddf3aad211b1dd5f9c74d6fb
This commit is contained in:
Joshua Harlow 2014-03-01 20:46:09 -08:00
parent 7f4e457655
commit 7b036e391c
2 changed files with 0 additions and 35 deletions

View File

@ -24,7 +24,6 @@ from anvil import shell as sh
from anvil import utils
from anvil.components import base
from anvil.packaging.helpers import pip_helper
LOG = logging.getLogger(__name__)
@ -55,7 +54,6 @@ class EmptyTestingComponent(base.Component):
class PythonTestingComponent(base.Component):
def __init__(self, *args, **kargs):
base.Component.__init__(self, *args, **kargs)
self.helper = pip_helper.Helper()
self.test_type = self.get_option('test_type', default_value='').lower().strip()
self.ignore_test_failures = kargs.get('ignore_test_failures', False)

View File

@ -155,36 +155,3 @@ def read_requirement_files(files):
with open(filename) as f:
result.extend(parse_requirements(f.read()))
return result
class Helper(object):
def __init__(self):
self._pip_executable = sh.which_first(['pip-python', 'pip'])
self._installed_cache = None
def _get_installed(self):
cmd = [self._pip_executable] + FREEZE_CMD
(stdout, _stderr) = sh.execute(cmd)
return parse_requirements(stdout, True)
def uncache(self):
self._installed_cache = None
def list_installed(self):
if self._installed_cache is None:
self._installed_cache = self._get_installed()
return list(self._installed_cache)
def is_installed(self, name):
matches = self.find_installed(name)
if len(matches):
return True
return False
def find_installed(self, name):
wanted_pkg = create_requirement(name)
matches = []
for pkg in self.list_installed():
if pkg.key == wanted_pkg.key:
matches.append(pkg)
return matches