/python-project-template

Template for Python projects

Primary LanguagePythonMIT LicenseMIT

python-project-template

CircleCI

A template for Python projects. This sample package is assumed to be released as a CLI tool.

Environment

Install dependencies by pipenv.

pipenv install  # Add `--dev` for development 
pipenv shell

How to Use

cp example.toml config.toml
pipenv run python -m mypkg -d resources/corpora

Coding Style

Follow PEP 8.

flake8 mypkg tests

Order of import-statements

Order import-statements as the following.

import python_standard_library

import third_party_library

from mypkg.some_module import some_function
from mypkg.another_module import another_function

This is automatically achieved by isort.

isort --recursive mypkg tests

Testing

Test the source code before merging your changes into the master branch.

pytest

The settings are written in Section [tool:pytest] in setup.cfg and tests/conftest.py.