joesdesk / pytemplate

A template of a python package including tests, sphinx documentation and data storage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pytemplate

A template for a python package with setup scripts, testing and continuous integration.

Contents

Installing the Package

The python package can be installed directly from github using

pip install --index-url https://github.com/joesdesk/pytemplate pytemplate

It can also be installed from a local source (presumably after being downloaded). In development mode (using the -e option), editing the source files also changes the installed package in real time. First change directory to the repository root

cd path/to/pytemplate

and run

pip install -e ./

To install the package as a normal package, where changing the source files will not change change the installed package without reinstallation, run

pip install ./

Uninstalling the Package

To perform a clean uninstall of the package, run

pip uninstall pytemplate

Running Tests

Having tests to ensure changes don't create new bugs is essential in software development. To run all the tests in the tests/ folder, change directory to the repository root

cd path/to/pytemplate

and run

pytest

sphinx

Sphinx generates documentation for the package. The source code for the documentation is in the sphinx/ folder. It contains a Makefile which can be used to generate the documentation after changes. To generate the documentation, run

make html

The generated documentation is made in the docs/ folder. This allows a github pages website to be created for the documentation of the project in the project's repository.

Resources

  • Documentation Extensions: Include documentation from docstrings. link.
  • reStructuredText Markup Specification. link.
  • The GitHub Blog. Publish Your Project Documentation with GitHub Pages. 2016. link.

About

  • Author: Jomar Sastrillo
  • Date created: November 19, 2017

References

  • PyPA. Installing Packages. link.
  • PyPA. Packaging Python Projects. link.
  • PEAK. Accessing Package Resources. link
  • setuptools Documentation. Resource Extraction. link

About

A template of a python package including tests, sphinx documentation and data storage


Languages

Language:Python 88.2%Language:Makefile 11.8%