Skip to content

🍪 Cookiecutter template for Class Based Toil pipelines.

License

Notifications You must be signed in to change notification settings

papaemmelab/cookiecutter-toil

Repository files navigation

cookiecutter-toil

pypi badge gitter badge travis badge pyup badge

A cookiecutter for the creation of toil pipelines.

pip install cookiecutter
cookiecutter https://github.com/papaemmelab/cookiecutter-toil

Live Example

travis badge codecov badge

Check out toil_example, this project is updated automatically with every new commit on cookiecutter-toil.

Features

  • 🐳   Containerized System Calls

    The commands.BaseJob inherits from ContainerJob, a Job Class used to run commands with either Docker, Singularity or Python's subprocess. See toil_container to learn more.

    A Dockerfile example is included. If you use singularity, the generated README will include information on how to generate a singularity image.

  • 📦   Pip Installable Project

    Check the setup.py and setup.json for pip configurations. The only place where you have to define the version of your project is in the VERSION file. After generated, your project can be installed with:

      # local install
      pip install --editable <your_project_dir>
    
      # after deployment - check the continuous integration section
      pip install <your_project_name>
    
  • 🍉   Python Modules

    Module Description
    cli.py Include the function that is mapped to the cli command, see setup.json:entry_points
    commands.py Include a toil example pipeline
    exceptions.py Include package specific exceptions
    utils.py Multiple util functions are available
    validators.py Defines common validators
  • 🚧   Contributing Features

    File Description
    README.md with some example sections
    .gitignore with well curated python ignore patterns
    .gitmessage with issue types mapped to emojis! Like 🚀 for a new feature, or 🐛 for a fix
    .github Contributing guidelines, code of conduct, issue and PR templates
  • ✅   Testing Suite

    Pytest: python test examples are included, give them a try with:

      py.test tests
    

    Pylint: Google style linting configuration is included with the .pylintrc. Additionally, Docstrings conventions are tested with pydocstyle and are defined in .pydocstylerc.

      # check linting conventions
      pylint --rcfile={your_project_dir}/.pylintrc {your_project}
    
      # check docstrings
      pydocstyle --config={your_project_dir}/.pydocstylerc {your_project}
    

    Tox: Run pytest, pylint, pydocstyle with coverage on isolated python environments at the same time:

      tox
    
  • 🌀   Continuous Integration

    Travis CI configuration with automatic deployment to PyPi with tags on master. To encrypt your PyPi password simply run:

      # you need travis (e.g. brew install travis)
      travis encrypt --add deploy.password
    

    Check out this tutorial if you want to learn more about deployment.

  • 🐁   Click Mode

    Click is an great package to seamlessly build CLI packages. Use cli_type="click" if you want to use the goodies of this cookiecutter but don't need the toil rocketry. By using this mode, some of the toil specific modules and tests will be removed.

Contributing

Please see the CONTRIBUTING.md in this repository!