Skip to content

Commit

Permalink
fix: Fetch env python if exists before returning fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Aug 1, 2022
1 parent 0cd5fca commit e5fa4df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions bench/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
import sys
import logging
from glob import glob
from typing import List, MutableSequence, TYPE_CHECKING, Union

# imports - module imports
Expand Down Expand Up @@ -71,6 +72,11 @@ def __init__(self, path):

@property
def python(self) -> str:
existing_python_bins = glob(f"{self.name}/env/bin/python*")

if existing_python_bins:
return existing_python_bins[0]

return get_env_cmd("python", bench_path=self.name)

@property
Expand Down
2 changes: 1 addition & 1 deletion bench/utils/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_venv_path(verbose=False, python="python3"):
if is_venv_installed:
return f"{python} -m venv"
else:
log("virtualenv cannot be found", level=2)
log("venv cannot be found", level=2)


def update_node_packages(bench_path=".", apps=None):
Expand Down

0 comments on commit e5fa4df

Please sign in to comment.