-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
49 lines (42 loc) · 1.36 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
49
#!/usr/bin/env python
import subprocess
from setuptools import setup, find_packages
import os
def git_version():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
for k in ['SYSTEMROOT', 'PATH']:
v = os.environ.get(k)
if v is not None:
env[k] = v
# 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 = ""
return GIT_REVISION
def getVersion(version, release=False):
if os.path.exists('.git'):
_git_version = git_version()[:7]
else:
_git_version = ''
if release:
return version
else:
return version + '-dev.' + _git_version
setup(name='ddsmdb',
version=getVersion('0.1', release=True),
description='Package for the Materials Knowledge System (MKS)',
author='Daniel Wheeler, Yannick Congo',
author_email='[email protected], [email protected]',
url='http://data-driven.science/ddsm',
packages=find_packages(),
package_data={'' : ['test/*.py']},
)