diff --git a/README.rst b/README.rst index bac3913e9..b7ce2c8c6 100644 --- a/README.rst +++ b/README.rst @@ -465,7 +465,7 @@ You can get help in several ways: _`Contributing` =============== -Contributions of all sizes are welcome. Please review our `contribution guidelines `_ to get started. You can also help by `reporting bugs `_. +Contributions of all sizes are welcome. Please review our `contribution guidelines `_ to get started. You can also help by `reporting bugs `_. ========== _`License` diff --git a/docs/source/conf.py b/docs/source/conf.py index 60e0eab04..1b996a635 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,6 +15,7 @@ import sys import os import shlex +import telegram # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -58,9 +59,9 @@ author = u'Leandro Toledo' # built documents. # # The short X.Y version. -version = '4.1' +version = telegram.__version__[:3] # The full version, including alpha/beta/rc tags. -release = '4.1.2' +release = telegram.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -270,7 +271,7 @@ man_pages = [ # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'PythonTelegramBot', u'Python Telegram Bot Documentation', - author, 'PythonTelegramBot', 'One line description of project.', + author, 'PythonTelegramBot', 'Not just a Python wrapper around the Telegram Bot API', 'Miscellaneous'), ] diff --git a/setup.py b/setup.py index 7eb3937d5..840297e7a 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,11 @@ #!/usr/bin/env python -'''The setup and build script for the python-telegram-bot library.''' - -import os +"""The setup and build script for the python-telegram-bot library.""" +import codecs +import telegram from setuptools import setup, find_packages -def read(*paths): - """Build a file path from *paths* and return the contents.""" - with open(os.path.join(*paths), 'r') as f: - return f.read() - - def requirements(): """Build the requirements list for this project""" requirements_list = [] @@ -22,33 +16,33 @@ def requirements(): return requirements_list - -setup(name='python-telegram-bot', - version='4.1.2', - author='Leandro Toledo', - author_email='devs@python-telegram-bot.org', - license='LGPLv3', - url='https://github.com/python-telegram-bot/python-telegram-bot', - keywords='python telegram bot api wrapper', - description='A Python wrapper around the Telegram Bot API', - long_description=(read('README.rst')), - packages=find_packages(exclude=['tests*']), - install_requires=requirements(), - 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 :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - ],) +with codecs.open('README.rst', 'r', 'utf-8') as fd: + setup(name='python-telegram-bot', + version=telegram.__version__, + author='Leandro Toledo', + author_email='devs@python-telegram-bot.org', + license='LGPLv3', + url='https://github.com/python-telegram-bot/python-telegram-bot', + keywords='python telegram bot api wrapper', + description='Not just a Python wrapper around the Telegram Bot API', + long_description=fd.read(), + packages=find_packages(exclude=['tests*']), + install_requires=requirements(), + 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 :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + ],) diff --git a/telegram/error.py b/telegram/error.py index d70b6f961..201f2c778 100644 --- a/telegram/error.py +++ b/telegram/error.py @@ -77,7 +77,7 @@ class NetworkError(TelegramError): pass -class BadRequest(TelegramError): +class BadRequest(NetworkError): pass diff --git a/tests/test_bot.py b/tests/test_bot.py index 62dd9eb34..5f477ca94 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -207,6 +207,9 @@ class BotTest(BaseTest, unittest.TestCase): with self.assertRaisesRegexp(telegram.error.BadRequest, 'Chat not found'): chat = self._bot.leaveChat(-123456) + with self.assertRaisesRegexp(telegram.error.NetworkError, 'Chat not found'): + chat = self._bot.leaveChat(-123456) + @flaky(3, 1) @timeout(10) def testGetChat(self):