An open API service indexing awesome lists of open source software.

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

A simple python template repository, configured how I like to start my personal python projects.
https://github.com/itsluketwist/python-template

package pyproject python template

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# **python-template**

![lint code workflow](https://github.com/itsluketwist/python-template/actions/workflows/lint.yaml/badge.svg)
![test code workflow](https://github.com/itsluketwist/python-template/actions/workflows/test.yaml/badge.svg)
![release workflow](https://github.com/itsluketwist/python-template/actions/workflows/release.yaml/badge.svg)





MIT License


Python 3

## *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:

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

## *development*

Clone the repository code:

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

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

```shell
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:

```shell
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](https://astral.sh/ruff)):

```shell
pre-commit install

pre-commit autoupdate

pre-commit run --all-files
```

Dependencies are managed with [uv](https://astral.sh/blog/uv), add new packages to `requirements.in`, then compile:

```shell
uv pip compile requirements.in -o requirements.txt
```

## *todos*

- Add docs template / support.

## *testing*

Run the test suite using:

```shell
pytest .
```

## *inspiration*

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