ericdaat / template-python

A template repository for a python package. Pre configured sphinx and pytest.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Template for a python repository

Installation

Use a virtual environment, with python3:

virtualenv venv -p python3;
source venv/bin/activate;

pip install -r requirements.txt  # install existing librairaries
pip install requests;  # install new librairies
pip freeze > requirements.txt  # export the new librairies

Code

Add your code in ./package (and rename the package).

Unit tests

Use pytest for unit testing.

Run your tests with pytest tests.

Docs

Use sphinx for generating the docs from your code.

Use Napoleon style when writing your docstrings.

sphinx-apidoc ./package -o ./docs/source -M;
cd docs;
make clean;
make html;
open docs/build/html/index.html;

About

A template repository for a python package. Pre configured sphinx and pytest.

License:Other


Languages

Language:Python 100.0%