Skip to content

Commit

Permalink
bumb up deps
Browse files Browse the repository at this point in the history
make it compatible with pyrogram 2
bump up other dependencies
make versions of deps static in the requirements
  • Loading branch information
anonyindian committed Apr 18, 2023
1 parent c3a0468 commit daddd01
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 19 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,7 @@ dmypy.json
.pyre/

# Test Files
tests/
tests/

*.session
*.session-journal
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyrogram
telethon
tgcrypto
nest_asyncio
pyrogram==2.0.103
telethon==1.28.5
tgcrypto==1.2.5
nest_asyncio==1.5.6
2 changes: 1 addition & 1 deletion run.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TITLE Releasing the library
echo Installing dependencies...
pip install -r requirements-dev.txt
echo Bumping up library version...
bumpversion --allow-dirty --current-version 0.2.0 minor setup.py telegramdb/constants.py run.bat
bumpversion --allow-dirty --current-version 1.0.0 minor setup.py telegramdb/constants.py run.bat run.sh
echo Building the package...
python setup.py sdist bdist_wheel
echo Uploading the package...
Expand Down
5 changes: 5 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pip install -r requirements-dev.txt
bumpversion --allow-dirty --current-version 1.0.0 minor setup.py telegramdb/constants.py run.bat run.sh
python setup.py sdist bdist_wheel
twine upload dist/*
del /Q dist
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='TelegramDB',
version='0.2.0',
version='1.0.0',
description='A library that uses your telegram account as a database for your project.',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
4 changes: 0 additions & 4 deletions telegram/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion telegramdb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TelegramDB
# Copyright (C) 2022
# Copyright (C) 2023
# Anony <github.com/anonyindian>

# This program is free software: you can redistribute it and/or modify
Expand Down
4 changes: 2 additions & 2 deletions telegramdb/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TelegramDB
# Copyright (C) 2022
# Copyright (C) 2023
# Anony <github.com/anonyindian>

# This program is free software: you can redistribute it and/or modify
Expand All @@ -16,4 +16,4 @@

DP_NAME_SEPARATOR = '::'

VERSION = "0.2.0"
VERSION = "1.0.0"
8 changes: 4 additions & 4 deletions telegramdb/database.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TelegramDB
# Copyright (C) 2022
# Copyright (C) 2023
# Anony <github.com/anonyindian>

# This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -110,7 +110,7 @@ class TelegramDB:
__dp_cache__:dict = {}
def __init__(self, telegram_client: Union[Client, TelegramClient], chat_id: Union[int, str]=None, debug: bool=False, logger: Logger=None):
print(f"""
TelegramDB v{VERSION} Copyright (C) 2022 anonyindian
TelegramDB v{VERSION} Copyright (C) 2023 anonyindian
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
Expand Down Expand Up @@ -183,7 +183,7 @@ def __publish_data__(self, datapack: DataPack, data:str):
if msg_id == 0:
async def publish():
nonlocal msg_id
msg_id = (await client.send_message(chat_id=self.__chat_id__, text=data)).message_id
msg_id = (await client.send_message(chat_id=self.__chat_id__, text=data)).id
self.__loop__.run_until_complete(publish())
self.__commit_success__ = True
else:
Expand Down Expand Up @@ -338,7 +338,7 @@ def __get_datapacks__(self):
"""
if isinstance(self.__telegram_client__, Client):
from pyrogram.types import Message
for message in self.__telegram_client__.iter_history(self.__chat_id__):
for message in self.__telegram_client__.get_chat_history(self.__chat_id__):
message: Message = message
if not message.text:
continue
Expand Down
2 changes: 1 addition & 1 deletion telegramdb/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TelegramDB
# Copyright (C) 2022
# Copyright (C) 2023
# Anony <github.com/anonyindian>

# This program is free software: you can redistribute it and/or modify
Expand Down
1 change: 1 addition & 0 deletions venv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
py -m venv env && env/bin/activate && pip install -r requirements.txt

0 comments on commit daddd01

Please sign in to comment.