Am 18.09.23 um 17:07 schrieb Timothee Mathieu:
I am new to guix, and I would like to use the containers in order to have 
reproducible development environments for python.

I'm using python virtual env on top of guix, automated using direnv. Anyhow I did not yet try to setup containers for this.

Anyhow, my .envrc might be a starting point:

strict_env

# Colors constants
__NONE="$(tput sgr0)"
__GREEN="$(tput setaf 2)"
__BOLD=$(tput bold)


use_guix --ad-hoc glibc-locales python-wrapper python-pip python-virtualenv \
        python-pyyaml  # add whatever you need

__has_pyenv=no
if [ $(ls $(direnv_layout_dir) 2>/dev/null | grep --count python || true) != 0 ] ; t
hen
   __has_pyenv=yes
fi
if [ $__has_pyenv != yes ] ; then
   echo "${__GREEN}${__BOLD}Setting up virtual environment${__NONE}"
   layout_python3
   python -m pip install -U pip
else
   path_add PATH $(ls -d $(direnv_layout_dir)/python-*/bin)
fi

# more setup


if [ $__has_pyenv != yes ] ; then
   # do this after cloning debops
   echo "${__GREEN}${__BOLD}Installing packages${__NONE}"
   python -m pip install -r requirements.txt
fi




--
Regards
Hartmut Goebel

| Hartmut Goebel          |h.goe...@crazy-compilers.com                |
|www.crazy-compilers.com  | compilers which you thought are impossible |

Reply via email to