A template for Python projects. This sample package is assumed to be released as a CLI tool.
Install dependencies by pipenv
.
pipenv install # Add `--dev` for development
pipenv shell
cp example.toml config.toml
pipenv run python -m mypkg -d resources/corpora
Follow PEP 8.
flake8 mypkg tests
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
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.