setup.py: fix missing imports

This commit is contained in:
Benjamin Dauvergne 2016-02-09 11:56:28 +01:00
parent 35f773f084
commit c312c761e3
1 changed files with 9 additions and 7 deletions

View File

@ -3,8 +3,12 @@
''' Setup script for django-kerberos
'''
import os
import subprocess
from setuptools import setup, find_packages
def get_version():
'''Use the VERSION, if absent generates a version with git describe, if not
tag exists, take 0.0.0- and add the length of the commit log.
@ -13,15 +17,14 @@ def get_version():
with open('VERSION', 'r') as v:
return v.read()
if os.path.exists('.git'):
p = subprocess.Popen(['git','describe','--dirty','--match=v*'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p = subprocess.Popen(['git', 'describe', '--dirty', '--match=v*'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
result = p.communicate()[0]
if p.returncode == 0:
return result.split()[0][1:].replace('-', '.')
else:
return '0.0.0-%s' % len(
subprocess.check_output(
['git', 'rev-list', 'HEAD']).splitlines())
return '0.0.0-%s' % len(subprocess.check_output(
['git', 'rev-list', 'HEAD']).splitlines())
return '0.0.0'
@ -49,5 +52,4 @@ setup(name="django-kerberos",
'static/js/*.js',
],
},
dependency_links=[],
)
dependency_links=[])