def _run_install_from_dir(source_dir, dest_dir=None): old_dir = os.getcwd() os.chdir(source_dir) try: install_method = get_install_method(source_dir) func = install_methods[install_method] try: func(source_dir, dest_dir) return True except ValueError as err: # failed to install logger.info(str(err)) return False finally: os.chdir(old_dir)
def _run_install_from_dir(source_dir, dest_dir=None): old_dir = os.getcwd() os.chdir(source_dir) try: install_method = get_install_method(source_dir) func = install_methods[install_method] try: func(source_dir, dest_dir) return True except ValueError, err: # failed to install logger.info(str(err)) return False finally: os.chdir(old_dir)
def test_get_install_method_with_packaging_pkg(self): path = self._valid_setup_cfg_pkg() self.assertEqual("distutils2", get_install_method(path))
def test_get_install_method_with_distutils_pkg(self): path = self._distutils_pkg_info() self.assertEqual("distutils", get_install_method(path))
def test_get_install_method_with_setuptools_pkg(self): path = self._setuptools_setup_py_pkg() self.assertEqual("setuptools", get_install_method(path))