Skip to content

🏗️ Fix project skeleton and align dependencies#90

Closed
Miyamura80 wants to merge 1 commit into
mainfrom
fix/skeleton-deps-alignment
Closed

🏗️ Fix project skeleton and align dependencies#90
Miyamura80 wants to merge 1 commit into
mainfrom
fix/skeleton-deps-alignment

Conversation

@Miyamura80
Copy link
Copy Markdown
Owner

Summary

  • Recreated missing skeleton code structure as empty placeholders to fix module resolution issues.
  • Added __init__.py files to all source directories to satisfy Ruff's INP001 (implicit namespace package) rule and improve LSP reliability.
  • Promoted pydantic, numpy, and requests to direct dependencies to fix deptry transitive dependency warnings.
  • Configured deptry in pyproject.toml to ignore development/testing tools in CI checks.

@Miyamura80 Miyamura80 closed this Jan 26, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jan 26, 2026

Greptile Overview

Greptile Summary

This PR fixes module resolution by adding __init__.py files to all source directories and aligns dependency management by promoting transitive dependencies to direct ones.

Key Changes:

  • Added 54+ empty __init__.py files across src/, alembic/, and subdirectories to fix Ruff's INP001 rule violations
  • Promoted pydantic>=2.10.0, numpy>=1.26.0, and requests>=2.31.0 from transitive to direct dependencies
  • Configured deptry to ignore development/testing tools (pytest, vulture, pylint, etc.) in CI checks
  • Added new src/utils/integration/telegram.py module for Telegram Bot API integration
  • Reformatted long regex pattern in src/utils/logging_config.py

Issues Found:

  • telegram.py references global_config.TELEGRAM_BOT_TOKEN and global_config.telegram.chat_ids which don't exist in common/global_config.py - this will cause runtime errors when instantiating the Telegram class
  • Missing setup_logging() call in telegram.py per project logging standards

Confidence Score: 3/5

  • This PR has critical runtime errors that must be fixed before merging
  • The skeleton structure changes are safe, but the new telegram.py module references undefined config fields (TELEGRAM_BOT_TOKEN and telegram.chat_ids) that will cause AttributeError at runtime. Dependency changes are correct and lock file is properly updated.
  • Pay close attention to src/utils/integration/telegram.py - requires config changes before this code can run

Important Files Changed

Filename Overview
src/utils/integration/telegram.py Added Telegram bot integration with message sending/deletion, but missing TELEGRAM_BOT_TOKEN in config and logging setup
pyproject.toml Promoted pydantic, numpy, requests to direct dependencies and configured deptry ignore rules
src/utils/logging_config.py Reformatted long regex pattern for better readability
uv.lock Updated lock file to reflect new direct dependencies (pydantic, numpy, requests)

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile


def __init__(self):
"""Initialize Telegram bot with credentials from environment."""
self.bot_token = global_config.TELEGRAM_BOT_TOKEN
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TELEGRAM_BOT_TOKEN not defined in common/global_config.py. Add this field to the Config class or this will fail at runtime.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/utils/integration/telegram.py
Line: 15:15

Comment:
`TELEGRAM_BOT_TOKEN` not defined in `common/global_config.py`. Add this field to the `Config` class or this will fail at runtime.

How can I resolve this? If you propose a fix, please make it concise.

Optional[int]: The message ID if successful, None otherwise
"""
# Get chat ID from configuration
chat_id = getattr(global_config.telegram.chat_ids, chat_name, None)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

global_config.telegram.chat_ids not defined in config structure. Add the telegram field with nested chat_ids to Config class or this will fail at runtime.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/utils/integration/telegram.py
Line: 84:84

Comment:
`global_config.telegram.chat_ids` not defined in config structure. Add the `telegram` field with nested `chat_ids` to `Config` class or this will fail at runtime.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +1 to +7
"""Telegram Bot integration for sending alerts and notifications."""

import requests
from loguru import logger as log
from requests.exceptions import RequestException

from common import global_config
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing setup_logging() call. Per logging standards, import and call setup_logging() from src.utils.logging_config at module level.

Suggested change
"""Telegram Bot integration for sending alerts and notifications."""
import requests
from loguru import logger as log
from requests.exceptions import RequestException
from common import global_config
"""Telegram Bot integration for sending alerts and notifications."""
import requests
from loguru import logger as log
from requests.exceptions import RequestException
from common import global_config
from src.utils.logging_config import setup_logging
setup_logging()

Context Used: Context from dashboard - Standards for using logging in the project. (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/utils/integration/telegram.py
Line: 1:7

Comment:
Missing `setup_logging()` call. Per logging standards, import and call `setup_logging()` from `src.utils.logging_config` at module level.

```suggestion
"""Telegram Bot integration for sending alerts and notifications."""

import requests
from loguru import logger as log
from requests.exceptions import RequestException

from common import global_config
from src.utils.logging_config import setup_logging

setup_logging()
```

**Context Used:** Context from `dashboard` - Standards for using logging in the project. ([source](https://app.greptile.com/review/custom-context?memory=ec5af2c7-d139-40b0-99e5-0f4bf1fee1d7))

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant