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.
- Host: GitHub
- URL: https://github.com/itsluketwist/python-template
- Owner: itsluketwist
- License: mit
- Created: 2023-10-11T10:05:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-03T18:45:35.000Z (9 months ago)
- Last Synced: 2025-01-24T22:29:23.663Z (4 months ago)
- Topics: package, pyproject, python, template
- Language: Makefile
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# **python-template**


## *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 installpre-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.