Skip to content

Commit

Permalink
Merge pull request #60 from sudoskys/dev
Browse files Browse the repository at this point in the history
deps(better): Remove `loguru`, use `logging` instead
  • Loading branch information
sudoskys authored Jan 22, 2025
2 parents 31ac0f8 + dd749fd commit 4f8da04
Show file tree
Hide file tree
Showing 7 changed files with 784 additions and 135 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Install dependencies
run: |
pdm install --no-lock -G mermaid -G tests
pdm install --frozen-lockfile -G mermaid -G tests
- name: Run Tests
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
Expand Down
903 changes: 778 additions & 125 deletions pdm.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[project]
name = "telegramify-markdown"
version = "0.4.0"
version = "0.4.1"
description = "Makes it easy to send Markdown in Telegram MarkdownV2 style"
authors = [
{ name = "sudoskys", email = "coldlando@hotmail.com" },
]
dependencies = [
"mistletoe==1.4.0",
"loguru>=0.7.3",
]
requires-python = ">=3.9"
readme = "README.md"
Expand Down
3 changes: 1 addition & 2 deletions src/telegramify_markdown/interpreters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from typing import TYPE_CHECKING

import mistletoe
from loguru import logger

from telegramify_markdown.logger import logger
from telegramify_markdown.mermaid import render_mermaid, support_mermaid
from telegramify_markdown.mime import get_filename
from telegramify_markdown.type import TaskType, File, Text, Photo, SentType, ContentTrace
Expand Down
1 change: 0 additions & 1 deletion src/telegramify_markdown/logger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging

# Configure the logger
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger('telegramify_markdown')
2 changes: 1 addition & 1 deletion src/telegramify_markdown/mime.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path
from typing import Optional

from loguru import logger
from telegramify_markdown.logger import logger

default_language_to_ext = {
"python": "py",
Expand Down
5 changes: 2 additions & 3 deletions src/telegramify_markdown/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class ContentTrace:
extra: dict = dataclasses.field(default_factory=dict, kw_only=True)



@dataclasses.dataclass
class Text:
content: str
Expand All @@ -31,9 +30,9 @@ class File:
file_name: str
file_data: bytes

"""Please use render_lines_func to render the content."""
content_trace: ContentTrace
caption: str = ""
"""Please use render_lines_func to render the content."""
content_type: ContentTypes = ContentTypes.FILE


Expand All @@ -42,7 +41,7 @@ class Photo:
file_name: str
file_data: bytes

"""Please use render_lines_func to render the content."""
content_trace: ContentTrace
caption: str = ""
"""Please use render_lines_func to render the content."""
content_type: ContentTypes = ContentTypes.PHOTO

0 comments on commit 4f8da04

Please sign in to comment.