Skip to content

holgi/cookiecutter_pyproject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cookiecutter PyProject

Cookiecutter template for a Python project.

This is heavily inspired the cookiecutter-pypackage by Audrey Roy Greenfeld.

Features

  • flit: build and packaging tool
  • pytest: for running tests, including coverage
  • nox testing: for running extended isolated tests
  • black: the uncompromising code formatter
  • ruff: python linting
  • precommit: a selection of preinstalled pre-commit hooks

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/holgi/cookiecutter_pyproject.git

Then change to the project and setup the repo and development environment:

cd <your project dir>
make repo
source .venv/bin/activate

Make commands in the new project

The new project contains a Makefile defining different commands to ease the developers work:

  • clean: combines the following all clean-* commands into one

  • clean-build: remove build artifacts

  • clean-pyc: remove Python file artifacts

  • clean-test: remove test and coverage artifacts

  • lint: reformat with black and check style with flake8

  • test: run unit tests quickly, without the ones marked as functional, will stop on first error

  • testfunctional: run only tests marked as functional

  • testall: run the complete test suite

  • coverage: runs tests marked as functionalonly, check code coverage and open report

  • coverall: runs all tests, check code coverage and open report

  • tox: run fully isolated tests with tox

  • install: install updated project.toml with flint

  • devenv: setup development environment

  • repo: complete project setup with development environment and git repo

About

A Cookiecutter template for new python projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published