Skip to content
Snippets Groups Projects
Commit 0d450cdc authored by simply-nicky's avatar simply-nicky
Browse files

setup.py fixed

parent 3132eeb7
No related branches found
No related tags found
No related merge requests found
global-include *.pyx
global-include *.c
\ No newline at end of file
from setuptools import setup
from setuptools import setup, find_packages
from distutils.core import Extension
import numpy
import sys
......@@ -12,42 +12,31 @@ except ImportError:
else:
USE_CYTHON = True
ext = '.pyx' if USE_CYTHON else '.c'
extension_args = {'language': 'c',
'extra_compile_args': ['-fopenmp'],
'extra_link_args': ['-lomp'],
'libraries': cython_gsl.get_libraries(),
'library_dirs': [cython_gsl.get_library_dir(),
'/usr/local/lib',
os.path.join(sys.prefix, 'lib')],
'include_dirs': [numpy.get_include(),
cython_gsl.get_cython_include_dir(),
os.path.join(sys.prefix, 'include')],
'define_macros': [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]}
extensions = [Extension(name='pyrost.bin.beam_calc',
sources=['pyrost/bin/beam_calc' + ext], **extension_args),
Extension(name='pyrost.bin.st_utils',
sources=['pyrost/bin/st_utils' + ext], **extension_args)]
if USE_CYTHON:
extensions = [Extension(name='beam_calc',
sources=["pyrost/bin/beam_calc.pyx"],
language="c",
extra_compile_args=['-fopenmp'],
extra_link_args=['-lomp'],
libraries=cython_gsl.get_libraries(),
library_dirs=[cython_gsl.get_library_dir(), '/usr/local/lib',
os.path.join(sys.prefix, 'lib')],
include_dirs=[numpy.get_include(),
cython_gsl.get_cython_include_dir(),
os.path.join(sys.prefix, 'include')],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]),
Extension(name='st_utils',
sources=["pyrost/bin/st_utils.pyx"],
language="c",
extra_compile_args=['-fopenmp'],
extra_link_args=['-lomp'],
libraries=cython_gsl.get_libraries(),
library_dirs=[cython_gsl.get_library_dir(), '/usr/local/lib',
os.path.join(sys.prefix, 'lib')],
include_dirs=[numpy.get_include(),
cython_gsl.get_cython_include_dir(),
os.path.join(sys.prefix, 'include')],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")])]
extensions = cythonize(extensions, annotate=False, language_level="3",
build_dir="build",
compiler_directives={'cdivision': True,
'boundscheck': False,
'wraparound': False,
'binding': True,
'embedsignature': True})
else:
extensions = [Extension(name="pyrost/bin/*",
sources=["pyrost/bin/*.c"],
include_dirs=[numpy.get_include()])]
with open('README.md', 'r') as readme:
long_description = readme.read()
......@@ -59,13 +48,10 @@ setup(name='pyrost',
long_description=long_description,
long_description_content_type='text/markdown',
url="https://github.com/simply-nicky/rst",
install_requires=[
'Cython',
'CythonGSL',
'h5py',
'numpy',
'scipy',
],
packages=find_packages(),
include_package_data=True,
package_data={'pyrost.bin': ['*.pyx']},
install_requires=['Cython', 'CythonGSL', 'h5py', 'numpy', 'scipy',],
extras_require={'interactive': ['matplotlib', 'jupyter', 'pyximport']},
setup_requires=['pytest-runner'],
tests_require=['pytest'],
......@@ -75,5 +61,4 @@ setup(name='pyrost',
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent"
],
python_requires='>=3.7',
options={'build': {'build_lib': 'pyrost/bin'}})
python_requires='>=3.7')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment