X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/blobdiff_plain/3b1292fc7703f1c24583969a5d30eeb5585bfc47..4dff03db6a66b87657648ff91d202cecbe7f4135:/invoke/setup-linux/tasks.py?ds=sidebyside diff --git a/invoke/setup-linux/tasks.py b/invoke/setup-linux/tasks.py index 067c811..1e20b05 100644 --- a/invoke/setup-linux/tasks.py +++ b/invoke/setup-linux/tasks.py @@ -100,3 +100,26 @@ def add_vim_plugin(c, git_path, folder): c.run(f'ls -l {HOME}/.vim/pack/vendor/opt') print(f"Use `packadd {folder}` in .vimrc to enable") +@task +def ensure_env(c, env): + envs = f'{HOME}/envs' + path = f'{envs}/{env}' + if(not os.path.exists(envs)): + c.run(f'mkdir -p {envs}') + + if(not os.path.exists(path)): + c.run(f'python3 -m venv {path}') + reqs = f'{DOTFILES}/reqs/{env}.txt' + c.run(f'{path}/bin/pip install -r {reqs}') + + c.run(f'{path}/bin/pip freeze') + +@task +def env_ansible(c): + ensure_env(c, 'ansible') + + +@task +def env_jupyter(c): + ensure_env(c, 'jupyter') +