mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2026-02-25 02:20:17 +00:00
⬆️ api: upgrade deps
- up python version to 3.14 - `poetry up --latest`
This commit is contained in:
parent
6c0c45643a
commit
432533fdad
6 changed files with 1504 additions and 1085 deletions
|
|
@ -2,19 +2,24 @@
|
|||
// README at: https://github.com/devcontainers/templates/tree/main/src/python
|
||||
{
|
||||
"name": "Advent22 API",
|
||||
|
||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||
"image": "mcr.microsoft.com/vscode/devcontainers/python:1-3.11-bookworm",
|
||||
"image": "mcr.microsoft.com/devcontainers/python:3-3.14-trixie",
|
||||
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/git-lfs:1": {},
|
||||
"ghcr.io/devcontainers-extra/features/poetry:2": {},
|
||||
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
|
||||
"packages": "git-flow, git-lfs"
|
||||
"packages": "git-flow"
|
||||
},
|
||||
"ghcr.io/itsmechlark/features/redis-server:1": {}
|
||||
},
|
||||
|
||||
"containerEnv": {
|
||||
"TZ": "Europe/Berlin"
|
||||
},
|
||||
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
// Configure properties specific to VS Code.
|
||||
|
|
@ -36,15 +41,16 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
"postCreateCommand": "sudo /usr/local/py-utils/bin/poetry self add poetry-plugin-up",
|
||||
|
||||
// Use 'postStartCommand' to run commands after the container is started.
|
||||
"postStartCommand": "poetry install"
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
// "features": {},
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "pip3 install --user -r requirements.txt",
|
||||
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "root"
|
||||
}
|
||||
35
api/.vscode/settings.json
vendored
35
api/.vscode/settings.json
vendored
|
|
@ -1,20 +1,33 @@
|
|||
{
|
||||
"python.languageServer": "Pylance",
|
||||
"editor.formatOnSave": true,
|
||||
"[python]": {
|
||||
"editor.defaultFormatter": "ms-python.black-formatter"
|
||||
},
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": "explicit"
|
||||
},
|
||||
"git.closeDiffOnOperation": true,
|
||||
|
||||
"[python]": {
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "ms-python.black-formatter",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": "explicit",
|
||||
"source.fixAll": "explicit",
|
||||
},
|
||||
},
|
||||
|
||||
"python.languageServer": "Pylance",
|
||||
"python.analysis.autoImportCompletions": true,
|
||||
"python.analysis.importFormat": "relative",
|
||||
"python.analysis.fixAll": [
|
||||
"source.convertImportFormat",
|
||||
"source.unusedImports",
|
||||
],
|
||||
"python.analysis.typeCheckingMode": "basic",
|
||||
"python.analysis.diagnosticMode": "workspace",
|
||||
"python.testing.pytestArgs": [
|
||||
"test"
|
||||
],
|
||||
|
||||
"python.testing.unittestEnabled": false,
|
||||
"python.testing.pytestEnabled": true,
|
||||
"python.testing.pytestArgs": [
|
||||
"--import-mode=importlib",
|
||||
"test",
|
||||
],
|
||||
|
||||
"black-formatter.importStrategy": "fromEnvironment",
|
||||
"flake8.importStrategy": "fromEnvironment",
|
||||
"isort.importStrategy": "fromEnvironment",
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import colorsys
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from typing import Self, TypeAlias, cast
|
||||
from typing import AnyStr, Self, TypeAlias
|
||||
|
||||
import numpy as np
|
||||
from PIL import Image as PILImage
|
||||
|
|
@ -56,7 +56,7 @@ class AdventImage:
|
|||
async def get_text_box(
|
||||
self,
|
||||
xy: _XY,
|
||||
text: str | bytes,
|
||||
text: AnyStr,
|
||||
font: FreeTypeFont,
|
||||
anchor: str | None = "mm",
|
||||
**text_kwargs,
|
||||
|
|
@ -95,12 +95,12 @@ class AdventImage:
|
|||
pixel_data = np.asarray(self.img.crop(box))
|
||||
mean_color: np.ndarray = np.mean(pixel_data, axis=(0, 1))
|
||||
|
||||
return cast(_RGB, tuple(mean_color.astype(int)))
|
||||
return _RGB(mean_color.astype(int))
|
||||
|
||||
async def hide_text(
|
||||
self,
|
||||
xy: _XY,
|
||||
text: str | bytes,
|
||||
text: AnyStr,
|
||||
font: FreeTypeFont,
|
||||
anchor: str | None = "mm",
|
||||
**text_kwargs,
|
||||
|
|
@ -135,14 +135,14 @@ class AdventImage:
|
|||
tc_v -= 3
|
||||
|
||||
text_color = colorsys.hsv_to_rgb(tc_h, tc_s, tc_v)
|
||||
text_color = tuple(int(val) for val in text_color)
|
||||
text_color = _RGB(int(val) for val in text_color)
|
||||
|
||||
# Buchstaben verstecken
|
||||
ImageDraw.Draw(self.img).text(
|
||||
xy=xy,
|
||||
text=text,
|
||||
font=font,
|
||||
fill=cast(_RGB, text_color),
|
||||
fill=text_color,
|
||||
anchor=anchor,
|
||||
**text_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ from typing import Callable, Hashable
|
|||
import requests
|
||||
from cachetools.keys import hashkey
|
||||
from CacheToolsUtils import RedisCache as __RedisCache
|
||||
from redis.commands.core import ResponseT
|
||||
from redis.typing import EncodableT
|
||||
from redis.typing import EncodableT, ResponseT
|
||||
from webdav3.client import Client as __WebDAVclient
|
||||
|
||||
|
||||
|
|
|
|||
2407
api/poetry.lock
generated
2407
api/poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -9,24 +9,24 @@ name = "advent22_api"
|
|||
version = "0.1.0"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
Pillow = "^10.2.0"
|
||||
asyncify = "^0.9.2"
|
||||
cachetools = "^5.3.3"
|
||||
cachetoolsutils = "^8.5"
|
||||
fastapi = "^0.103.1"
|
||||
markdown = "^3.6"
|
||||
numpy = "^1.26.4"
|
||||
pydantic-settings = "^2.2.1"
|
||||
python = ">=3.11,<3.13"
|
||||
redis = {extras = ["hiredis"], version = "^5.0.3"}
|
||||
tomli-w = "^1.0.0"
|
||||
uvicorn = {extras = ["standard"], version = "^0.23.2"}
|
||||
webdavclient3 = "^3.14.6"
|
||||
Pillow = "^12.1.1"
|
||||
asyncify = "^0.12.1"
|
||||
cachetools = "^7.0.1"
|
||||
cachetoolsutils = "^11.0"
|
||||
fastapi = "^0.129.0"
|
||||
markdown = "^3.10.2"
|
||||
numpy = "^2.4.2"
|
||||
pydantic-settings = "^2.13.0"
|
||||
python = ">=3.11,<3.15"
|
||||
redis = {extras = ["hiredis"], version = "^7.1.1"}
|
||||
tomli-w = "^1.2.0"
|
||||
uvicorn = {extras = ["standard"], version = "^0.40.0"}
|
||||
webdavclient3 = "^3.14.7"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
black = "^24.3.0"
|
||||
flake8 = "^7.0.0"
|
||||
pytest = "^8.1.1"
|
||||
black = "^26.1.0"
|
||||
flake8 = "^7.3.0"
|
||||
pytest = "^9.0.2"
|
||||
|
||||
[build-system]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
|
|
|||
Loading…
Reference in a new issue