Giter VIP home page Giter VIP logo

cookiecutter-decaf-python's Introduction

Cookiecutter for python development within DD-DeCaF

Travis-CI Build Status

Cookiecutter template for a python package.

Table of Contents

Features

In the DD-DeCaF project, we aim to write high-quality software that both implements great features and are ensured to be long term operable and sustainable.

In this is a python package cookiecutter template intended for all python development at the center for biosustainability (near copy of the cookiecutter-pypackage). Using this template, it is easy to get your project setup for using

  • Tox for managing test environments for different versions of Python.
  • Travis-CI and AppVeyor for continuous testing.
    • All pushes are triggers testing and tagged pushes to master triggers upload to PyPI
  • Coveralls or for coverage tracking (using Tox).
  • Documentation with Sphinx, ready for ReadTheDocs.
  • Easy version tagging with bumpversion
  • Packaging and code quality checks. This template comes with a tox environment (check) that will:
    • Check if your README.rst is valid.
    • Check if the MANIFEST.in has any issues.
    • Run flake8 (a combo of PEP8, pyflakes and McCabe checks) and pydocstyle

The only differences to cookiecutter-pypackage is the addition of

  • (optional) use of testing and deployment with AppVeyor
  • mandatory use of unit-testing (with pytest)
  • support github organizations

Requirements

Projects using this template have these minimal dependencies:

  • Cookiecutter - just for creating the project
  • Tox - for running the tests
  • Setuptools - for building the package, wheels etc.

To get quickly started on a new system, just install setuptools and then install pip. That's the bare minimum to required install Tox and Cookiecutter. To install them, just run this in your shell or command prompt:

pip install tox cookiecutter

Usage and options

First generate your project:

cookiecutter gh:dd-decaf/cookiecutter-decaf-python

You will be asked for a number of different items, including if you want to use continuous integration (travis / appveyor), code coverage etc. If you create many new packages you may consider adding defaults in ~/.cookiecutterrc.

After this you can create the initial repository (make sure you create an empty Github project):

git init .
git add .
git commit -m "Initial skel."
git remote add origin [email protected]:<organization/user>/<new package>.git
git push -u origin master

Then:

Developing the project

To run all the tests, just run:

tox

To make the documentation:

make docs

To build and verify that the built package is proper and other code QA checks:

make check

Releasing the project

Before relasing a new version, we need to increment the version number and that is done easily using bumpversion. It's as simple as running:

  • bumpversion patch to increase version from 1.0.0 to 1.0.1.
  • bumpversion minor to increase version from 1.0.0 to 1.1.0.
  • bumpversion major to increase version from 1.0.0 to 2.0.0.

Which will also make the commit and the appropriate git tag.

After incrementing the version, but before creating a new release, check that the package tests correctly:

tox
If you don't use Travis/AppVeyor: build the sdist, and if

possible, the bdist_wheel too:

python setup.py clean --all sdist bdist_wheel

And then to make a release of the project on PyPI, we upload the created distribution files using twine:

twine register dist/*
twine upload --skip-existing dist/*

If you do use Travis/AppVeyor: Simply make a release by pushing the new tag:

git push -t <new version>

Which should trigger testing and deployment to PyPI.

cookiecutter-decaf-python's People

Contributors

hredestig avatar midnighter avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.