Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-13964

Create CLI (templatekit) to use the lsst/templates repository

    Details

      Description

      Create a CLI for https://github.com/lsst/templates. This CLI should provide an interface for discovering templates, and then rendering templates. (We can’t reasonably use Cookiecutter alone because the Cookiecutter CLI doesn’t understand our single-file Jinja2 templates).

      The CLI will be created with the Click library.

        Attachments

          Activity

          Hide
          jsick Jonathan Sick added a comment -

          This PR adds a CLI called templatekit that is available when someone checks out the templates repo and installs its Python package. The purpose of this templatekit CLI is to let users create projects from the templates. We can't use just straight Cookiecutter here because Cookiecutter only understands the project templates, not the file templates.

          templatekit is built with Click. Internally, it uses the templatekit package that's already used by the Scons CI pipeline. Cookiecutter itself prompts the user to fill in template values.

          templatekit is built around sub-commands, like Git. The implemented sub-commands are:

          • help — show docs for a subcommand.
          • list — list file and/or project templates.
          • make — create a file/project given a named template.

          The templatekit make includes some neat functionality. By passing the c/copy option, templatekit copies the file to the clipboard (for file templates only). You can also set the destination file or project directory path with the -o/-output option.

          The README includes a Getting Started tutorial that covers the basic functionality of templatekit.

          Show
          jsick Jonathan Sick added a comment - This PR adds a CLI called templatekit that is available when someone checks out the templates repo and installs its Python package. The purpose of this templatekit CLI is to let users create projects from the templates. We can't use just straight Cookiecutter here because Cookiecutter only understands the project templates, not the file templates. templatekit is built with Click . Internally, it uses the templatekit package that's already used by the Scons CI pipeline. Cookiecutter itself prompts the user to fill in template values. templatekit is built around sub-commands, like Git. The implemented sub-commands are: help — show docs for a subcommand. list — list file and/or project templates. make — create a file/project given a named template. The templatekit make includes some neat functionality. By passing the c/ copy option, templatekit copies the file to the clipboard (for file templates only). You can also set the destination file or project directory path with the -o/ -output option. The README includes a Getting Started tutorial that covers the basic functionality of templatekit .
          Hide
          krughoff Simon Krughoff added a comment -

          Minor comments in PR.

          Show
          krughoff Simon Krughoff added a comment - Minor comments in PR.

            People

            • Assignee:
              jsick Jonathan Sick
              Reporter:
              jsick Jonathan Sick
              Reviewers:
              Simon Krughoff
              Watchers:
              Jonathan Sick, Simon Krughoff
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel