Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
run: |
pip install -r requirements.txt
pip install -r dev-requirements.txt
pip install -e .

- name: Lint code
run: ruff check
Expand Down
3 changes: 3 additions & 0 deletions pydeckard/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from importlib.metadata import version

__version__ = version('pydeckard')
10 changes: 3 additions & 7 deletions pydeckard/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import logging
import sys
import time
import tomllib

import telegram
from telegram import Update
Expand All @@ -15,7 +14,7 @@

from pydeckard import config
from pydeckard import utils

from pydeckard import __version__

class DeckardBot():

Expand All @@ -31,9 +30,6 @@ def get_options(self):
epilog='',
)
parser.add_argument('--setup', action='store_true', help='Start the setup wizard')
with open('pyproject.toml', 'rb') as fp:
conf = tomllib.load(fp)
self.version = conf['project']['version']
args = parser.parse_args()
if args.setup:
utils.setup_bot()
Expand All @@ -60,7 +56,7 @@ async def command_status(self, update: Update, context: ContextTypes.DEFAULT_TYP
text = '\n'.join([
config.BOT_GREETING,
f'Status is <b>OK</b>, running since {utils.since(self.started_at)}',
f'Python version is {python_version}, bot version is {self.version}',
f'Python version is {python_version}, bot version is {__version__}',
])
await context.bot.send_message(
chat_id=update.effective_chat.id,
Expand Down Expand Up @@ -183,7 +179,7 @@ def run(self):
self.reply,
)
application.add_handler(reply_handler)
self.trace('Bot is ready')
self.trace(f'Bot is ready (v{__version__})')
application.run_polling(poll_interval=config.POLL_INTERVAL)


Expand Down
Loading