Skeleton template for Python projects. Derived from my usual project structure and Kenneth Reitz's repository structure blog post.
In addition to the structure outlined in Kenneth's post, touchstone has the following features:
- Apache Software License 2.0.
- Python Distribute ready.
- Single point of control for version in
touchstone.version.py
. load_rst()
function insetup.py
to load long description from docs.- Prepare Sphinx documentation configuration including intersphinx.
- Populated MANIFEST.in including tests and documentation in packages.
- Empty change log.
To unpack touchstone into clean repository.
$ wget -O - https://github.com/aliles/touchstone/tarball/master | tar -s /aliles-touchstone-......././ -zx $ find . -type f -exec sed -i .bak 's/touchstone/NEWNAME/g' {} \; $ find . -type f -exec sed -i .bak 's/TestTouchstone/TestNEWNAME/g' {} \; $ find . -type f -name \*.bak -exec rm {} \; $ for ORIG in `find . -name \*touchstone\*`; do NEW=`echo $ORIG | sed s/touchstone/NEWNAME/`; mv $ORIG $NEW; done
This will replace all instances of touchstone
with your new project name.
You also need to edit
the README.rst
and LICENSE files.
The requirements.txt
file has been populated
with dependencies for documentation,
static type analysis
and test coverage.
To install these dependencies
execute make's deps
target.
$ make deps
The makefile has the following targets:
deps
, install Python dependencies usingpip
.docs
, build package documention usingSphinx
.lint
, static code analysis of package usingflake8
.dist
, build source distribution for package.tests
, run unit tests using test runner fromsetup.py
.unittest
, run unit tests usingunittest
module test runner.coverage
, generate coverage report from test coverage.clean
, remove all build artifacts.