switch to python3.13 and update packages

This commit is contained in:
2025-01-21 09:18:09 +08:00
committed by GitHub
parent 1efea294ad
commit b7728ef3e5
8 changed files with 19 additions and 19 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ updates:
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
interval: monthly
open-pull-requests-limit: 5
allow:
- dependency-type: "all"
@@ -17,9 +17,9 @@ updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
interval: monthly
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
interval: monthly
+2 -2
View File
@@ -27,7 +27,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12.2"
python-version: "3.13.1"
- name: Install Poetry
uses: snok/install-poetry@v1
@@ -41,7 +41,7 @@ jobs:
uses: actions/cache@v4
with:
path: /opt/venv
key: venv-${{ runner.os }}-python-3.12.2-${{ hashFiles('poetry.lock') }}
key: venv-${{ runner.os }}-python-3.13.1-${{ hashFiles('poetry.lock') }}
- name: Install dependencies and actiavte virtualenv
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
+2 -2
View File
@@ -19,7 +19,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12.2"
python-version: "3.13.1"
- name: Install Poetry
uses: snok/install-poetry@v1
@@ -39,7 +39,7 @@ jobs:
uses: actions/cache@v4
with:
path: /opt/venv
key: venv-${{ runner.os }}-python-3.12.2-${{ hashFiles('poetry.lock') }}
key: venv-${{ runner.os }}-python-3.13.1-${{ hashFiles('poetry.lock') }}
- name: Install dependencies and actiavte virtualenv
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
+3 -3
View File
@@ -1,16 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-yaml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
rev: v0.8.2
hooks:
- id: ruff-format
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
rev: v0.8.2
hooks:
- id: ruff
args: [--fix]
+1 -1
View File
@@ -1,4 +1,4 @@
FROM python:3.12-slim-bullseye as base
FROM python:3.13.1-slim-bookworm as base
ENV PYTHONUNBUFFERED 1
WORKDIR /build
+3 -3
View File
@@ -1,6 +1,6 @@
[![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)
[![Python 3.13](https://img.shields.io/badge/python-3.13-blue)](https://docs.python.org/3/whatsnew/3.13.html)
[![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)
[![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)
@@ -60,11 +60,11 @@ See [docs](https://docs.github.com/en/repositories/creating-and-managing-reposit
```bash
cd your_project_name
### Poetry install (python3.12)
### Poetry install (python3.13)
poetry install
```
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)
Note, be sure to use `python3.13` 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)
### 3. Setup database and migrations
+1 -1
View File
@@ -14,7 +14,7 @@ from app.models import User
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="auth/access-token")
async def get_session() -> AsyncGenerator[AsyncSession, None]:
async def get_session() -> AsyncGenerator[AsyncSession]:
async with database_session.get_async_session() as session:
yield session
+4 -4
View File
@@ -71,7 +71,7 @@ async def fixture_setup_new_test_database() -> None:
@pytest_asyncio.fixture(scope="function", autouse=True)
async def fixture_clean_get_settings_between_tests() -> AsyncGenerator[None, None]:
async def fixture_clean_get_settings_between_tests() -> AsyncGenerator[None]:
yield
get_settings.cache_clear()
@@ -85,7 +85,7 @@ async def fixture_default_hashed_password() -> str:
@pytest_asyncio.fixture(name="session", scope="function")
async def fixture_session_with_rollback(
monkeypatch: pytest.MonkeyPatch,
) -> AsyncGenerator[AsyncSession, None]:
) -> AsyncGenerator[AsyncSession]:
# we want to monkeypatch get_async_session with one bound to session
# that we will always rollback on function scope
@@ -108,8 +108,8 @@ async def fixture_session_with_rollback(
@pytest_asyncio.fixture(name="client", scope="function")
async def fixture_client(session: AsyncSession) -> AsyncGenerator[AsyncClient, None]:
transport = ASGITransport(app=fastapi_app) # type: ignore
async def fixture_client(session: AsyncSession) -> AsyncGenerator[AsyncClient]:
transport = ASGITransport(app=fastapi_app)
async with AsyncClient(transport=transport, base_url="http://test") as aclient:
aclient.headers.update({"Host": "localhost"})
yield aclient