From 66775b70120b6424251d80db11144b0bd238fb16 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 28 Nov 2011 12:10:15 +0100 Subject: [PATCH] Put the version number somewhere central. --- rq/__init__.py | 2 ++ rq/version.py | 1 + setup.py | 13 +++++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 rq/version.py diff --git a/rq/__init__.py b/rq/__init__.py index 1820354..3f9fa3c 100644 --- a/rq/__init__.py +++ b/rq/__init__.py @@ -2,6 +2,7 @@ from redis import Redis from .proxy import conn from .queue import Queue from .worker import Worker +from .version import VERSION def use_redis(redis=None): """Pushes the given Redis connection (a redis.Redis instance) onto the @@ -18,3 +19,4 @@ def use_redis(redis=None): conn.push(redis) __all__ = ['conn', 'Queue', 'Worker', 'use_redis'] +__version__ = VERSION diff --git a/rq/version.py b/rq/version.py new file mode 100644 index 0000000..d0bd79f --- /dev/null +++ b/rq/version.py @@ -0,0 +1 @@ +VERSION = '0.1' diff --git a/setup.py b/setup.py index 90d205a..26ee452 100644 --- a/setup.py +++ b/setup.py @@ -2,11 +2,20 @@ rq is a simple, lightweight, library for creating background jobs, and processing them. """ -from setuptools import Command, setup +import os +from setuptools import setup + +def get_version(): + basedir = os.path.dirname(__file__) + with open(os.path.join(basedir, 'rq/version.py')) as f: + VERSION = None + exec(f.read()) + return VERSION + raise RuntimeError('No version info found.') setup( name='rq', - version='0.1-dev', + version=get_version(), url='https://github.com/nvie/rq/', license='BSD', author='Vincent Driessen',