Skip to content

Commit

Permalink
Update bentoml.py
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelduranfrigola committed Jun 22, 2023
1 parent e5de959 commit 23fe5c5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ersilia/setup/requirements/bentoml.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import subprocess
import sys
import tempfile
import os
import shutil


class BentoMLRequirement(object):
Expand All @@ -17,7 +20,17 @@ def is_installed(self):
def is_bentoml_ersilia_version(self):
if not self.is_installed():
return False
return False
tmp_folder = tempfile.mkdtemp(prefix="ersilia-")
tmp_file = os.path.join(tmp_folder, "version.txt")
cmd = "bentoml --version > {0}".format(tmp_file)
subprocess.Popen(cmd, shell=True).wait()
with open(tmp_file, "r") as f:
text = f.read()
if "0.11.0" in text:
return True
else:
return False
shutil.rmtree(tmp_folder)

def install(self):
print("Installing bentoml (the ersilia version)")
Expand Down

0 comments on commit 23fe5c5

Please sign in to comment.