ballet.templating module

ballet.templating.render_feature_template(**cc_kwargs)[source]

Create a stub for a new feature

Parameters

**cc_kwargs – options for the cookiecutter template

Return type

str

ballet.templating.render_project_template(project_template_path=None, create_github_repo=False, github_token=None, **cc_kwargs)[source]

Generate a ballet project according to the project template

If creating the GitHub repo is requested and the process fails for any reason, quickstart will complete successfully and users are instructed to read the corresponding section of the Maintainer’s Guide to continue manually.

Parameters
  • project_template_path (Union[str, PathLike, None]) – path to specific project template

  • create_github_repo (bool) – whether to act to create the desired repo on GitHub after rendering the project. The repo will be owned by either the user or an org that the user has relevant permissions for, depending on what is entered during the quickstart prompts. If True, then a valid github token must also be provided.

  • github_token (Optional[str]) – valid github token with appropriate permissions

  • **cc_kwargs – options for the cookiecutter template

Return type

str

ballet.templating.start_new_feature(contrib_dir=None, branching=True, **cc_kwargs)[source]

Start a new feature within a ballet project

If run from default branch, by default will attempt to switch to a new branch for this feature, given by <username>/feature-<featurename>. By default, will prompt the user for input using cookiecutter’s input interface.

Renders the feature template into a temporary directory, then copies the feature files into the proper path within the contrib directory.

Parameters
  • contrib_dir (Union[str, PathLike, None]) – directory under which to place contributed features

  • branching (bool) – whether to attempt to manage branching

  • **cc_kwargs – options for the cookiecutter template

Raises

ballet.exc.BalletError – the new feature has the same name as an existing one

Return type

List[Tuple[Path, str]]