OpenMC/setup.py

90 lines
2.7 KiB
Python
Raw Permalink Normal View History

#!/usr/bin/env python
import glob
import sys
2016-10-14 22:52:06 -04:00
import numpy as np
2017-10-13 16:21:34 -05:00
from setuptools import setup, find_packages
try:
from Cython.Build import cythonize
have_cython = True
except ImportError:
have_cython = False
# Determine shared library suffix
if sys.platform == 'darwin':
suffix = 'dylib'
else:
suffix = 'so'
# 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("'")
2017-09-29 11:11:18 -05:00
kwargs = {
'name': 'openmc',
'version': version,
'packages': find_packages(exclude=['tests*']),
2017-09-29 11:11:18 -05:00
'scripts': glob.glob('scripts/openmc-*'),
2017-10-02 14:06:14 -05:00
# Data files and librarries
'package_data': {
2019-09-05 07:31:13 -05:00
'openmc.lib': ['libopenmc.{}'.format(suffix)],
2020-05-26 11:33:36 -05:00
'openmc.data': ['mass16.txt', 'BREMX.DAT', '*.h5'],
'openmc.data.effective_dose': ['*.txt']
2017-10-02 14:06:14 -05:00
},
2017-10-02 14:06:14 -05:00
# Metadata
2017-10-13 16:21:34 -05:00
'author': 'The OpenMC Development Team',
'author_email': 'openmc-dev@googlegroups.com',
'description': 'OpenMC',
'url': 'https://openmc.org',
'download_url': 'https://github.com/openmc-dev/openmc/releases',
'project_urls': {
'Issue Tracker': 'https://github.com/openmc-dev/openmc/issues',
'Documentation': 'https://docs.openmc.org',
'Source Code': 'https://github.com/openmc-dev/openmc',
},
2017-09-29 11:11:18 -05:00
'classifiers': [
2017-10-02 14:06:14 -05:00
'Development Status :: 4 - Beta',
2017-09-29 11:11:18 -05:00
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Topic :: Scientific/Engineering'
'Programming Language :: C++',
2017-10-02 14:06:14 -05:00
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
2017-09-29 11:11:18 -05:00
],
# Dependencies
2020-02-24 11:55:42 -05:00
'python_requires': '>=3.5',
2017-10-13 16:21:34 -05:00
'install_requires': [
2017-12-24 16:06:05 +07:00
'numpy>=1.9', 'h5py', 'scipy', 'ipython', 'matplotlib',
'pandas', 'lxml', 'uncertainties'
2017-10-13 16:21:34 -05:00
],
2017-09-29 11:11:18 -05:00
'extras_require': {
'depletion-mpi': ['mpi4py'],
'docs': ['sphinx', 'sphinxcontrib-katex', 'sphinx-numfig', 'jupyter',
'sphinxcontrib-svg2pdfconverter', 'sphinx-rtd-theme',
'nbsphinx'],
'test': ['pytest', 'pytest-cov', 'colorama'],
2018-10-07 18:35:40 -05:00
'vtk': ['vtk'],
2017-09-29 11:11:18 -05:00
},
}
# If Cython is present, add resonance reconstruction and fast float_endf
if have_cython:
kwargs.update({
'ext_modules': cythonize('openmc/data/*.pyx'),
2016-10-14 22:52:06 -04:00
'include_dirs': [np.get_include()]
})
setup(**kwargs)