My Python project template
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Python Template Repository

This repository can serve as a starting point when making a new Python module.

It is set up for:

  • Knowing its checkout version via git
  • Automatic documentation using Sphinx
  • Unit testing
  • Setuptools for installation

Files and Folders

The root folder contains:

  • .gitattributes / .gitignore: Git control files
  • Git versioning clean and smudge filters.
  • Makefile / basic setup for Sphinx + sphinx-apidoc to do HTML documentation only
  • index.rst: the documentation main page
  • SPEC.rst: the package specification
  • TODO.rst: a todo list
  • This file.
  • The setuptools file.

Subfolders are:

  • bin: Place user-facing scripts here which should go onto the system PATH
  • lib: Modules and code
  • tests: Unit tests

How to Use

  1. After cloning run this to enable the versioning hooks (after this, git checkout should automatically update python --install -- you can update the version number for the first time (and test the hook) by running: sh .git/hooks/post-checkout
  2. Read TODO.rst, SPEC.rst, index.rst
  3. Look at the example code in lib, test, and bin
  4. To run unit tests, run python test
  5. To make documentation, run make, then check doc/html
  6. To install in development mode (useful when still changing code): python build develop
  7. To install in system-wide: python build install