2 from setuptools.command.build_py
import build_py
as _build
3 from setuptools
import setup
4 from subprocess
import call
11 """Specialized Python source builder.""" 13 call([
"mkdir",
"-p",
"build"])
14 if call([
"cmake",
"-H.",
"-Bbuild"]) != 0:
15 raise Exception(
"Could not run CMake configuration. Make sure CMake is installed !")
16 if call([
"make",
"-Cbuild",
"_ccllib"]) != 0:
17 raise Exception(
"Could not build CCL")
19 if os.path.exists(
"build/pyccl/_ccllib.so"):
20 call([
"cp",
"build/pyccl/_ccllib.so",
"pyccl/"])
22 raise Exception(
"Could not find wrapper shared library, compilation must have failed.")
23 if call([
"cp",
"build/pyccl/ccllib.py",
"pyccl/"]) != 0:
24 raise Exception(
"Could not find python module, SWIG must have failed.")
25 call([
"cp",
"include/ccl_params.ini",
"pyccl/"])
28 if call([
"cp",
"-r",
"build/extern/share/class/bbn",
"pyccl/"]) != 0:
29 raise Exception(
"Could not copy the CLASS BBN fikes, CLASS compilation must have failed.")
30 if call([
"cp",
"-r",
"build/extern/share/class/hyrec",
"pyccl/"]) != 0:
31 raise Exception(
"Could not copy the CLASS BBN fikes, CLASS compilation must have failed.")
36 with open(
'README.md', encoding=
"utf-8")
as f:
37 long_description = f.read()
40 description=
"Library of validated cosmological functions.",
41 long_description=long_description,
42 long_description_content_type=
'text/markdown',
44 url=
"https://github.com/LSSTDESC/CCL",
47 package_data={
'pyccl': [
'_ccllib.so',
'ccl_params.ini',
'bbn/*',
'hyrec/*']},
48 include_package_data =
True,
50 setup_requires=[
'setuptools_scm'],
51 install_requires=[
'numpy',
'pyyaml'],
52 test_suite=
'nose.collector',
53 tests_require=[
'nose'],
54 cmdclass={
'build_py': build},
56 'Development Status :: 4 - Beta',
57 'Intended Audience :: Science/Research',
58 'License :: OSI Approved',
59 'Operating System :: MacOS :: MacOS X',
60 'Operating System :: POSIX :: Linux',
61 'Programming Language :: C',
62 'Programming Language :: Python :: 2.7',
63 'Programming Language :: Python :: 3.5',
64 'Programming Language :: Python :: 3.6',
65 'Topic :: Scientific/Engineering :: Physics'