diff --git a/gunicorn/__init__.py b/gunicorn/__init__.py index 24084849..b1b0e561 100644 --- a/gunicorn/__init__.py +++ b/gunicorn/__init__.py @@ -3,26 +3,6 @@ # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. - -import os - -if os.environ.get('release') != "true": - - minor_tag = "" - try: - from gunicorn.util import popen3 - - stdin, stdout, stderr = popen3("git rev-parse --short HEAD --") - error = stderr.read() - if not error: - git_tag = stdout.read()[:-1] - minor_tag = ".%s-git" % git_tag - except OSError: - pass -else: - minor_tag = "" - - -version_info = (0, 11, "2%s" % minor_tag) +version_info = (0, 11, 2) __version__ = ".".join(map(str, version_info)) SERVER_SOFTWARE = "gunicorn/%s" % __version__ diff --git a/gunicorn/util.py b/gunicorn/util.py index 4fe5feea..1c9e066b 100644 --- a/gunicorn/util.py +++ b/gunicorn/util.py @@ -14,21 +14,6 @@ import sys import textwrap import time -try:#python 2.6, use subprocess - import subprocess - subprocess.Popen # trigger ImportError early - closefds = os.name == 'posix' - - def popen3(cmd, mode='t', bufsize=0): - p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, - stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - close_fds=closefds) - p.wait() - return (p.stdin, p.stdout, p.stderr) -except ImportError: - subprocess = None - popen3 = os.popen3 - MAXFD = 1024 if (hasattr(os, "devnull")): diff --git a/setup.py b/setup.py index dc13bf9e..8825a510 100644 --- a/setup.py +++ b/setup.py @@ -6,12 +6,47 @@ import os from setuptools import setup, find_packages +import sys from gunicorn import __version__ + +try:#python 2.6, use subprocess + import subprocess + subprocess.Popen # trigger ImportError early + closefds = os.name == 'posix' + + def popen3(cmd, mode='t', bufsize=0): + p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + close_fds=closefds) + p.wait() + return (p.stdin, p.stdout, p.stderr) +except ImportError: + subprocess = None + popen3 = os.popen3 + + +DEVELOP = "develop" in sys.argv + +version = __version__ +if DEVELOP: + minor_tag = "" + try: + stdin, stdout, stderr = popen3("git rev-parse --short HEAD --") + error = stderr.read() + if not error: + git_tag = stdout.read()[:-1] + minor_tag = ".%s-git" % git_tag + except OSError: + pass + + version = "%s%s" % (version, minor_tag) + + setup( name = 'gunicorn', - version = __version__, + version = version, description = 'WSGI HTTP Server for UNIX', long_description = file(