def stackage(self, a: HsStackageRplugin) -> Do: stack = yield N.from_io(stack_exe()) return Subprocess(stack, List('install', a.dep), self.rplugin.rplugin.name, 600, env=None)
def check(rplugin: Rplugin) -> NvimIO[None]: return wait_until_valid( str(rplugin), lambda n: N.from_io(rplugin_ready(base_dir, rplugin)), timeout=timeout, interval=.5, )
def hackage(self, a: HsHackageRplugin) -> Do: cabal = yield N.from_io(cabal_exe()) return Subprocess(cabal, List('install', a.dep), self.rplugin.rplugin.name, 600, env=None)
def dir(self, a: HsStackDirRplugin) -> Do: stack = yield N.from_io(stack_exe()) return Subprocess(stack, List('install'), self.rplugin.rplugin.name, 600, cwd=a.dir, env=None)
def dist_rplugin(self, rplugin: DistRplugin) -> Do: venv = yield venv_from_rplugin(rplugin) plugin_path_e = yield N.from_io(venv_plugin_path(venv)) plugin_path = yield N.e(plugin_path_e) python_exe = venv.meta.python_executable bin_path = venv.meta.bin_path yield start_python_rplugin_host(rplugin, python_exe, bin_path, plugin_path, Nil)
def plugin_venv(base_dir: Path, rplugin: Rplugin) -> Do: yield venv_existent(base_dir)(rplugin) venv_status = yield N.from_io(check_venv(base_dir, rplugin)) yield ( N.pure(venv_status.venv) if isinstance(venv_status, VenvPresent) else N.error(f'venv for {rplugin} did not appear') )
def setup_venvs(names: List[str]) -> Do: venvs = yield setup_venv_dir(Just(venvs_path)) create = names.exists(lambda a: not venv_path(a).exists()) if create: yield N.from_io(clear_cache()) plugins = yield names.traverse(setup_venv, NvimIO) yield nvim_sync_command('CrmSetupPlugins') yield plugins.traverse(venv_existent(venvs, 30), NvimIO) yield plugins.traverse(package_installed(venvs), NvimIO)
def global_interpreter() -> Do: global_spec = yield interpreter.value yield N.from_io(python_interpreter(global_spec.to_maybe, Nothing))
def log_matches(matcher: Matcher[List[str]]) -> Do: output = yield N.from_io(IO.file(test_config.log_file)) return k(output).must(matcher)