forked from Nikea/xray-vision
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
71 lines (63 loc) · 2.04 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from __future__ import (absolute_import, division, print_function)
import sys
import warnings
try:
from setuptools import setup
except ImportError:
try:
from setuptools.core import setup
except ImportError:
from distutils.core import setup
from distutils.core import setup, Extension
import numpy
MAJOR = 0
MINOR = 0
MICRO = 0
ISRELEASED = False
SNAPSHOT = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
QUALIFIER = ''
FULLVERSION = VERSION
print(FULLVERSION)
if not ISRELEASED:
import subprocess
FULLVERSION += '.dev'
if SNAPSHOT:
pipe = None
for cmd in ['git', 'git.cmd']:
try:
pipe = subprocess.Popen([cmd, "describe", "--always",
"--match", "v[0-9\/]*"],
stdout=subprocess.PIPE)
(so, serr) = pipe.communicate()
print(so, serr)
if pipe.returncode == 0:
pass
print('here')
except:
pass
if pipe is None or pipe.returncode != 0:
warnings.warn("WARNING: Couldn't get git revision, "
"using generic version string")
else:
rev = so.strip()
# makes distutils blow up on Python 2.7
if sys.version_info[0] >= 3:
rev = rev.decode('ascii')
# use result of git describe as version string
FULLVERSION = VERSION + '-' + rev.lstrip('v')
break
else:
FULLVERSION += QUALIFIER
setup(
name='xray-vision',
version=FULLVERSION,
author='Brookhaven National Lab',
packages=['xray_vision',
'xray_vision.qt_widgets',
'xray_vision.messenger', 'xray_vision.messenger.mpl',
'xray_vision.backend', 'xray_vision.backend.mpl',
'xray_vision.xrf', 'xray_vision.xrf.model',
'xray_vision.xrf.view',
'xray_vision.mask', 'xray_vision.utils'],
)