Compare commits

...

2 commits

Author SHA1 Message Date
2838efa0c2 ⬆️ ui: upgrade deps
- use yarn 4.12.0
- use node.js v24
- upgrade browserslist db
2026-02-15 21:26:23 +00:00
432533fdad ⬆️ api: upgrade deps
- up python version to 3.14
- `poetry up --latest`
2026-02-15 19:27:29 +01:00
12 changed files with 13643 additions and 8858 deletions

View file

@ -1,50 +1,56 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// 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",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers-extra/features/poetry:2": {},
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
"packages": "git-flow, git-lfs"
},
"ghcr.io/itsmechlark/features/redis-server:1": {}
},
"containerEnv": {
"TZ": "Europe/Berlin"
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"terminal.integrated.defaultProfile.linux": "zsh"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"be5invis.toml",
"mhutchie.git-graph",
"ms-python.python",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort",
"ms-python.vscode-pylance"
]
}
},
"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"
"name": "Advent22 API",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"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"
},
"ghcr.io/itsmechlark/features/redis-server:1": {}
},
"containerEnv": {
"TZ": "Europe/Berlin"
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"terminal.integrated.defaultProfile.linux": "zsh"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"be5invis.toml",
"mhutchie.git-graph",
"ms-python.python",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort",
"ms-python.vscode-pylance"
]
}
},
// 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"
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

View file

@ -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",
}

View file

@ -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,
)

View file

@ -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

File diff suppressed because it is too large Load diff

View file

@ -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"

View file

@ -4,7 +4,7 @@
"name": "Advent22 UI",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/javascript-node:4-20-trixie",
"image": "mcr.microsoft.com/devcontainers/javascript-node:4-24-trixie",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
@ -38,7 +38,7 @@
// "postCreateCommand": "yarn install",
// Use 'postStartCommand' to run commands after the container is started.
"postStartCommand": "npx --yes update-browserslist-db@latest && yarn install --production false"
"postStartCommand": "yarn dlx update-browserslist-db@latest && yarn install"
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

156
ui/.gitignore vendored
View file

@ -1,23 +1,149 @@
.DS_Store
node_modules
/dist
# https://raw.githubusercontent.com/github/gitignore/refs/heads/main/Node.gitignore
# local env files
.env.local
.env.*.local
# Log files
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# Editor directories and files
.idea
# .vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.*
!.env.example
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
.output
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Sveltekit cache directory
.svelte-kit/
# vitepress build output
**/.vitepress/dist
# vitepress cache directory
**/.vitepress/cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# Firebase cache directory
.firebase/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# pnpm
.pnpm-store
# yarn v3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# Vite files
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.vite/

942
ui/.yarn/releases/yarn-4.12.0.cjs vendored Executable file

File diff suppressed because one or more lines are too long

2
ui/.yarnrc.yml Normal file
View file

@ -0,0 +1,2 @@
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.12.0.cjs

View file

@ -2,6 +2,7 @@
"name": "advent22_ui",
"version": "0.1.0",
"private": true,
"packageManager": "yarn@4.12.0",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",

18807
ui/yarn.lock

File diff suppressed because it is too large Load diff