curia.infra.utils module

class curia.infra.utils.AdditionalPath(path)

Bases: object

Context manager for adding a path to sys.path. Removes the path when the context exits. Useful for when you want to import a module from a path that isn’t in sys.path and you don’t want to pollute sys.path with the new path for the rest of the process (for example, during testing).

class curia.infra.utils.ContextualImportManager

Bases: object

Context manager for importing modules that you later don’t want to be able to import. Useful for when you want to import a module from a path that isn’t in sys.path and you don’t want that module to be available for the rest of the process (for example, during testing).

import_module(module_name)
curia.infra.utils.load_tasks(project_dir: str, package: str, task_type: Type[T]) List[T]

Loads all tasks in package by importing every module

Parameters:
  • project_dir – The project directory to load tasks from

  • package – The package to load tasks from

  • task_type – The type of task to load

Returns:

curia.infra.utils.describe_tasks(tasks: List[TaskDefinition], verbose=False) None

Describes all listed tasks :param tasks: List of tasks to describe :param verbose: If true, will print out the full description of each task :return: