2014-01-20 19:58:59 -05:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
2015-05-23 11:16:12 +07:00
|
|
|
import glob
|
2016-10-14 22:52:06 -04:00
|
|
|
import numpy as np
|
2015-06-01 08:37:01 +07:00
|
|
|
try:
|
|
|
|
|
from setuptools import setup
|
|
|
|
|
have_setuptools = True
|
|
|
|
|
except ImportError:
|
|
|
|
|
from distutils.core import setup
|
|
|
|
|
have_setuptools = False
|
2014-01-20 19:58:59 -05:00
|
|
|
|
2016-02-24 11:01:12 -06:00
|
|
|
try:
|
|
|
|
|
from Cython.Build import cythonize
|
|
|
|
|
have_cython = True
|
|
|
|
|
except ImportError:
|
|
|
|
|
have_cython = False
|
|
|
|
|
|
2017-05-01 12:17:09 -05:00
|
|
|
|
|
|
|
|
# Get version information from __init__.py. This is ugly, but more reliable than
|
|
|
|
|
# using an import.
|
|
|
|
|
with open('openmc/__init__.py', 'r') as f:
|
|
|
|
|
version = f.readlines()[-1].split()[-1].strip("'")
|
|
|
|
|
|
2015-06-01 08:37:01 +07:00
|
|
|
kwargs = {'name': 'openmc',
|
2017-05-01 12:17:09 -05:00
|
|
|
'version': version,
|
2016-05-26 07:46:07 -05:00
|
|
|
'packages': ['openmc', 'openmc.data', 'openmc.mgxs', 'openmc.model',
|
|
|
|
|
'openmc.stats'],
|
2015-06-01 08:37:01 +07:00
|
|
|
'scripts': glob.glob('scripts/openmc-*'),
|
2015-05-23 11:16:12 +07:00
|
|
|
|
2015-06-01 08:37:01 +07:00
|
|
|
# Metadata
|
|
|
|
|
'author': 'Will Boyd',
|
|
|
|
|
'author_email': 'wbinventor@gmail.com',
|
|
|
|
|
'description': 'OpenMC Python API',
|
|
|
|
|
'url': 'https://github.com/mit-crpg/openmc',
|
|
|
|
|
'classifiers': [
|
|
|
|
|
'Intended Audience :: Developers',
|
|
|
|
|
'Intended Audience :: End Users/Desktop',
|
|
|
|
|
'Intended Audience :: Science/Research',
|
|
|
|
|
'License :: OSI Approved :: MIT License',
|
|
|
|
|
'Natural Language :: English',
|
|
|
|
|
'Programming Language :: Python',
|
|
|
|
|
'Topic :: Scientific/Engineering'
|
|
|
|
|
]}
|
2015-05-23 11:16:12 +07:00
|
|
|
|
2015-06-01 08:37:01 +07:00
|
|
|
if have_setuptools:
|
|
|
|
|
kwargs.update({
|
|
|
|
|
# Required dependencies
|
2017-04-01 14:56:54 -05:00
|
|
|
'install_requires': ['six', 'numpy>=1.9', 'h5py'],
|
2015-05-23 11:16:12 +07:00
|
|
|
|
2015-06-01 08:37:01 +07:00
|
|
|
# Optional dependencies
|
|
|
|
|
'extras_require': {
|
2016-11-07 11:34:09 -06:00
|
|
|
'decay': ['uncertainties'],
|
2016-03-09 08:47:14 -06:00
|
|
|
'pandas': ['pandas>=0.17.0'],
|
2017-04-01 14:56:54 -05:00
|
|
|
'plot': ['matplotlib', 'ipython'],
|
2016-01-06 08:45:25 -05:00
|
|
|
'sparse' : ['scipy'],
|
2015-06-01 08:37:01 +07:00
|
|
|
'vtk': ['vtk', 'silomesh'],
|
|
|
|
|
'validate': ['lxml']
|
2016-08-05 11:25:55 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
# Data files
|
|
|
|
|
'package_data': {
|
2016-10-13 07:09:50 -05:00
|
|
|
'openmc.data': ['mass.mas12', 'fission_Q_data_endfb71.h5']
|
2016-08-05 11:25:55 -05:00
|
|
|
},
|
|
|
|
|
})
|
2015-06-01 08:37:01 +07:00
|
|
|
|
2016-02-24 11:01:12 -06:00
|
|
|
# If Cython is present, add resonance reconstruction capability
|
|
|
|
|
if have_cython:
|
|
|
|
|
kwargs.update({
|
2016-10-14 22:52:06 -04:00
|
|
|
'ext_modules': cythonize('openmc/data/reconstruct.pyx'),
|
|
|
|
|
'include_dirs': [np.get_include()]
|
2016-02-24 11:01:12 -06:00
|
|
|
})
|
|
|
|
|
|
2015-06-01 08:37:01 +07:00
|
|
|
setup(**kwargs)
|