Skip to content

FollowTheProcess/python_copier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Copier

License GitHub CI

A python package template letting you bootstrap development at the bleeding edge of modern python!

Features

The project template comes with a ready to go GitHub Actions configuration file which automates all your code quality checks:

Easy environment management, package management and task automation with hatch:

  • Create a virtual environment with hatch env create
  • Run dev tests and lint checks with hatch run check

Production ready docs with MkDocs and GitHub Pages. Sphinx has been the go to for python documentation but MkDocs offers easier configuration and documentation in markdown.

Project template comes with configured mkdocs.yml config file for a beautiful theme, all you need to do is add your markdown files and reference them in your nav tree!

Examples of MkDocs sites include FastAPI, Typer, isort and more!

When you're ready to deploy your documentation, just run:

mkdocs gh-deploy

And your docs will be right there next to your code on GitHub Pages

This also happens when you push a new tag to main as part of a release (see below)!

Easy Versioning

Pre-configured version bumping with tag, all you need to do when you're ready for a new version is:

tag patch --push # Possible: patch, minor, major

And your new version will be pushed up in a new commit and tag.

You can also choose to automatically release your new version to PyPI if your CI passes by creating a PyPI API Token and saving it in a repository secret named PYPI_API_TOKEN

  • Don't worry, your package will only be uploaded to PyPI if all other CI actions pass (testing, linting, building docs etc.)

PEP 621 Ready

This template supports PEP 621, which allows for the placement of project metadata in pyproject.toml.

GitHub Issue Labelling

Series of helpful labels that you can use to categorise issues and pull requests. These come in especially handy when combined with the Release Drafter workflow!

Automatic Release Drafts

Automatically generate release notes with the Release Drafter workflow. This uses the labels from issues and pull requests to draft pretty and detailed release notes for your GitHub releases.

This is automatically run when you push a new tag to main.

Usage

  • Ensure you have copier installed:
pipx install copier
  • Navigate to where you keep your projects

  • Call copier with this template and answer all the questions

copier copy gh:FollowTheProcess/copier_pypackage /path/to/put/your/new/project
  • Create a virtual environment (hatch env create), a git repo and start developing

  • Make a first commit and set up the github repo

  • That should be it! from now on everything will be handled automatically. All you need to do is write code, tests and docs! Your code will be style checked, your tests will be run on every push/pull request.