#Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))

# Get the long description from the relevant file
with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:
        long_description = f.read()

setup(
        name = 'cpnest',
        version = '0.0.1',
        description = 'CPNest: Parallel nested sampling',
        long_description=long_description,
        author = 'W. Del Pozzo, John Veitch',
        author_email='walter.delpozzo@ligo.org, john.veitch@ligo.org',
        license='MIT',
        classifiers =[
        # How mature is this project? Common values are
        #   3 - Alpha
        #   4 - Beta
        #   5 - Production/Stable
        'Development Status :: 3 - Alpha',

        # Indicate who your project is intended for
        'Intended Audience :: Data Analysts',
        'Topic :: Data Analysis :: Bayesian Inference',

        # Pick your license as you wish (should match "license" above)
        'License :: OSI Approved :: MIT License',

        # Specify the Python versions you support here. In particular, ensure
        # that you indicate whether you support Python 2, Python 3 or both.
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.2',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        ],

        keywords='nested sampling bayesian inference',
        packages=find_packages(exclude=['contrib','docs','tests*']),
        install_requires=['numpy','scipy'],
        # Don't know what this does
        extras_require={
            'dev': ['check-manifest'],
            'test': ['coverage'],
            },
        # Dictionary for data files
        # {'sample':['sample_file.dat']}
        package_data={},
        # To provide executable scripts, use entry points in preference to the
        # "scripts" keyword. Entry points provide cross-platform support and allow
        # pip to create the appropriate form of executable for the target platform.
        entry_points={
        #    'console_scripts':['sample=sample:main',
        #        ],
            },
            test_suite='tests'
        )


@@ -78,16 +78,49 @@
 ackages%0A
+from setuptools import Extension%0A
 # To use
@@ -185,16 +185,29 @@
 ort path
+%0Aimport numpy
 %0A%0Ahere =
@@ -1792,24 +1792,25 @@
 e',%0A        
+#
 packages=fin
@@ -1858,16 +1858,45 @@
 ts*'%5D),%0A
+        packages=%5B'cpnest'%5D,%0A
         
@@ -1927,24 +1927,78 @@
 ','scipy'%5D,%0A
+        setup_requires=%5B'setuptools_cython','numpy'%5D,%0A
         # Do
@@ -2624,16 +2624,438 @@
 ='tests'
+,%0A        ext_modules=%5B%0A                Extension('parameter',sources=%5B'cpnest/parameter.pyx'%5D,libraries=%5B'm'%5D,include_dirs=%5Bnumpy.get_include()%5D),%0A                Extension('proposals',sources=%5B'cpnest/proposals.pyx'%5D,libraries=%5B'm'%5D,include_dirs=%5Bnumpy.get_include()%5D),%0A                Extension('NestedSampling',sources=%5B'cpnest/NestedSampling.pyx'%5D,libraries=%5B'm'%5D,include_dirs=%5Bnumpy.get_include()%5D)%0A                %5D
 %0A       

Fix global setup.py script