From b436d60a9ffe787a25e284046d32f5d9f8c18f58 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Sun, 4 Sep 2016 11:11:56 -0700 Subject: [PATCH] add __version__ to package --- setup.py | 6 +++++- socketio/__init__.py | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 4051936..15478a3 100755 --- a/setup.py +++ b/setup.py @@ -4,15 +4,19 @@ python-socketio Socket.IO server. """ +import re from setuptools import setup +with open('socketio/__init__.py', 'r') as f: + version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', + f.read(), re.MULTILINE).group(1) with open('README.rst', 'r') as f: long_description = f.read() setup( name='python-socketio', - version='1.5.0', + version=version, url='http://github.com/miguelgrinberg/python-socketio/', license='MIT', author='Miguel Grinberg', diff --git a/socketio/__init__.py b/socketio/__init__.py index d9ca049..e5f1db2 100644 --- a/socketio/__init__.py +++ b/socketio/__init__.py @@ -6,5 +6,7 @@ from .redis_manager import RedisManager from .server import Server from .namespace import Namespace -__all__ = [Middleware, Server, BaseManager, PubSubManager, KombuManager, - RedisManager, Namespace] +__version__ = '1.5.0' + +__all__ = [__version__, Middleware, Server, BaseManager, PubSubManager, + KombuManager, RedisManager, Namespace]