This is a modern template for a python project with the pyproject.toml with some fields to change based on project. It also has tox configured, docs dir for github pages, .github dir with tox-gh-actions configured and more.
- pyproject.toml (according to uv)
- setuptools backend (setup.py and setup.cfg)
- the src layout
- tox configured
- docs dir for github pages with a tests.yml ready
- .github dir with a tests.yml configured with tox-gh-actions
- tox configured with pytest, ruff, and mypy
- tests dir for pytest
- justfile for running commands
Please Note that tox is configured with python 3.10,3.11, and 3.12. Feel free to reconfigure everything to your need.
- Make sure uv is installed. Here is the install script on macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
- Instead of using
make
as a command runner with.PHONY
all over the place we use just. You can run the commands manually by yourself instead if you don't want to install it but having your most common run commands in one place is a really good habit.
$ git clone <repo_url>
$ cd <repo_name>
$ uv sync
$ pre-commit install
Just running tox
with no args should work.
$ just tox
tox creates virtual environments and runs all of pytest, ruff, and mypy.
....
....