Skip to content

pasunboneleve/baker-uv-template

Repository files navigation

Reproducible Python Project Bootstrap

Overview

Starting a new Python project usually involves rebuilding the same scaffolding: dependency management, test setup, linting, typing, and repository conventions.

This template standardises that bootstrap process using uv and baker, so a new project starts with a working development loop from day one.

Generated projects include:

  • pytest and pytest-watcher for fast feedback
  • ruff for linting
  • pyright for static type checking
  • optional Jupyter support
  • initialises a git repository using local git author configuration

The goal is to reduce setup friction and encourage a consistent, test-first workflow.

How it works

This repository is a project template consumed by baker, a language-agnostic scaffolding tool. baker collects the project parameters, renders the template, and runs hooks to initialise the project directory.

Development tools

  • Jupyter is an interactive Python shell. Its notebook version is implemented as a web server, which makes it possible to present images and many other desirable features. You can run Jupyter notebook with uv run jupyter notebook.

  • pytest-watcher is a test runner that runs tests each time a *.py file is changed in the project. You can configure it to run in response to other file extensions too. Just add something like

    [tool.pytest-watcher]
    patterns = ["*.py", "*.csv", "*.json"]

    to pyproject.toml and it will run the tests when you change JSON or CSV files too.

    You can run pytest-watcher with uv run ptw ..

Dependencies

  • Baker: A command-line tool that helps you quickly scaffold new projects. It is implemented in Rust, but is language-agnostic. You can create projects and write scripts to help scaffolding in any language. The main templating engine uses Mini Jinja.

  • git: This template creates an empty git in the project directory. It also defaults the project author and email to the ones defined in the global git config.

  • bash: The hooks in the present template are written as Bash scripts.

  • jq: We use jq to read variables from the template engine context to our hooks.

  • uv: This template will create Python project scaffolding with the uv package manager. uv is implemented in Rust.

How to use

You can either use a template from your local host or point to a repository in the web:

$ git clone https://github.com/pasunboneleve/baker-uv-template
$ baker ./baker-uv-template <my-project-directory>

or

$ baker https://github.com/pasunboneleve/baker-uv-template <my-project-directory>

About

Reproducible Python project bootstrap with uv, tests, linting and type checking preconfigured.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors