python-virtualenv-exists

Description

Installs Python using the specified 'python_type', then uses that to create a virtualenv with the selected name and Python version. In most cases you won't use this frecklet, but the 'python-virtualenv' one, as that lets you also install python packages into the virtualenv.

If you used 'pyenv' as 'python_type', this will add a piece of code to $HOME/.bashrc to load pyenv when the user logs in.

Variables

Name Type Default Description

venv_name

string --

The name of the virtualenv to set up. Required

gid

integer --

The gid of the group.

group

string --

The group who owns/runs the virtualenv.

python_base_path

string --

The base path to install Python into (if using 'pyenv' or 'conda').

python_build_opts

string --

Build options to be forwarded (if supported by 'install_type').

python_type

string pyenv

How to install Python. Defaults to 'pyenv'.

python_version

string latest

The version of python.

system_user

boolean False

Whether the user and group should be a system user/group.

uid

integer --

The uid of the user to create (optional).

user

string --

The user who owns/runs the virtualenv.

venv_base_path

string --

The path that holds the virtualenv directory.

venv_python_exe

string --

This only works in combination with the 'system' 'python_install_type', if used with another type, this task will fail.

Command-line

frecklecute python-virtualenv-exists --help

Usage: frecklecute python-virtualenv-exists [OPTIONS]

  Installs Python using the specified 'python_type', then uses that to
  create a virtualenv with the selected name and Python version. In most
  cases you won't use this frecklet, but the 'python-virtualenv' one, as
  that lets you also install python packages into the virtualenv.

  If you used 'pyenv' as 'python_type', this will add a piece of code to
  ``$HOME/.bashrc`` to load pyenv when the user logs in.

Options:
  --venv-name VENV_NAME           The name of the virtualenv to set up.
                                  [required]
  --gid GID                       The gid of the group.
  --group GROUP                   The group who owns/runs the virtualenv.
  --python-base-path PYTHON_BASE_PATH
                                  The base path to install Python into (if
                                  using 'pyenv' or 'conda').
  --python-build-opts PYTHON_BUILD_OPTS
                                  Build options to be forwarded (if supported
                                  by 'install_type').
  --python-type PYTHON_TYPE       How to install Python. Defaults to 'pyenv'.
                                  [default: pyenv]
  --python-version PYTHON_VERSION
                                  The version of python.  [default: latest]
  --system-user / --no-system-user
                                  Whether the user and group should be a
                                  system user/group.
  --uid UID                       The uid of the user to create (optional).
  --user USER                     The user who owns/runs the virtualenv.
  --venv-base-path VENV_BASE_PATH
                                  The path that holds the virtualenv
                                  directory.
  --venv-python-exe VENV_PYTHON_EXE
                                  The (optional) path to an existing Python
                                  executable to be used for the venv.
  --help                          Show this message and exit.