betaboon / copier-python

A Copier template for Python projects managed by PDM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Copier Python Template

A Copier template for Python projects managed by PDM.

Features

Package management pdm
Linting and Formatting ruff gitlint
Testing pytest
Git hooks precommit
Documenting sphinx
Documentation hosting githubpages
CI/CD githubactions
Releasing pypi semanticrelease
Container image docker

Installation

To install Copier use pipx:

pip install --user pipx
pipx install copier

As this template uses custom extensions you have to install copier-templates-extensions:

pipx inject copier copier-templates-extensions

Usage

To create a project from this template:

copier copy --trust "gh:betaboon/copier-python" /path/to/project

PDM scripts

This template provides some pdm scripts

Get a full list with pdm run --list:

Name Description
test Run tests
lint Run pre-commit
docs-build Build docs
docs-serve Build and serve docs
install-git-hooks Install pre-commit hooks

GitHub configuration

It is suggested to create a branch-protection rule for main.

For GitHub pages publishing, you need to enable publishing with custom action.

PyPI configuration

For PyPI publishing, you need to create a pypi project with a trusted publisher.

About

A Copier template for Python projects managed by PDM.


Languages

Language:Jinja 85.9%Language:Python 10.4%Language:Nix 2.5%Language:Shell 1.2%