Add an optional extended description…
This commit is contained in:
Fabian Affolter 2017-06-08 15:53:12 +02:00 committed by Pascal Vizeli
parent 1e352d37d0
commit 0863d50210
13 changed files with 27 additions and 30 deletions

View file

@ -11,6 +11,7 @@ from typing import Optional
import pkg_resources
_LOGGER = logging.getLogger(__name__)
INSTALL_LOCK = threading.Lock()
@ -26,7 +27,7 @@ def install_package(package: str, upgrade: bool=True,
if check_package_exists(package, target):
return True
_LOGGER.info('Attempting install of %s', package)
_LOGGER.info("Attempting install of %s", package)
args = [sys.executable, '-m', 'pip', 'install', '--quiet', package]
if upgrade:
args.append('--upgrade')
@ -39,7 +40,7 @@ def install_package(package: str, upgrade: bool=True,
process = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
_, stderr = process.communicate()
if process.returncode != 0:
_LOGGER.error('Unable to install package %s: %s',
_LOGGER.error("Unable to install package %s: %s",
package, stderr.decode('utf-8').lstrip().strip())
return False