diff --git a/Dockerfile b/Dockerfile index 01c24bc43..45bec6a5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,12 @@ ENV PYTHONUNBUFFERED=1 \ PATH="/root/.local/bin:$PATH" # כלים לבניית חבילות heavy (wheels) -RUN apt-get update -y && apt-get upgrade -y && \ +RUN set -eux; \ + . /etc/os-release; \ + printf 'deb http://deb.debian.org/debian %s main contrib non-free non-free-firmware\n' "$VERSION_CODENAME" > /etc/apt/sources.list.d/non-free.list; \ + printf 'deb http://deb.debian.org/debian %s-updates main contrib non-free non-free-firmware\n' "$VERSION_CODENAME" >> /etc/apt/sources.list.d/non-free.list; \ + printf 'deb http://security.debian.org/debian-security %s-security main contrib non-free non-free-firmware\n' "$VERSION_CODENAME" >> /etc/apt/sources.list.d/non-free.list; \ + apt-get update -y && apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ build-essential \ python3-dev \ @@ -72,7 +77,12 @@ ENV NODE_MAJOR=${NODE_MAJOR} \ NODE_VERSION=${NODE_VERSION} # חבילות Runtime הנדרשות (כולל Playwright deps מלאים) -RUN apt-get update -y && apt-get upgrade -y && \ +RUN set -eux; \ + . /etc/os-release; \ + printf 'deb http://deb.debian.org/debian %s main contrib non-free non-free-firmware\n' "$VERSION_CODENAME" > /etc/apt/sources.list.d/non-free.list; \ + printf 'deb http://deb.debian.org/debian %s-updates main contrib non-free non-free-firmware\n' "$VERSION_CODENAME" >> /etc/apt/sources.list.d/non-free.list; \ + printf 'deb http://security.debian.org/debian-security %s-security main contrib non-free non-free-firmware\n' "$VERSION_CODENAME" >> /etc/apt/sources.list.d/non-free.list; \ + apt-get update -y && apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ libasound2 \ libatk-bridge2.0-0 \ @@ -96,6 +106,8 @@ RUN apt-get update -y && apt-get upgrade -y && \ fonts-dejavu \ fonts-jetbrains-mono \ fonts-cascadia-code \ + fonts-ubuntu \ + fonts-unifont \ tzdata \ curl \ ca-certificates \ diff --git a/README.md b/README.md index d25d3a19e..6c2719fef 100644 --- a/README.md +++ b/README.md @@ -391,6 +391,11 @@ docker build -t code-keeper-bot . docker run -d --env-file .env code-keeper-bot ``` +#### פונטים בבניית Docker +- הבילד מתקין את `fonts-unifont` ו-`fonts-ubuntu` (חבילות `fonts-*` העדכניות) כדי להבטיח Fallback מלא ליוניקוד בממשק ה-WebApp. +- אין צורך להתקין עוד את החבילות הישנות `ttf-unifont` / `ttf-ubuntu-font-family`, מאחר שהן הוצאו ממאגרי Debian וההחלפה מתרחשת אוטומטית בבנייה. +- אם אתם מריצים Docker מקומי, ודאו שהבנייה מסתיימת בלי הודעות `has no installation candidate`; אחרת עדכנו את Mirror/Cache המקומי. + ## 📚 שימוש ### התחלת עבודה diff --git a/github_menu_handler.py b/github_menu_handler.py index 314bb4242..7235a2d9d 100644 --- a/github_menu_handler.py +++ b/github_menu_handler.py @@ -36,8 +36,25 @@ def http_request(method, url, **kwargs): return requests.get(url, **kwargs) return _http_sync_request(method, url, **kwargs) -from github import Github, GithubException -from github.InputGitTreeElement import InputGitTreeElement +try: + from github import Github, GithubException + from github.InputGitTreeElement import InputGitTreeElement +except ModuleNotFoundError: # pragma: no cover - optional dependency in minimal/test envs + class GithubException(Exception): # type: ignore + """Placeholder raised when PyGithub is missing.""" + + class Github: # type: ignore + def __init__(self, *args, **kwargs): + raise RuntimeError( + "PyGithub is required for GitHub integrations. " + "Install via 'pip install PyGithub' or monkeypatch github_menu_handler.Github in tests." + ) + + class InputGitTreeElement: # type: ignore + def __init__(self, *args, **kwargs): + raise RuntimeError( + "PyGithub InputGitTreeElement unavailable. Install PyGithub to enable tree operations." + ) from telegram import ( InlineKeyboardButton, InlineKeyboardMarkup, diff --git a/repo_analyzer.py b/repo_analyzer.py index 677289752..e45cbada5 100644 --- a/repo_analyzer.py +++ b/repo_analyzer.py @@ -2,7 +2,18 @@ import json import logging from typing import Dict, List, Any, Optional -from github import Github, GithubException +try: + from github import Github, GithubException +except ModuleNotFoundError: # pragma: no cover - optional dependency for tests + class GithubException(Exception): # type: ignore + """Placeholder when PyGithub is unavailable.""" + + class Github: # type: ignore + def __init__(self, *args, **kwargs): + raise RuntimeError( + "PyGithub is required for repo analysis. " + "Install via 'pip install PyGithub' to enable this feature." + ) import base64 import re from datetime import datetime, timedelta