mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
use only git shorttag with 'develop' command, also don'ty load it each
time. spotted by @davisp .
This commit is contained in:
parent
f29c610916
commit
bc2d0112a8
@ -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__
|
||||
|
||||
@ -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")):
|
||||
|
||||
37
setup.py
37
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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user