Skip to content

Commit

Permalink
provide cythonized files
Browse files Browse the repository at this point in the history
  • Loading branch information
kif committed Apr 23, 2019
1 parent 3f14035 commit 0738c41
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#
# ###########################################################################*/

__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__authors__ = ["Jérôme Kieffer", "Thomas Vincent"]
__date__ = "23/04/2019"
__license__ = "MIT"
Expand Down Expand Up @@ -85,7 +86,10 @@

def get_version():
"""Returns current version number from version.py file"""
dirname = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, dirname)
import version
sys.path = sys.path[1:]
return version.strictversion


Expand Down Expand Up @@ -476,7 +480,7 @@ def finalize_openmp_options(self):
# By default Xcode5 & XCode6 do not support OpenMP, Xcode4 is OK.
osx = tuple([int(i) for i in platform.mac_ver()[0].split(".")])
if osx >= (10, 8):
logger.warning("OpenMP support ignored. Your platform do not support it")
logger.warning("OpenMP support ignored. Your platform does not support it.")
use_openmp = False

# Remove attributes used by distutils parsing
Expand Down Expand Up @@ -543,7 +547,7 @@ class BuildExt(build_ext):

LINK_ARGS_CONVERTER = {'-fopenmp': ''}

description = 'Build freesas extensions'
description = 'Build extensions'

def finalize_options(self):
build_ext.finalize_options(self)
Expand Down Expand Up @@ -626,7 +630,7 @@ def patch_extension(self, ext):

import numpy
numpy_version = [int(i) for i in numpy.version.short_version.split(".", 2)[:2]]
if numpy_version < [1,16]:
if numpy_version < [1, 16]:
ext.extra_compile_args.append(
'''-D'PyMODINIT_FUNC=%s__attribute__((visibility("default"))) %s ' ''' % (extern, return_type))
else:
Expand Down Expand Up @@ -775,7 +779,7 @@ class SourceDistWithCython(sdist):
without suppport of OpenMP.
"""

description = "Create a source distribution including cythonozed files (tarball, zip file, etc.)"
description = "Create a source distribution including cythonized files (tarball, zip file, etc.)"

def finalize_options(self):
sdist.finalize_options(self)
Expand All @@ -791,7 +795,8 @@ def cythonize_extensions(self):
self.extensions,
compiler_directives={'embedsignature': True,
'language_level': 3},
force=True
force=True,
compile_time_env={"HAVE_OPENMP": False}
)


Expand Down

0 comments on commit 0738c41

Please sign in to comment.