Skip to content

A Python boilerplate project using setuptools as build backend 🐍

License

Notifications You must be signed in to change notification settings

compiuta-origin/python-project-boilerplate

Repository files navigation

🐍 Python Project Boilerplate

We kept this project simple on purpose, it is intended as a starting point for any Python project: ML packages, backend microservices or whatever the best programming language in the world (🐍) is awesome for! For example, we've used it to bootstrap multiple Connhex services.

This project was developed using uv package manager. In particular, we used the uv packaged application concept.

✨ Features

πŸ“ƒ Project Metadata

The pyproject.toml file contains all the metadata for the project, including the project name, version, author, description, supported Python version, and more.

πŸ“¦ Dependencies

All dependencies are managed using uv. In order to add or remove dependencies, follow its documentation.

πŸ“ Linting and formatting

We use ruff for linting and formatting. The configuration can be customized in the pyproject.toml file.

πŸ§ͺ Testing

The project is set up with pytest for testing. All test files should be placed inside the tests folder.

You can change the target tests folder by updating the testpaths variable in the pyproject.toml file.

To run the tests, simply use the following command:

$ uv run pytest

🐳 Docker Support

The project includes a Dockerfile and a docker-build.sh script to build a Docker image of the project.

To build a Docker image of your project, use the following command:

$  ./docker-build.sh

This will create a Docker image with a python-project-boilerplate tag.

🎬 Getting started

  • Install uv

  • Install pre-commit rules:

uv run pre-commit install
  • Run the project:
$ uv run python_project_boilerplate

πŸ’» License

This project is licensed under the MIT License.