From b8c27888185ce03ee6cfac71dcedb253d08b9b82 Mon Sep 17 00:00:00 2001 From: Eduard Iskandarov Date: Fri, 30 May 2014 16:33:04 +0400 Subject: [PATCH] fix installation issues --- setup.py | 25 +++++++++++++++++++++---- tarantool_queue/__init__.py | 2 +- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index b46c23f..e2ebcfe 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,11 @@ +import codecs +import os +import re from setuptools import setup import sys cmdclass = {} -from tarantool_queue import __version__ - try: from setuptools import setup except ImportError: @@ -16,10 +17,26 @@ except ImportError: pass + +def read(*parts): + filename = os.path.join(os.path.dirname(__file__), *parts) + with codecs.open(filename, encoding='utf-8') as fp: + return fp.read() + + +def find_version(*file_paths): + version_file = read(*file_paths) + version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", + version_file, re.M) + if version_match: + return version_match.group(1) + raise RuntimeError("Unable to find version string.") + + setup(name='tarantool-queue', - version=__version__, + version=find_version('tarantool_queue', '__init__.py'), description='Python bindings for Tarantool queue script (http://github.com/tarantool/queue)', - long_description=open('README.rst').read(), + long_description=read('README.rst'), author='Eugine Blikh', author_email='bigbes@gmail.com', maintainer='Eugine Blikh', diff --git a/tarantool_queue/__init__.py b/tarantool_queue/__init__.py index 8bc73e5..4b8597e 100644 --- a/tarantool_queue/__init__.py +++ b/tarantool_queue/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.1.1" +__version__ = "0.1.2" from tarantool_queue import Task, Tube, Queue __all__ = [Task, Tube, Queue, __version__]