Compare commits
17 Commits
dev
...
renovate/c
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f5a9868b8 | |||
|
|
2ee5715b7a | ||
|
|
e3cc82568a | ||
| 4ad04cdf49 | |||
|
|
d0dafec4cb | ||
| 075041f371 | |||
| 981d5211b6 | |||
| d5cf0a8636 | |||
| 5a1c19ccbe | |||
| 59c90ca471 | |||
| 1e7d45ec49 | |||
| 69e463c9a4 | |||
| b1cdeffb4c | |||
| e2cd6d7ba3 | |||
|
|
70a867e4a1 | ||
| 16b1c131a4 | |||
| 809ce9bdd9 |
@@ -58,7 +58,7 @@ jobs:
|
|||||||
fetch-tags: true # Fetch all tags (refs/tags)
|
fetch-tags: true # Fetch all tags (refs/tags)
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v7
|
uses: astral-sh/setup-uv@v5
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
run: uv python install
|
run: uv python install
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v7
|
uses: astral-sh/setup-uv@v5
|
||||||
|
|
||||||
- name: (optional) Prepare dependencies
|
- name: (optional) Prepare dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
13
.vscode/settings.json
vendored
13
.vscode/settings.json
vendored
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"cSpell.words": [
|
|
||||||
"buildx",
|
|
||||||
"Buildx",
|
|
||||||
"elif",
|
|
||||||
"gitea",
|
|
||||||
"Gitea",
|
|
||||||
"github",
|
|
||||||
"linux",
|
|
||||||
"pyproject",
|
|
||||||
"semapform"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -4,19 +4,17 @@ This can run independently to support the PHP application.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from contextlib import asynccontextmanager
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import urllib.parse
|
from typing import Any, TYPE_CHECKING
|
||||||
from contextlib import asynccontextmanager
|
|
||||||
from typing import TYPE_CHECKING, Any
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from collections.abc import AsyncIterator, Awaitable, Callable
|
from collections.abc import AsyncIterator, Callable, Awaitable
|
||||||
|
|
||||||
# Avoid importing heavy modules at top-level to keep `import api_service` lightweight
|
# Avoid importing heavy modules at top-level to keep `import api_service` lightweight
|
||||||
from fastapi import FastAPI, Query, Request, Response
|
from fastapi import FastAPI, Query, Request, Response
|
||||||
@@ -31,7 +29,7 @@ redis_client = None
|
|||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def _lifespan(_app: FastAPI) -> AsyncIterator[None]:
|
async def _lifespan(_app: FastAPI) -> AsyncIterator[None]:
|
||||||
"""Lifespan handler: connect to Redis on startup and close on shutdown."""
|
"""Lifespan handler: connect to Redis on startup and close on shutdown."""
|
||||||
global redis_client # type: ignore[PLW0603]
|
global redis_client
|
||||||
if REDIS_URL:
|
if REDIS_URL:
|
||||||
try:
|
try:
|
||||||
import redis.asyncio as aioredis
|
import redis.asyncio as aioredis
|
||||||
@@ -161,10 +159,6 @@ async def _cache_set(key: str, value: CacheValue, ttl: int = CACHE_TTL_SECONDS)
|
|||||||
async def validate_signature(signature: str = Query(...)) -> JSONResponse:
|
async def validate_signature(signature: str = Query(...)) -> JSONResponse:
|
||||||
"""Validate a book signature and return total pages."""
|
"""Validate a book signature and return total pages."""
|
||||||
# check cache first
|
# check cache first
|
||||||
# ensure signature is stripped of leading/trailing whitespace
|
|
||||||
signature = signature.strip()
|
|
||||||
# enforce url quotes
|
|
||||||
signature = urllib.parse.quote(signature)
|
|
||||||
cache_key = f"signature:{signature}"
|
cache_key = f"signature:{signature}"
|
||||||
cached = await _cache_get(cache_key)
|
cached = await _cache_get(cache_key)
|
||||||
if cached is not None:
|
if cached is not None:
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ requires-python = ">=3.13"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"bibapi[catalogue]>=0.0.6",
|
"bibapi[catalogue]>=0.0.6",
|
||||||
"fastapi>=0.122.0",
|
"fastapi>=0.122.0",
|
||||||
|
"pip>=25.3",
|
||||||
"uvicorn>=0.38.0",
|
"uvicorn>=0.38.0",
|
||||||
"redis>=4.6.0",
|
"redis>=4.6.0",
|
||||||
]
|
]
|
||||||
@@ -15,7 +16,7 @@ name = "gitea"
|
|||||||
url = "https://git.theprivateserver.de/api/packages/PHB/pypi/simple/"
|
url = "https://git.theprivateserver.de/api/packages/PHB/pypi/simple/"
|
||||||
|
|
||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "0.1.3"
|
current_version = "0.2.0"
|
||||||
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
||||||
serialize = ["{major}.{minor}.{patch}"]
|
serialize = ["{major}.{minor}.{patch}"]
|
||||||
search = "{current_version}"
|
search = "{current_version}"
|
||||||
|
|||||||
3
renovate.json
Normal file
3
renovate.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user