Skip to content

Commit

Permalink
Set autoinstall to True by default
Browse files Browse the repository at this point in the history
  • Loading branch information
gaow committed Nov 6, 2018
1 parent 1e2e47b commit 7f4bd22
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def run(self):
cmdclass = cmdclass,
package_dir = {'dsc': 'src'},
install_requires = ['numpy', 'pandas>=0.23.4', 'sympy', 'numexpr',
'sos>=0.16.11', 'sos-pbs>=0.9.16.0', 'h5py', 'PTable',
'sos>=0.17.3', 'sos-pbs>=0.9.17.0', 'h5py', 'PTable',
'pyarrow>=0.5.0', 'sqlalchemy', 'tzlocal',
'msgpack-python']
)
4 changes: 2 additions & 2 deletions src/dsc_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ def __init__(self, workflows, runtime, rerun = False, n_cpu = 4, try_catch = Fal
self.install_libs(runtime.rlib, "R_library")
self.install_libs([x for x in runtime.pymodule if x != 'dsc'], "Python_Module")
else:
self.lib_depends.extend([f'if not R_library({repr(l[0])}, {repr(l[1]) if l[1] is not None else "None"}).target_exists():\n raise RuntimeError("Automatic installation failed. Please login and manually install {repr(l[0])}.")'
self.lib_depends.extend([f'if not R_library({repr(l[0])}, version={repr(l[1]) if l[1] is not None else "None"}, autoinstall=True).target_exists():\n raise RuntimeError("Automatic installation failed. Please login and manually install {repr(l[0])}.")'
for l in [install_r_lib(x, dryrun = True) for x in runtime.rlib]])
self.lib_depends.extend([f'if not Py_Module("{l}").target_exists():\n raise RuntimeError("Automatic installation failed. Please login and manually install {repr(l)}.")'
self.lib_depends.extend([f'if not Py_Module("{l}", autoinstall=True).target_exists():\n raise RuntimeError("Automatic installation failed. Please login and manually install {repr(l)}.")'
for l in (runtime.pymodule + ['msgpack'])])

def write_pipeline(self, arg):
Expand Down
4 changes: 2 additions & 2 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,14 @@ def install_r_lib(lib, dryrun = False):
versions = None
if not dryrun:
logger.info("Checking R library {} ...".format(lib))
return R_library(lib, versions).target_exists()
return R_library(lib, version=versions, autoinstall=True).target_exists()
else:
return(lib, versions)

def install_py_module(lib):
from sos.targets_python import Py_Module
logger.info("Checking Python module {} ...".format(lib))
return Py_Module(lib).target_exists()
return Py_Module(lib, autoinstall=True).target_exists()

def make_html_name(value):
return "".join(x for x in value.replace(' ', '-') if x.isalnum() or x in ['-', '_']).lower()
Expand Down

0 comments on commit 7f4bd22

Please sign in to comment.