-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_sub.py
executable file
·77 lines (70 loc) · 2.31 KB
/
setup_sub.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
72
73
74
75
76
77
#!/usr/bin/env python
"""Welcome to PyNE's setup.py sub script."""
from __future__ import print_function
import io
import os
import re
import sys
import imp
import shutil
import tarfile
import argparse
import platform
import warnings
import subprocess
from glob import glob
from distutils import core, dir_util, sysconfig
from contextlib import contextmanager
if sys.version_info[0] < 3:
from urllib import urlopen
else:
from urllib.request import urlopen
from distutils.core import setup
VERSION = '0.5.11'
IS_NT = os.name == 'nt'
def main():
scripts = [os.path.join('scripts', f) for f in os.listdir('scripts')]
scripts = [s for s in scripts if (os.name == 'nt' and s.endswith('.bat'))
or (os.name != 'nt' and
not s.endswith('.bat'))]
packages = ['pyne', 'pyne.dbgen', 'pyne.apigen', 'pyne.xs',
'pyne.transmute', 'pyne.gui', 'pyne.cli', 'pyne.fortranformat']
pack_dir = {
'pyne': 'pyne',
'pyne.xs': 'pyne/xs',
'pyne.gui': 'pyne/gui',
'pyne.cli': 'pyne/cli',
'pyne.dbgen': 'pyne/dbgen',
'pyne.apigen': 'pyne/apigen',
'pyne.transmute': 'pyne/transmute',
'pyne.fortranformat': 'pyne/fortranformat',
}
extpttn = ['*.dll', '*.so', '*.dylib', '*.pyd', '*.pyo']
pack_data = {
'lib': extpttn,
'pyne': ['*.pxd',
#'include/*.h', 'include/*.pxi', 'include/*/*.h',
#'include/*/*/*.h', 'include/*/*/*/*.h',
'*.json', '*.inp',
#'_includes/*.txt', '_includes/*.pxd', '_includes/*/*',
#'_includes/*/*/*'
] + extpttn,
'pyne.xs': ['*.pxd'] + extpttn,
'pyne.gui': ['*.pyw'],
'pyne.dbgen': ['*.html', '*.csv', 'abundances.txt', 'mass.mas12', '*.dat'],
}
setup_kwargs = {
"name": "pyne",
"version": VERSION,
"description": 'The Nuclear Engineering Toolkit',
"author": 'PyNE Development Team',
"author_email": '[email protected]',
"url": 'http://pyne.github.com/',
"packages": packages,
"package_dir": pack_dir,
"package_data": pack_data,
"scripts": scripts,
}
rtn = setup(**setup_kwargs)
if __name__ == "__main__":
main()