-
Notifications
You must be signed in to change notification settings - Fork 20
/
setup.py
executable file
·64 lines (52 loc) · 2.22 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
#!/usr/bin/env python3
"""Welcome to cymetric's setup.py script. This is a little non-standard because pyne
is a multilanguage project. Still, this script follows a predicatable ordering:
1. Parse command line arguments
2. Call cmake from the 'build' directory
3. Call make from the 'build' directory
4. Use distuitls/setuptools from the 'build' directory
This gives us the best of both worlds. Compiled code is installed with cmake/make
and Cython/Python code is installed with normal Python tools. The only trick here is
how the various command line arguments are handed off to the three sub-processes.
To accomplish this we use argparser groups to group command line arguments based on
whether they go to:
1. the setup() function,
2. cmake,
3. make, or
4. other - typically used for args that apply to multiple other groups or
modify the environment in some way.
To add a new command line argument, first add it to the appropriate group in the
``parse_args()`` function. Then, modify the logic in the cooresponding
``parse_setup()``, ``parse_cmake()``, ``parse_make()``, or ``parse_others()``
functions to consume your new command line argument. It is OK for more than
one of the parser functions to consume the argument. Where appropriate,
ensure the that argument is appended to the argument list that is returned by these
functions.
"""
from __future__ import print_function
import os
from setuptools import setup
VERSION = '1.6.0'
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 ((IS_NT and s.endswith('.bat'))
or (not IS_NT and
not s.endswith('.bat')))]
packages = ['cymetric']
pack_dir = {'cymetric': 'cymetric'}
setup_kwargs = {
"name": "cymetric",
"version": VERSION,
"description": 'Cyclus Metric Calculator',
"author": 'Cyclus Development Team',
"author_email": '[email protected]',
"url": 'http://fuelcycle.org/',
"packages": packages,
"package_dir": pack_dir,
"scripts": scripts,
}
rtn = setup(**setup_kwargs)
return rtn
if __name__ == "__main__":
main()