Skip to content

Cookiecutter/Cruft template for a Python package managed with Poetry.

License

Notifications You must be signed in to change notification settings

psolsfer/Cookiecutter-PyPackage-Poet

Repository files navigation

Cookiecutter PyPackage Poet


Docs Documentation Status
GitHub Cookiecutter PyPackage Poet project Forks Stars Issues
Code style linting - Ruff code style - Ruff formatter types - Mypy
License License - BSD-3-Clause

Cookiecutter / Cruft template for a Python package, based on [audreyfeldroy] and [radix-ai] Cookiecutter packages.

Features

Project Setup and Management

  • Cruft: Keeps the project templates up-to-date
  • Poetry: A tool for dependency management and packaging in Python
  • Auto-release to PyPi when you push a new tag to main branch (optional)

Code Quality Assurance

  • Ruff and Black: Ensure your code is clean and adheres to style guidelines with automated code linting and formatting.
  • Pre-commit: Managing and maintaining multi-language pre-commit hooks to ensure code quality
  • Static type checking with Mypy and data validation using Pydantic's type annotations
  • Automatic check for dependency updates with Dependabot

Testing

  • Testing setup with unittest and pytest
  • tox testing: Setup to easily test for Python 3.10 and 3.11
  • Test coverage with Coverage.py

Documentation

Versioning and Release Notes

  • Commitizen: Streamline your versioning workflow with semantic versioning and automatic changelog generation.
  • Automated release notes drafting process as pull requests are merged into master with Release Drafter.

Command Line Interface

  • Optional CLI using Click, Typer or argparse.

Development Tasks

  • Development tasks (lint, format, test, etc) wrapped up in a python CLI with Invoke.

Usage

For a brief tutorial, refer to the refer to the Tutorial section of the documentation.

The prompts that need to be filled during the creation of the package are described in Prompts.

Updating a project

An existing project can be updated to the latest template using:

cruft update

Alternative templates

Any of the following alternatives is most mature than the current template, and recommended to use:

Credit

The following templates were used as basis and inspiration for the creation of some parts of this template:

About

Cookiecutter/Cruft template for a Python package managed with Poetry.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages