Skip to content

A simple python template repository, configured how I like to start my personal python projects.

License

Notifications You must be signed in to change notification settings

itsluketwist/python-template

Repository files navigation

python-template

lint code workflow test code workflow release workflow

usage

Once cloned, find and replace all instances of python-template with the new repository name. Remove below README.md sections where appropriate (whether this is a project or library), similarly determine whether the pyproject.toml or requirements.txt files are necessary.

installation

Install directly from GitHub, using pip:

pip install git+https://github.com/itsluketwist/python-template

development

Clone the repository code:

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

(for projects...) Once cloned, install the requirements locally in a virtual environment:

python -m venv .venv

. .venv/bin/activate

pip install -r requirements.txt -r requirements-dev.txt

(for libraries...) Once cloned, install the package locally in a virtual environment:

python -m venv .venv

. .venv/bin/activate

pip install -e ".[dev]"

Install and use pre-commit to ensure code is in a good state (uses ruff):

pre-commit install

pre-commit autoupdate

pre-commit run --all-files

Dependencies are managed with uv, add new packages to requirements.in, then compile:

uv pip compile requirements.in -o requirements.txt

todos

  • Add docs template / support.

testing

Run the test suite using:

pytest .

inspiration

This is currently how I like to make python projects/libraries, it ain't that deep.

About

A simple python template repository, configured how I like to start my personal python projects.

Topics

Resources

License

Stars

Watchers

Forks