Skip to content

Commit

Permalink
fix: checks for bench requirements to be installed without the --user
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Jan 22, 2020
1 parent 0daa5c4 commit 3b06683
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,15 @@ def update_npm_packages(bench_path='.'):
exec_cmd('npm install', cwd=bench_path)


def in_virtual_env():
if sys.version_info.major == 2:
return hasattr(sys, 'real_prefix')
if sys.version_info.major == 3:
return sys.base_prefix != sys.prefix

def install_requirements(pip, req_file, user=False):
if os.path.exists(req_file):
# sys.real_prefix exists only in a virtualenv
if hasattr(sys, 'real_prefix'):
if in_virtual_env():
user = False

user_flag = "--user" if user else ""
Expand Down

0 comments on commit 3b06683

Please sign in to comment.