https://github.com/omar-abdelgawad/python-project-template
Template repository for python projects
https://github.com/omar-abdelgawad/python-project-template
gh-actions mypy precommit pyproject-toml pytest python3 ruff template tox
Last synced: 4 months ago
JSON representation
Template repository for python projects
- Host: GitHub
- URL: https://github.com/omar-abdelgawad/python-project-template
- Owner: omar-abdelgawad
- License: mit
- Created: 2024-01-07T02:35:08.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-02T13:06:50.000Z (over 1 year ago)
- Last Synced: 2025-03-24T15:47:29.204Z (11 months ago)
- Topics: gh-actions, mypy, precommit, pyproject-toml, pytest, python3, ruff, template, tox
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://opensource.org/license/mit/)
[](https://github.com/omar-abdelgawad/python-project-template/actions)
[](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue)
# Project Name
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.
## Prerequisites
1. Make sure [uv](https://docs.astral.sh/uv/getting-started/installation/#installation-methods) is installed. Here is the install script on macOS and Linux
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```
2. Instead of using `make` as a command runner with `.PHONY` all over the place we use [just](https://just.systems/). 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.
## Installation/Usage
```bash
$ git clone
$ cd
$ uv sync
$ pre-commit install
```
## Testing with tox
Just running `tox` with no args should work.
```bash
$ just tox
```
tox creates virtual environments and runs all of pytest, ruff, and mypy.
## Package(s)
### package1
....
### package2
....