Skip to content

Commit 3da7aaa

Browse files
author
rafsaf
committed
switch to python3.13 and update packages
Signed-off-by: rafsaf <[email protected]>
1 parent dfc851d commit 3da7aaa

File tree

11 files changed

+1038
-1032
lines changed

11 files changed

+1038
-1032
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,21 @@ updates:
33
- package-ecosystem: pip
44
directory: /
55
schedule:
6-
interval: weekly
6+
interval: monthly
77
open-pull-requests-limit: 5
88
allow:
99
- dependency-type: "all"
1010
groups:
1111
all-dependencies:
1212
patterns:
1313
- "*"
14-
exclude-patterns:
15-
- "pytest-asyncio"
1614

1715
- package-ecosystem: github-actions
1816
directory: /
1917
schedule:
20-
interval: weekly
18+
interval: monthly
2119

2220
- package-ecosystem: docker
2321
directory: /
2422
schedule:
25-
interval: weekly
23+
interval: monthly

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Set up Python
3030
uses: actions/setup-python@v5
3131
with:
32-
python-version: "3.12.2"
32+
python-version: "3.13.1"
3333

3434
- name: Install Poetry
3535
uses: snok/install-poetry@v1
@@ -43,7 +43,7 @@ jobs:
4343
uses: actions/cache@v4
4444
with:
4545
path: /opt/venv
46-
key: venv-${{ runner.os }}-python-3.12.2-${{ hashFiles('poetry.lock') }}
46+
key: venv-${{ runner.os }}-python-3.13.1-${{ hashFiles('poetry.lock') }}
4747

4848
- name: Install dependencies and actiavte virtualenv
4949
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'

.github/workflows/type_check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Set up Python
2222
uses: actions/setup-python@v5
2323
with:
24-
python-version: "3.12.2"
24+
python-version: "3.13.1"
2525

2626
- name: Install Poetry
2727
uses: snok/install-poetry@v1
@@ -41,7 +41,7 @@ jobs:
4141
uses: actions/cache@v4
4242
with:
4343
path: /opt/venv
44-
key: venv-${{ runner.os }}-python-3.12.2-${{ hashFiles('poetry.lock') }}
44+
key: venv-${{ runner.os }}-python-3.13.1-${{ hashFiles('poetry.lock') }}
4545

4646
- name: Install dependencies and actiavte virtualenv
4747
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-yaml
66

77
- repo: https://github.com/astral-sh/ruff-pre-commit
8-
rev: v0.3.0
8+
rev: v0.8.2
99
hooks:
1010
- id: ruff-format
1111

1212
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: v0.3.0
13+
rev: v0.8.2
1414
hooks:
1515
- id: ruff
1616
args: [--fix]

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.12.5-slim-bullseye as base
1+
FROM python:3.13.1-slim-bookworm as base
22

33
ENV PYTHONUNBUFFERED 1
44
WORKDIR /build

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![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/)
22
[![License](https://img.shields.io/github/license/rafsaf/minimal-fastapi-postgres-template)](https://github.com/rafsaf/minimal-fastapi-postgres-template/blob/main/LICENSE)
3-
[![Python 3.12](https://img.shields.io/badge/python-3.12-blue)](https://docs.python.org/3/whatsnew/3.12.html)
3+
[![Python 3.13](https://img.shields.io/badge/python-3.13-blue)](https://docs.python.org/3/whatsnew/3.13.html)
44
[![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)
55
[![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)
66

@@ -60,11 +60,11 @@ See [docs](https://docs.github.com/en/repositories/creating-and-managing-reposit
6060
```bash
6161
cd your_project_name
6262

63-
### Poetry install (python3.12)
63+
### Poetry install (python3.13)
6464
poetry install
6565
```
6666

67-
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)
67+
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)
6868

6969
### 3. Setup database and migrations
7070

app/api/deps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="auth/access-token")
1515

1616

17-
async def get_session() -> AsyncGenerator[AsyncSession, None]:
17+
async def get_session() -> AsyncGenerator[AsyncSession]:
1818
async with database_session.get_async_session() as session:
1919
yield session
2020

app/tests/conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def fixture_setup_new_test_database() -> None:
7676

7777

7878
@pytest_asyncio.fixture(scope="function", autouse=True)
79-
async def fixture_clean_get_settings_between_tests() -> AsyncGenerator[None, None]:
79+
async def fixture_clean_get_settings_between_tests() -> AsyncGenerator[None]:
8080
yield
8181

8282
get_settings.cache_clear()
@@ -90,7 +90,7 @@ async def fixture_default_hashed_password() -> str:
9090
@pytest_asyncio.fixture(name="session", scope="function")
9191
async def fixture_session_with_rollback(
9292
monkeypatch: pytest.MonkeyPatch,
93-
) -> AsyncGenerator[AsyncSession, None]:
93+
) -> AsyncGenerator[AsyncSession]:
9494
# we want to monkeypatch get_async_session with one bound to session
9595
# that we will always rollback on function scope
9696

@@ -114,8 +114,8 @@ async def fixture_session_with_rollback(
114114

115115

116116
@pytest_asyncio.fixture(name="client", scope="function")
117-
async def fixture_client(session: AsyncSession) -> AsyncGenerator[AsyncClient, None]:
118-
transport = ASGITransport(app=fastapi_app) # type: ignore
117+
async def fixture_client(session: AsyncSession) -> AsyncGenerator[AsyncClient]:
118+
transport = ASGITransport(app=fastapi_app)
119119
async with AsyncClient(transport=transport, base_url="http://test") as aclient:
120120
aclient.headers.update({"Host": "localhost"})
121121
yield aclient
@@ -124,7 +124,7 @@ async def fixture_client(session: AsyncSession) -> AsyncGenerator[AsyncClient, N
124124
@pytest_asyncio.fixture(name="default_user", scope="function")
125125
async def fixture_default_user(
126126
session: AsyncSession, default_hashed_password: str
127-
) -> AsyncGenerator[User, None]:
127+
) -> AsyncGenerator[User]:
128128
default_user = User(
129129
user_id=default_user_id,
130130
email=default_user_email,

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
services:
88
postgres_db:
99
restart: unless-stopped
10-
image: postgres:16
10+
image: postgres:17
1111
volumes:
1212
- postgres_db:/var/lib/postgresql/data
1313
environment:

0 commit comments

Comments
 (0)