def add_spec(spec: str) -> Do: yield NS.lift(present_venv(name)) yield NS.lift(variable_set_prefixed('interpreter', '/usr/bin/python3.7')) yield NS.lift(variable_set_prefixed('debug_pythonpath', True)) yield request('cram', spec, name=name) data = yield NS.inspect(lambda a: a.data) return k(data.venvs).must(contain(name)) & k(data.active).must(contain(target))
def bootstrap_spec() -> Do: yield variable_set_prefixed('interpreter', 'python3.7') yield variable_set_prefixed('autobootstrap', False) yield option_cat('runtimepath', List(str(project))) cram_exists_not = yield await_k(command_must_not_exist, 'Cram') yield runtime('chromatin.nvim/plugin/bootstrap') yield command_once_defined('BootstrapChromatin', timeout=3) yield command_once_defined('CrmSetupPlugins', timeout=30) plugin_exists = yield plug_exists('Flag', timeout=20) return cram_exists_not & plugin_exists
def hs_spec() -> Do: yield NS.lift(variable_set_prefixed('autostart', True)) yield request('cram', f'hs:nvim-hs-ghcid', name='nvim-hs-ghcid', track=False) yield NS.lift(wait_for_command('GhcidStart', timeout=1)) return k(1) == 1
def python_path_spec() -> Do: dir = fixture_path('rplugin', 'path_spec') extra_path_pkg = fixture_path('rplugin', 'extra_path_pkg') yield NS.lift(variable_set_prefixed('autostart', True)) yield request('cram', f'dir:{dir}', name='path_spec', pythonpath=[extra_path_pkg]) result = yield NS.lift(call_once_defined('PathSpecTest', timeout=10)) return k(result) == 13
def extension_spec() -> Do: dir = fixture_path('rplugin', name) extension_path = fixture_path('rplugin', ext_name) yield NS.lift(variable_set_prefixed('autostart', True)) yield NS.lift(variable_set(f'{name}_components', List(f'{ext_name}.ext'))) yield request('cram', f'dir:{dir}', name='extension_spec', extensions=[extension_path]) result1 = yield NS.lift(call_once_defined('XTest', timeout=1)) result2 = yield NS.lift(call_once_defined('XExtTest', timeout=1)) return (k(result1) == 13) & (k(result2) == 23)
def setup_venv_dir(venv_dir: Maybe[Path] = Nothing) -> Do: rtp = fixture_path('rplugin', 'config', 'rtp') yield option_cat('runtimepath', List(rtp)) dir = venv_dir | temp_dir('rplugin', 'venv') yield variable_set_prefixed('venv_dir', str(dir)) return dir
def hackage_spec() -> Do: yield NS.lift(variable_set_prefixed('autostart', True)) yield request('cram', f'hackage:proteome', name='proteome') yield NS.lift(wait_for_function('ProAdd', timeout=1)) return k(1) == 1
def hs_dir_spec() -> Do: flag_dir = fixture_path('rplugin', 'flagellum.hs') yield NS.lift(variable_set_prefixed('autostart', True)) yield request('cram', f'hs_dir:{flag_dir}', name='flagellum') yield NS.lift(wait_for_function('FlagTest', timeout=1)) return k(1) == 1
def dir_venv_spec() -> Do: flag_dir = fixture_path('rplugin', 'flagellum') yield NS.lift(variable_set_prefixed('autostart', True)) yield request('cram', f'dir:{flag_dir}', name='flagellum') yield NS.lift(wait_for_command('FlagTest', timeout=1)) yield NS.lift(await_k(log_entry, 'flagellum initialized'))
def quit() -> NS[None, None]: return NS.lift(variable_set_prefixed('quit', 1))