from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

import numpy

ALGPATH = "clusterpy/core/toolboxes/cluster/componentsAlg/"
ALGPKG = "clusterpy.core.toolboxes.cluster.componentsAlg."

CLUSPATH = "clusterpy/core/toolboxes/cluster/"
CLUSPKG = "clusterpy.core.toolboxes.cluster."


setup(
        name='clusterPy',
        version='0.9.9',
        description='Library of spatially constrained clustering algorithms',
        long_description="""
        clusterPy is a Python library with algorithms for spatially constrained clustering. clusterPy offers you some of the most cited algorithms for spatial aggregation.""",
        author='RiSE Group',
        author_email='software@rise-group.org',
        url='http://www.rise-group.org/section/Software/clusterPy/',
        packages=['clusterpy','clusterpy.core','clusterpy.core.data',
                  'clusterpy.core.geometry','clusterpy.core.toolboxes',
                  'clusterpy.core.toolboxes.cluster',
                  'clusterpy.core.toolboxes.cluster.componentsAlg'],
        ext_modules = [Extension(CLUSPKG+"arisel", [CLUSPATH+"arisel.pyx"],
                                 extra_link_args=['-fopenmp'],
                                 extra_compile_args=['-fopenmp']
                                 ),
                       Extension(ALGPKG+"distanceFunctions", [ALGPATH+"distanceFunctions.pyx"]),
		       Extension(ALGPKG+"dist2Regions", [ALGPATH+"dist2Regions.pyx"]),
		       Extension(ALGPKG+"selectionTypeFunctions", [ALGPATH+"selectionTypeFunctions.pyx"]),
                       Extension(ALGPKG+"init", [ALGPATH+"init.pyx"]),
                       Extension(ALGPKG+"objFunctions", [ALGPATH+"objFunctions.pyx"])
                       ],
        cmdclass = {'build_ext': build_ext}
        
        
        )

@@ -72,276 +72,8 @@
 ion%0A
-from Cython.Distutils import build_ext%0A%0Aimport numpy%0A%0AALGPATH = %22clusterpy/core/toolboxes/cluster/componentsAlg/%22%0AALGPKG = %22clusterpy.core.toolboxes.cluster.componentsAlg.%22%0A%0ACLUSPATH = %22clusterpy/core/toolboxes/cluster/%22%0ACLUSPKG = %22clusterpy.core.toolboxes.cluster.%22%0A%0A
 %0Aset
@@ -825,756 +825,8 @@
 '%5D,%0A
-        ext_modules = %5BExtension(CLUSPKG+%22arisel%22, %5BCLUSPATH+%22arisel.pyx%22%5D,%0A                                 extra_link_args=%5B'-fopenmp'%5D,%0A                                 extra_compile_args=%5B'-fopenmp'%5D%0A                                 ),%0A                       Extension(ALGPKG+%22distanceFunctions%22, %5BALGPATH+%22distanceFunctions.pyx%22%5D),%0A%09%09       Extension(ALGPKG+%22dist2Regions%22, %5BALGPATH+%22dist2Regions.pyx%22%5D),%0A%09%09       Extension(ALGPKG+%22selectionTypeFunctions%22, %5BALGPATH+%22selectionTypeFunctions.pyx%22%5D),%0A                       Extension(ALGPKG+%22init%22, %5BALGPATH+%22init.pyx%22%5D),%0A                       Extension(ALGPKG+%22objFunctions%22, %5BALGPATH+%22objFunctions.pyx%22%5D)%0A                       %5D,%0A        cmdclass = %7B'build_ext': build_ext%7D%0A        %0A        %0A
     

Remove cython Extension builder and build_ext from Setup