Python 3 Boilerplate
This is a simple boilerplate (project template) for Python 3.
Packages
Pytest is a test framework for Python. It is arguably better than unittest that is included in Python standard library due to its conciseness and flexibility.
Pylint is a linter for Python 3 that adheres to PEP 8, the Python style guide. It helps enforce coding style throughout your package.
Sphinx is a documentation generator that generates HTML pages from the docstrings in the code. We use numpydoc format for docstrings. You can view the sample documentation page here.
TravisCI is a continuous integration(CI) service that is free for open source projects. TravisCI allows you to automate Quality Assurance (QA) and have confidence on deployed code.
Setup
Install necessary packages from PyPI using pip
.
pip install -r requirements.txt
Using Packages
Pytest
Run the following command:
pytest
Pylint
Run the following command:
pylint *
Sphinx
To automatically generate documentation from your code, go to /docs
and run
make autodocs
make html
Using Boilerplate
-
Fork this repository by pressing the 'Fork' button.
-
Find all instances of
package_name
in your forked repository and replace them with your own package name. -
Change the copyright and author information in
docs/source/conf.py
. -
Connect your repository with Travis CI by visiting travis-ci.org. Change status image in
README.md
.