-
Notifications
You must be signed in to change notification settings - Fork 181
/
setup_sub.py
executable file
·92 lines (83 loc) · 2.33 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/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 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
from pyne.pyne_version import PYNE_VERSION
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.mas16", "*.dat"],
}
setup_kwargs = {
"name": "pyne",
"version": PYNE_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()