Skip to content

ZordoC/cookiecutter-simple-pypackage

 
 

Repository files navigation

Cookiecutter Simple PyPackage

Updates Build Status Documentation Status

Cookiecutter template for a Python package.

Features

  • Testing setup with pytest.
  • Formatting (black, docformatter, isort).
  • Linting (flake8, pylint).
  • Pre-commit configured.
  • Sphinx_ docs: Documentation ready for generation with, for example, `Read the Docs`_

Quickstart

Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):

pip install -U cookiecutter

Generate a Python package project:

cookiecutter https://github.com/ZordoC/cookiecutter-simple-pypackage/

Local development

cd <package-name>;

python -m venv .venv

. .venv/bin/activate

make venv-dev

git init

pre-commit install

git add .

git commit -m "First commit"

Dev Container (VScode)

There's a development Dockerfile stored in docker/, highly recommend having distinct Dockerfiles for different enviroments. You need to have remote-container VScode extension installed, once you have that:

  1. Open folder with VScode.
  2. Open Pallet CMD + SHIFT + P (MacOS).
  3. Select Remote-Containers: Reopen in container.
  4. git init; pre-commit install; git add . ; git commit -m "Stuff"

Run tests, linters & formatters.

make tests

make format

make lint

Documentation

Pre-built documentation setup!

make docs

Distribute your package

You can distribute via wheel file (https://www.reddit.com/r/learnpython/comments/78xtap/eli5_python_wheels/).

make dist

For more details, see the cookiecutter-pypackage tutorial.

About

Cookiecutter simpliefied template for a Python package.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 84.3%
  • Makefile 12.8%
  • Batchfile 2.8%
  • Shell 0.1%