Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
331c4f5
Temporarily enable tests for the v14 branch
Bibo-Joshi Jul 14, 2021
9dc30cf
Move and Rename TelegramDecryptionError to telegram.error.PassportDec…
harshil21 Aug 11, 2021
b089cc9
Add Code Comment Guidelines to Contribution Guide (#2612)
Poolitzer Aug 11, 2021
3a19383
Improve Type Hinting for CallbackContext (#2587)
revolter Aug 12, 2021
414a18c
Add Custom pytest Marker to Ease Development (#2628)
Poolitzer Aug 12, 2021
8edb49d
Make BasePersistence Methods Abstract (#2624)
starry-shivam Aug 12, 2021
cce9c18
Refactor Initialization of Persistence Classes (#2604)
Bibo-Joshi Aug 13, 2021
dc0207a
Remove `__dict__` from `__slots__` and drop Python 3.6 (#2619, #2636)
harshil21 Aug 19, 2021
4af252f
Remove day_is_strict argument of JobQueue.run_monthly (#2634)
iota-008 Aug 26, 2021
b6e4b54
Drop Non-CallbackContext API (#2617)
Poolitzer Aug 29, 2021
4359812
Fix Signatures and Improve test_official (#2643)
harshil21 Aug 29, 2021
dbdd35e
Remove Deprecated Functionality (#2644)
Bibo-Joshi Aug 30, 2021
a7c7c82
Add User Friendly Type Check For Init Of {Inline, Reply}KeyboardMarku…
harshil21 Sep 15, 2021
8ac65fc
Refine Dispatcher.dispatch_error (#2660)
Bibo-Joshi Sep 17, 2021
66f0604
Warnings Overhaul (#2662)
harshil21 Sep 20, 2021
4f21c06
Clear Up Import Policy (#2671)
Bibo-Joshi Sep 22, 2021
5542a46
Make InlineQuery.answer Raise ValueError (#2675)
Bibo-Joshi Sep 24, 2021
1027e49
merged from v14
eldbud Sep 23, 2021
ec0665f
looks done
eldbud Sep 27, 2021
f98883a
added self to AUTHORS.rst
eldbud Sep 27, 2021
2cf9311
Doc Fixes (#2597)
Bibo-Joshi Oct 1, 2021
bf0919c
Merge branch 'v14' into pathlib-weherever-possible-2665
eldbud Oct 1, 2021
eac94bd
final better utilisations of the Path module and some docstring update
eldbud Oct 2, 2021
38c6641
attended to review notes
eldbud Oct 2, 2021
d5fe778
fixed calls of PicklePersistence.__init__() with keyworded arg
eldbud Oct 3, 2021
bcc62bb
Merge remote-tracking branch 'upstream/v14' into v14
eldbud Oct 3, 2021
2de712e
Merge branch 'v14' into pathlib-weherever-possible-2665
eldbud Oct 3, 2021
5403866
attended to review notes
eldbud Oct 3, 2021
9fc24c0
Merge branch 'v14' into pathlib-weherever-possible-2665
Bibo-Joshi Oct 3, 2021
caa1526
added parametrization for tests that deal with custom_path in test_fi…
eldbud Oct 3, 2021
62a5f55
added parametrization for tests that deal with custom_path in test_fi…
eldbud Oct 3, 2021
654ea00
added parametrization for tests that deal with custom_path in test_fi…
eldbud Oct 4, 2021
db9b6b1
bringing codecov back up
eldbud Oct 4, 2021
70403ed
some final details
Bibo-Joshi Oct 4, 2021
fa42e22
attended to review notes
eldbud Oct 4, 2021
ecc8248
Merge branch 'pathlib-weherever-possible-2665' of https://github.com/…
eldbud Oct 4, 2021
96af7a6
brought back filepath.with_name(filepath.name etc)
eldbud Oct 4, 2021
5e10bd1
Revert "brought back filepath.with_name(filepath.name etc)"
Bibo-Joshi Oct 5, 2021
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 AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ The following wonderful people contributed directly or indirectly to this projec
- `DonalDuck004 <https://github.com/DonalDuck004>`_
- `Eana Hufwe <https://github.com/blueset>`_
- `Ehsan Online <https://github.com/ehsanonline>`_
- `Eldad Carin <https://github.com/eldbud>`_
- `Eli Gao <https://github.com/eligao>`_
- `Emilio Molinari <https://github.com/xates>`_
- `ErgoZ Riftbit Vaper <https://github.com/ergoz>`_
Expand Down
2 changes: 1 addition & 1 deletion examples/arbitrarycallbackdatabot.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def handle_invalid_button(update: Update, context: CallbackContext) -> None:
def main() -> None:
"""Run the bot."""
# We use persistence to demonstrate how buttons can still work after the bot was restarted
persistence = PicklePersistence(filename='arbitrarycallbackdatabot.pickle')
persistence = PicklePersistence(filepath='arbitrarycallbackdatabot')
# Create the Updater and pass it your bot's token.
updater = Updater("TOKEN", persistence=persistence, arbitrary_callback_data=True)

Expand Down
4 changes: 2 additions & 2 deletions examples/passportbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

"""
import logging
from pathlib import Path

from telegram import Update
from telegram.ext import Updater, MessageHandler, Filters, CallbackContext
Expand Down Expand Up @@ -101,8 +102,7 @@ def msg(update: Update, context: CallbackContext) -> None:
def main() -> None:
"""Start the bot."""
# Create the Updater and pass it your token and private key
with open('private.key', 'rb') as private_key:
updater = Updater("TOKEN", private_key=private_key.read())
updater = Updater("TOKEN", private_key=Path('private.key').read_bytes())

# Get the dispatcher to register handlers
dispatcher = updater.dispatcher
Expand Down
2 changes: 1 addition & 1 deletion examples/persistentconversationbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def done(update: Update, context: CallbackContext) -> int:
def main() -> None:
"""Run the bot."""
# Create the Updater and pass it your bot's token.
persistence = PicklePersistence(filename='conversationbot')
persistence = PicklePersistence(filepath='conversationbot')
updater = Updater("TOKEN", persistence=persistence)

# Get the dispatcher to register handlers
Expand Down
105 changes: 51 additions & 54 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
"""The setup and build script for the python-telegram-bot library."""
import os
import subprocess
import sys
from pathlib import Path

from setuptools import setup, find_packages

Expand All @@ -13,7 +13,7 @@ def get_requirements(raw=False):
"""Build the requirements list for this project"""
requirements_list = []

with open('requirements.txt') as reqs:
with Path('requirements.txt').open() as reqs:
for install in reqs:
if install.startswith('# only telegram.ext:'):
if raw:
Expand Down Expand Up @@ -47,63 +47,60 @@ def get_setup_kwargs(raw=False):
packages, requirements = get_packages_requirements(raw=raw)

raw_ext = "-raw" if raw else ""
readme = f'README{"_RAW" if raw else ""}.rst'
readme = Path(f'README{"_RAW" if raw else ""}.rst')

fn = os.path.join('telegram', 'version.py')
with open(fn) as fh:
with Path('telegram/version.py').open() as fh:
for line in fh.readlines():
if line.startswith('__version__'):
exec(line)

with open(readme, 'r', encoding='utf-8') as fd:

kwargs = dict(
script_name=f'setup{raw_ext}.py',
name=f'python-telegram-bot{raw_ext}',
version=locals()['__version__'],
author='Leandro Toledo',
author_email='devs@python-telegram-bot.org',
license='LGPLv3',
url='https://python-telegram-bot.org/',
# Keywords supported by PyPI can be found at https://git.io/JtLIZ
project_urls={
"Documentation": "https://python-telegram-bot.readthedocs.io",
"Bug Tracker": "https://github.com/python-telegram-bot/python-telegram-bot/issues",
"Source Code": "https://github.com/python-telegram-bot/python-telegram-bot",
"News": "https://t.me/pythontelegrambotchannel",
"Changelog": "https://python-telegram-bot.readthedocs.io/en/stable/changelog.html",
},
download_url=f'https://pypi.org/project/python-telegram-bot{raw_ext}/',
keywords='python telegram bot api wrapper',
description="We have made you a wrapper you can't refuse",
long_description=fd.read(),
long_description_content_type='text/x-rst',
packages=packages,

install_requires=requirements,
extras_require={
'json': 'ujson',
'socks': 'PySocks',
# 3.4-3.4.3 contained some cyclical import bugs
'passport': 'cryptography!=3.4,!=3.4.1,!=3.4.2,!=3.4.3',
},
include_package_data=True,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
'Operating System :: OS Independent',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Communications :: Chat',
'Topic :: Internet',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
python_requires='>=3.7'
)
kwargs = dict(
script_name=f'setup{raw_ext}.py',
name=f'python-telegram-bot{raw_ext}',
version=locals()['__version__'],
author='Leandro Toledo',
author_email='devs@python-telegram-bot.org',
license='LGPLv3',
url='https://python-telegram-bot.org/',
# Keywords supported by PyPI can be found at https://git.io/JtLIZ
project_urls={
"Documentation": "https://python-telegram-bot.readthedocs.io",
"Bug Tracker": "https://github.com/python-telegram-bot/python-telegram-bot/issues",
"Source Code": "https://github.com/python-telegram-bot/python-telegram-bot",
"News": "https://t.me/pythontelegrambotchannel",
"Changelog": "https://python-telegram-bot.readthedocs.io/en/stable/changelog.html",
},
download_url=f'https://pypi.org/project/python-telegram-bot{raw_ext}/',
keywords='python telegram bot api wrapper',
description="We have made you a wrapper you can't refuse",
long_description=readme.read_text(),
long_description_content_type='text/x-rst',
packages=packages,

install_requires=requirements,
extras_require={
'json': 'ujson',
'socks': 'PySocks',
# 3.4-3.4.3 contained some cyclical import bugs
'passport': 'cryptography!=3.4,!=3.4.1,!=3.4.2,!=3.4.3',
},
include_package_data=True,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
'Operating System :: OS Independent',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Communications :: Chat',
'Topic :: Internet',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
python_requires='>=3.7'
)

return kwargs

Expand Down
Loading