Skip to content

Files

Latest commit

87c8ecf · Jan 19, 2025

History

History
124 lines (86 loc) · 4.03 KB

README_main.md

File metadata and controls

124 lines (86 loc) · 4.03 KB

template-python

 

Tests Quality Checked with mypy Code style: black pdm-managed pre-commit License: MIT

 

Table of Contents

 

User Guide

Requirements

  • Python >= 3.13
  • OS: Ubuntu, MacOS, Windows

Installation

There are three easy ways to install the package.

Using Docker

The easiest way to run the project is to use Docker. First, install Docker. Then, run the following command in the project directory.

make docker

If you do not have make installed, you can run the commands in the Makefile manually.

Download Zip File

Pip installing the package from PyPI is not yet available. Instead, download from this link and unzip. You will also need to change the folder name from template-python-main to template-python (or cd into template-python-main in step 2 below).

Using Git

If you have git installed, simply run

git clone https://github.com/oedokumaci/template-python

to install the package locally. After downloading, here are the steps to install the dependencies in a virtual environment using PDM:

  1. pip install pdm
  2. cd template-python
  3. pdm install --prod

Usage

Configuration

First edit the ./config/config.yaml to your liking. Example config files can be found at ./config/.

Quick Start

After configuring the ./config/config.yaml, simply run the following command in the project directory.

pdm run python -m template_python

Detailed Usage

For a list of all the CLI arguments and options, run

pdm run python -m template_python --help

 

Developer Guide

Makefile

There is a Makefile in the project directory. You can run make help to see the available commands as below. The Makefile is also used in the CI/CD pipeline.

Setup

This project is PDM-managed, which is compatible with PEP 621 (also compatible with the rejected PEP 582). If you are a developer, first pip install pdm and then git clone the project. Next you can pdm install in the project directory, which will install all the dependencies in a virtual environment.

Development

Pre-commit Hooks

The project also uses pre-commit hooks. Because the project uses PDM, you do not need to pip install pre-commit. Instead, run directly

pdm run pre-commit install

in the project directory to install hooks to your local .git. Alternatively, you can also activate the virtual environment and run

pre-commit install