setup.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env python3
  2. """
  3. Build the Cython demonstrations of low-level access to NumPy random
  4. Usage: python setup.py build_ext -i
  5. """
  6. import numpy as np
  7. from distutils.core import setup
  8. from Cython.Build import cythonize
  9. from setuptools.extension import Extension
  10. from os.path import join, dirname
  11. path = dirname(__file__)
  12. defs = [('NPY_NO_DEPRECATED_API', 0)]
  13. extending = Extension("extending",
  14. sources=[join(path, 'extending.pyx')],
  15. include_dirs=[
  16. np.get_include(),
  17. join(path, '..', '..')
  18. ],
  19. define_macros=defs,
  20. )
  21. distributions = Extension("extending_distributions",
  22. sources=[join(path, 'extending_distributions.pyx')],
  23. include_dirs=[np.get_include()],
  24. define_macros=defs,
  25. )
  26. extensions = [extending, distributions]
  27. setup(
  28. ext_modules=cythonize(extensions)
  29. )