From 587908457e28e079f7bbdb5cb1adc6b39c951234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Fri, 29 Jul 2016 17:40:11 +0200 Subject: [PATCH] move version string to telegram/version.py (#361) --- setup.py | 6 ++++-- telegram/__init__.py | 3 ++- telegram/version.py | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 telegram/version.py diff --git a/setup.py b/setup.py index 840297e7a..3b114c51d 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ """The setup and build script for the python-telegram-bot library.""" import codecs -import telegram +import os from setuptools import setup, find_packages @@ -17,8 +17,10 @@ def requirements(): return requirements_list with codecs.open('README.rst', 'r', 'utf-8') as fd: + execfile(os.path.join('telegram', 'version.py')) + setup(name='python-telegram-bot', - version=telegram.__version__, + version=__version__, author='Leandro Toledo', author_email='devs@python-telegram-bot.org', license='LGPLv3', diff --git a/telegram/__init__.py b/telegram/__init__.py index bdfbd6ae6..0d52992dc 100644 --- a/telegram/__init__.py +++ b/telegram/__init__.py @@ -84,9 +84,10 @@ from .constants import (MAX_MESSAGE_LENGTH, MAX_CAPTION_LENGTH, SUPPORTED_WEBHOO MAX_FILESIZE_DOWNLOAD, MAX_FILESIZE_UPLOAD, MAX_MESSAGES_PER_SECOND_PER_CHAT, MAX_MESSAGES_PER_SECOND, MAX_MESSAGES_PER_MINUTE_PER_GROUP) +from .version import __version__ # flake8: noqa __author__ = 'devs@python-telegram-bot.org' -__version__ = '5.0.0' + __all__ = ['Audio', 'Bot', 'Chat', 'ChatMember', 'ChatAction', 'ChosenInlineResult', 'CallbackQuery', 'Contact', 'Document', 'Emoji', 'File', 'ForceReply', 'InlineKeyboardButton', 'InlineKeyboardMarkup', 'InlineQuery', 'InlineQueryResult', diff --git a/telegram/version.py b/telegram/version.py new file mode 100644 index 000000000..1f7798ad1 --- /dev/null +++ b/telegram/version.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# +# A library that provides a Python interface to the Telegram Bot API +# Copyright (C) 2015-2016 +# Leandro Toledo de Souza +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser Public License for more details. +# +# You should have received a copy of the GNU Lesser Public License +# along with this program. If not, see [http://www.gnu.org/licenses/]. + +__version__ = '5.0.0'