Skip to content

Setup kwargs

The setup_kwargs parameter can be used to provide a dictionary containing the project hook setup arguments. The concept behind this parameter is that at the beginning of the project lifecycle, the project can be configured with an hook script that will be executed when the project is created / got. First of all, the configuration script MUST comply with the following format:

  • It must be a Python script named setup_project.py inside the project context directory.
  • It must contain an handler (a python function) named setup as entrypoint.
  • The setup function must accept a Project instance as the only positional argument.
  • setup_kwargs must be passed as keyword arguments to the setup function.

The project setup will create a .CHECK file at the end of the setup function execution. This sentinel file is used to indicate that the project is set up and new executions will be ready.

A use case scenario can be the instantiation of entities used by the user like artifacts or functions.

Example:

setup_kwargs = {
    "some_arg1": "arg1",
    "some_arg2": "arg2"
}

# Setup script

def setup(project, some_arg1=None, some_arg2=None):
    # Do something with project and args