Module Contents

whisk.setup.NOTEBOOK_EXAMPLE_PATH = notebooks/getting_started.ipynb[source]
whisk.setup.log_subprocess_output(logger_with_level, log_lines)[source]

Calls the logger on each of the log_lines. The log lines are prefixed with whisk.cli.log_tree.CHILD_TREE_NODE_PREFIX.

logger_with_level : Logger
A logger instance (ex: logger.debug).
log_lines : str
A string of log lines separated with \n.
whisk.setup.exec(desc, cmd)[source]

Executes the cmd, and logs desc prior to execution and “DONE” after. If the cmd has stdout or stderr output this is logged as well.

If the exit code is nonzero, raises a SystemExit execption.

desc : str
A description of the command operation.
cmd : str
The command to execute.

Sets up an environment for the given project.

project : whisk.project.Project
A whisk project.

Updates the NOTEBOOK_EXAMPLE_PATH notebook kernel to use the kernel with name nbenv.


Logs that the setup completed successfully and provides next steps.


Logs the output of pip freeze at the debug level.


Sets up the project environment.

Setup performs the following actions after changing the working directory to dir:

  • Creates a Python3 venv named “venv”
  • Installs the dependencies listed in the project’s requirements.txt.
  • Initializes a Git repo
  • Creates an iPython kernel for use in Jupyter notebooks with name = <project_name>.
  • Creates a .envrc file based on .envrc.example for use with direnv. direnv loads environment variables listed in .envrc into the shell and is also used to auto-activate and deactivate the venv when entering and exiting the project directory.
  • Calls direnv allow . so the .envrc file can be loaded.
  • Makes an initial Git commit
dir : str
The full path to the project directory.