-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove dependency of cython and numpy when using setup.py only withou…
…t the requirements.txt
- Loading branch information
Showing
3 changed files
with
8,484 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,4 @@ build | |
*checkpoints* | ||
*.nfs | ||
*.sw[pmno] | ||
waterz/evaluate.cpp | ||
jwu/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from setuptools import setup, find_packages | ||
from setuptools.extension import Extension | ||
from Cython.Build import cythonize | ||
import numpy | ||
from setuptools.command.build_ext import build_ext as _build_ext | ||
#from Cython.Build import cythonize | ||
import os | ||
|
||
version = '0.8.2' | ||
|
@@ -14,17 +14,28 @@ | |
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
class build_ext(_build_ext): | ||
"""We assume no numpy at the begining | ||
https://stackoverflow.com/questions/19919905/how-to-bootstrap-numpy-installation-in-setup-py | ||
""" | ||
def finalize_options(self): | ||
_build_ext.finalize_options(self) | ||
# Prevent numpy from thinking it is still in its setup process: | ||
__builtins__.__NUMPY_SETUP__ = False | ||
import numpy | ||
self.include_dirs.append(numpy.get_include()) | ||
|
||
source_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'waterz') | ||
include_dirs = [ | ||
source_dir, | ||
os.path.join(source_dir, 'backend'), | ||
# os.path.dirname(get_python_inc()), | ||
numpy.get_include(), | ||
# numpy.get_include(), | ||
] | ||
extensions = [ | ||
Extension( | ||
'waterz.evaluate', | ||
sources=['waterz/evaluate.pyx', 'waterz/frontend_evaluate.cpp'], | ||
sources=['waterz/evaluate.cpp', 'waterz/frontend_evaluate.cpp'], | ||
include_dirs=include_dirs, | ||
language='c++', | ||
extra_link_args=['-std=c++11'], | ||
|
@@ -41,6 +52,8 @@ | |
author='Jan Funke, Jingpeng Wu', | ||
author_email='[email protected]', | ||
license='MIT', | ||
cmdclass={'build_ext': build_ext}, | ||
setup_requires=['numpy'], | ||
install_requires=requirements, | ||
tests_require=['pytest'], | ||
packages=find_packages(), | ||
|
@@ -56,7 +69,7 @@ | |
}, | ||
include_package_data=True, | ||
zip_safe=False, | ||
ext_modules=cythonize(extensions), | ||
ext_modules=extensions, | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
"Intended Audience :: Developers", | ||
|
Oops, something went wrong.