-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gunther Klessinger
committed
Sep 4, 2023
1 parent
25c49c2
commit 0a6faa5
Showing
2 changed files
with
35 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
root_tools="tree fd-find ripgrep poetry" | ||
|
||
function make_conda_root_env { # creates the root conda env if not present yet | ||
# main conda bin is in path | ||
local p="$(conda_root)" | ||
test -e "$p" && { | ||
nfo "Already present: $p" | ||
return 0 | ||
} | ||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh | ||
chmod +x miniconda.sh | ||
./miniconda.sh -b -p "$p" 1>/dev/null 2>/dev/null && echo 'conda root installed to '$p'' | ||
conda_src | ||
eval conda install -y -q $root_tools ${conda_root_tools:-} | ||
ls -a "$p" | ||
type micromamba && return | ||
echo -e "\x1b[1mInstalling micromamba.\x1b[0m" | ||
echo "Please confirm all question unless you know what you are doing." | ||
"${SHELL}" <(curl -L micro.mamba.pm/install.sh) | ||
call . "$HOME/.$(basename $SHELL)rc" | ||
call micromamba activate | ||
call eval micromamba install --yes $root_tools ${conda_root_tools:-} | ||
call micromamba info | ||
nfo "Next, run \x1b[1mmake ci-conda-py-env\x1b[0m" | ||
} | ||
|
||
function make_conda_py_env { # creates the venv for the project and poetry installs | ||
# main conda bin is in path | ||
local n="${PROJECT}_py${pyver}" | ||
local p="$(conda_root)/envs/$n" | ||
conda_src | ||
test -e "$p" || eval conda create -q -n "${n}" python="${pyver}" ${conda_project_tools:-} $* | ||
activate_venv || return 1 | ||
poetry install | ||
conda info | ||
ls -a "$(conda_root)/envs/" | ||
call micromamba activate | ||
test -e "$p" || { | ||
echo "Installing $p (with tools: $conda_project_tools)" | ||
call eval micromamba create --yes -q -n "${n}" python="${pyver}" ${conda_project_tools:-} $* | ||
} | ||
call activate_venv || return 1 | ||
call poetry install | ||
call ls -a "$(conda_root)/envs/" | ||
call micromamba list | ||
} |