diff --git a/anvil/components/base_testing.py b/anvil/components/base_testing.py index ace16c8e..fe6bb7b5 100644 --- a/anvil/components/base_testing.py +++ b/anvil/components/base_testing.py @@ -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) diff --git a/anvil/packaging/helpers/pip_helper.py b/anvil/packaging/helpers/pip_helper.py index c6912608..56012326 100644 --- a/anvil/packaging/helpers/pip_helper.py +++ b/anvil/packaging/helpers/pip_helper.py @@ -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