mirror of
https://github.com/furyhawk/listen.git
synced 2026-07-20 08:25:34 +00:00
switch to python3.13 and update packages
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[](https://minimal-fastapi-postgres-template.rafsaf.pl/)
|
||||
[](https://github.com/rafsaf/minimal-fastapi-postgres-template/blob/main/LICENSE)
|
||||
[](https://docs.python.org/3/whatsnew/3.12.html)
|
||||
[](https://docs.python.org/3/whatsnew/3.13.html)
|
||||
[](https://github.com/astral-sh/ruff)
|
||||
[](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
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user