Skip to content

Commit ff61e80

Browse files
committed
docker added
1 parent 6a7aa93 commit ff61e80

5 files changed

Lines changed: 25 additions & 11 deletions

File tree

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
SHELL := /bin/bash
22

33
configure: venv
4-
source ./venv/bin/activate && pip install --force-reinstall -r requirements.txt -r requirements.dev.txt
4+
source ./venv/bin/activate && pip install -r requirements.txt -r requirements.dev.txt
55

66
venv:
7-
python3.12 -m venv venv
7+
python3.11 -m venv venv
88

99
format:
1010
source ./venv/bin/activate && autoflake -r --in-place --remove-all-unused-imports ./src
1111
source ./venv/bin/activate && isort ./src
1212
source ./venv/bin/activate && black ./src
1313

1414
db:
15-
#docker
15+
docker run -d -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust --name db-random_coffee_bot postgres:15
1616

1717
migrate:
18-
source ./venv/bin/activate && alembic upgrade head
18+
source ./venv/bin/activate && alembic upgrade head
19+
20+
run:
21+
source ./venv/bin/activate && python -m src

requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
pydantic
2-
pydantic-settings
31
sqlalchemy
42
psycopg2-binary
5-
aiogram
3+
aiogram
4+
pydantic==2.11.7
5+
pydantic-settings==2.10.1
6+
pydantic_core==2.33.2

src/handlers/help.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from aiogram import Router
22
from aiogram.filters import Command
33
from aiogram.types import Message
4+
from src.utils.answers import Answers
45

56
router = Router()
6-
7+
answers = Answers()
78

89
@router.message(Command("help"))
910
async def cmd_help(message: Message):
10-
await message.answer("Это справочное сообщение. Чем могу помочь?")
11+
await message.answer(answers.help)

src/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Settings(BaseSettings):
66
"""Application settings"""
77

88
BOT_TOKEN: str
9-
DB_DSN: PostgresDsn
9+
#DB_DSN: PostgresDsn
1010
# MARKETING_URL: str //future tasks
1111

1212
model_config = ConfigDict(case_sensitive=True, env_file=".env", extra="allow")

src/utils/answers.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
# ready answers
1+
from dataclasses import dataclass
2+
3+
@dataclass
4+
class Answers:
5+
test="some answer"
6+
help=(
7+
"Я рандом кофе бот для встреч\n"
8+
"/help - вывести все команды"
9+
"/..."
10+
)

0 commit comments

Comments
 (0)