diff --git a/.github/workflows/build_docker_image.yml b/.github/workflows/build_docker_image.yml index 8d3b6f9..f840b0f 100644 --- a/.github/workflows/build_docker_image.yml +++ b/.github/workflows/build_docker_image.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: "3.11" + python-version: "3.12" - name: Generate projects from templates using cookiecutter # minimal_project folder diff --git a/.github/workflows/manual_build_docker_image.yml b/.github/workflows/manual_build_docker_image.yml index b4bccda..1ca1a1c 100644 --- a/.github/workflows/manual_build_docker_image.yml +++ b/.github/workflows/manual_build_docker_image.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: "3.11" + python-version: "3.12" - name: Generate projects from templates using cookiecutter # minimal_project folder diff --git a/README.md b/README.md index 2da2550..8218c51 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,9 @@ - - Live example - - - License - - - Python - - - Black - - - Tests - +[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) +[![Live example](https://img.shields.io/badge/live%20example-https%3A%2F%2Fminimal--fastapi--postgres--template.rafsaf.pl-blueviolet)](https://minimal-fastapi-postgres-template.rafsaf.pl/) +[![License](https://img.shields.io/github/license/rafsaf/minimal-fastapi-postgres-template)](https://github.com/rafsaf/minimal-fastapi-postgres-template/blob/main/LICENSE) +[![Python 3.12](https://img.shields.io/badge/python-3.12-blue)](https://docs.python.org/3/whatsnew/3.12.html) +[![Black](https://img.shields.io/badge/code%20style-black-lightgrey)](https://github.com/psf/black) +[![Tests](https://github.com/rafsaf/minimal-fastapi-postgres-template/actions/workflows/tests.yml/badge.svg)](https://github.com/rafsaf/minimal-fastapi-postgres-template/actions/workflows/tests.yml) # Minimal async FastAPI + PostgreSQL template @@ -42,9 +33,9 @@ - [x] [Alembic](https://alembic.sqlalchemy.org/en/latest/) migrations - [x] Very minimal project structure yet ready for quick start building new apps - [x] Refresh token endpoint (not only access like in official template) -- [x] Two databases in docker-compose.yml (second one for tests) and ready to go Dockerfile with [Uvicorn](https://www.uvicorn.org/) webserver -- [x] [Poetry](https://python-poetry.org/docs/) and Python 3.11 based -- [x] `pre-commit` with poetry export, autoflake, black, isort and flake8 +- [x] Two databases in docker-compose.yml (second one for tests) and ready to go Dockerfile with [uvicorn](https://www.uvicorn.org/) webserver +- [x] [Poetry](https://python-poetry.org/docs/) and Python 3.12 based +- [x] `pre-commit` with poetry export and [ruff](https://github.com/astral-sh/ruff) - [x] Rich setup for pytest async tests with few included and extensible `conftest.py`
@@ -69,16 +60,16 @@ cookiecutter https://github.com/rafsaf/minimal-fastapi-postgres-template ```bash cd project_name -### Poetry install (python3.11) +### Poetry install (python3.12) poetry install ### Optionally there is also `requirements-dev.txt` file -python3.11 -m venv venv +python3.12 -m venv venv source venv/bin/activate pip install -r requirements-dev.txt ``` -Note, be sure to use `python3.11` with this template with either poetry or standard venv & pip, if you need to stick to some earlier python version, you should adapt it yourself (remove new versions specific syntax for example `str | int` for python < 3.10 or `tomllib` for python < 3.11) +Note, be sure to use `python3.12` with this template with either poetry or standard venv & pip, if you need to stick to some earlier python version, you should adapt it yourself (remove new versions specific syntax for example `str | int` for python < 3.10 or `tomllib` for python < 3.11) ### 3. Setup databases diff --git a/{{cookiecutter.project_name}}/Dockerfile b/{{cookiecutter.project_name}}/Dockerfile index 1f8d1ec..3719523 100644 --- a/{{cookiecutter.project_name}}/Dockerfile +++ b/{{cookiecutter.project_name}}/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11.1-slim-bullseye +FROM python:3.12.0-slim-bullseye ENV PYTHONUNBUFFERED 1 WORKDIR /build