Skip to content

This is a simple project template for python code, including minimal tests examples with `pytest`, and minimal documentation examples with `sphinx`.

License

Notifications You must be signed in to change notification settings

simonverret/python_project_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foo (template project)

Install

Create a virtual environment (optional)

pip install virtualenv
virtualenv env
source env/bin/activate

Install foo and its requirements (developper install)

pip install -e .

Tests

Install dependencies and run the tests

pip install pytest pytest-mock
pytest

View tests coverage

pip install pytest-cov
pytest --cov=foo

Navigate coverage details

coverage html
open htmlcov/index.html

Documentation

Build and navigate the Sphinx documentation

pip install sphinx furo
cd docs
make html
open build/html/index.html

Docstrings are added to the documentation automatically using the napoleon extension to Sphinx (to support Google and Numpy style docstrings). After modifying the code, you can regenerate the automatic pages. This will overwrite any edit to the documentation.

cd docs
sphinx-apidoc -f -o source ..;

About

This is a simple project template for python code, including minimal tests examples with `pytest`, and minimal documentation examples with `sphinx`.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages