Skip to content

A cookiecutter template for projects in the Rendeiro lab

Notifications You must be signed in to change notification settings

rendeirolab/_project_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A template repository for new projects

This template uses cookiecutter to create a new project instance.

The contents of the template can be seen here. Varibles with {{ cookiecuter... }} will be replaced with the values given at the time of repository creation from the template.

Usage

Install cookiecutter and use it in the following manner:

python -m pip install cookiecutter
cookiecutter gh:rendeirolab/_project_template

You can also clone the repository and point to its path as sole argument.

Fields to be provided are:

  • [required] project_slug: A consise and unique string for the project (no whitespace).
  • project_description: A human readable description of the project.
  • editor: Which text editor is being used - will generate a few auxiliary files for specific editors.
  • zenodo_doi: A DOI for data used/produced by the project.
  • biorxiv_doi: A DOI for the project's preprint.
  • full_name: The user's full name.
  • username: The user's username (no whitespace).
  • email: The user's email.
  • [do not change] template_version: This will keep track of what template version was used to

Defaults

To have default values filled in (e.g. username, email) create a .cookiecutterrc file or use a COOKIECUTTER_CONFIG environmental variable as described here. The file should have, for example:

default_context:
    full_name: "Audrey Roy"
    username: "aroy"
    email: "[email protected]"

Authenticating with git/Github

To use SSH to authenticate with Github (recommended):

  1. Generate a ssh-key with the command: ssh-keygen
  2. Add the generated public key to your Github profile settings
  3. Make cookiecutter use SSH by default by adding to your ~/.cookiecutterrc file:
abbreviations:
    gh: [email protected]:{0}.git

Alternatively, you can continue to use HTTPS (default) but if you have two factor authentication activated in your Github profile (highly recommended), you will have to:

  1. Create a Github application token.
  2. Provide that as your Github password when interacting with Github using git/cookiecutter.

Editing

To make modifications/improvements to the template open a pull request on GitHub.

When merging the PR, make sure to:

  1. Add the modifications to the Changelog
  2. Increment the version number on cookiecutter.json.