MCPcopy Create free account
hub / github.com/apache/impala / reqs_are_installed

Function reqs_are_installed

infra/python/bootstrap_virtualenv.py:380–398  ·  view source on GitHub ↗

Check if the requirements from the given file are installed in the virtualenv by looking for a matching requirements file in the root directory of the virtualenv.

(venv_dir, reqs_path)

Source from the content-addressed store, hash-verified

378
379
380def reqs_are_installed(venv_dir, reqs_path):
381 '''Check if the requirements from the given file are installed in the virtualenv by
382 looking for a matching requirements file in the root directory of the virtualenv.'''
383 installed_reqs_path = os.path.join(venv_dir, os.path.basename(reqs_path))
384 if not os.path.exists(installed_reqs_path):
385 return False
386 installed_reqs_file = open(installed_reqs_path)
387 try:
388 reqs_file = open(reqs_path)
389 try:
390 if reqs_file.read() == installed_reqs_file.read():
391 return True
392 else:
393 LOG.debug("Virtualenv upgrade needed")
394 return False
395 finally:
396 reqs_file.close()
397 finally:
398 installed_reqs_file.close()
399
400
401def setup_virtualenv_if_not_exists(venv_dir):

Callers 4

install_adls_depsFunction · 0.85
install_gcovr_depsFunction · 0.85

Calls 5

closeMethod · 0.65
joinMethod · 0.45
existsMethod · 0.45
readMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected