-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·48 lines (40 loc) · 1.28 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
""" Setup script """
import os
import subprocess
from setuptools import setup
def git_version():
""" Return the git revision as a string """
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
for envvar in ['SYSTEMROOT', 'PATH']:
val = os.environ.get(envvar)
if val is not None:
env[envvar] = val
# LANGUAGE is used on win32
env['LANGUAGE'] = 'C'
env['LANG'] = 'C'
env['LC_ALL'] = 'C'
out = subprocess.Popen(cmd, stdout=subprocess.PIPE,
env=env).communicate()[0]
return out
try:
out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
git_revision = out.strip().decode('ascii')
except OSError:
git_revision = u'Unknown'
return git_revision
NAME = 'openvpn_management'
setup(
name='openvpn-management',
version='1.3.1',
author='Greg Cox',
author_email='[email protected]',
url='https://github.com/mozilla-it/openvpn-management',
description=('Module for interacting with openvpn management\n' +
'This package is built upon commit ' + git_version()),
long_description=open('README.md').read(),
license='MPL',
py_modules=[NAME],
)