Skip to content

Commit 860449c

Browse files
committed
revert changes to setup.py
Signed-off-by: masadcv <muhammad.asad@kcl.ac.uk>
1 parent c9a84c5 commit 860449c

1 file changed

Lines changed: 5 additions & 21 deletions

File tree

setup.py

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
import numpy
23
import setuptools
34
from distutils.core import setup
45
from distutils.extension import Extension
@@ -9,7 +10,7 @@
910
module_name1 = 'maxflow'
1011
maxflow_source = "maxflow_python/wrap_py{0:}.cpp".format(py_version)
1112
module1 = Extension(module_name1,
12-
include_dirs = ['./dependency', './maxflow_python'],
13+
include_dirs = [numpy.get_include(),'./dependency', './maxflow_python'],
1314
sources = ['maxflow_python/maxflow.cpp',
1415
'maxflow_python/util.cpp',
1516
'dependency/maxflow-v3.0/graph.cpp',
@@ -19,7 +20,7 @@
1920
module_name2 = 'denseCRF'
2021
densecrf_source = "densecrf_python/wrap2D_py{0:}.cpp".format(py_version)
2122
module2 = Extension(module_name2,
22-
include_dirs = [
23+
include_dirs = [numpy.get_include(),
2324
'./dependency/densecrf/include',
2425
'./dependency/densecrf/external/liblbfgs/include'],
2526
sources=['./densecrf_python/densecrf.cpp',
@@ -39,7 +40,7 @@
3940
module_name3 = 'denseCRF3D'
4041
densecrf_source = "densecrf_python/wrap3D_py{0:}.cpp".format(py_version)
4142
module3 = Extension(module_name3,
42-
include_dirs = [
43+
include_dirs = [numpy.get_include(),
4344
'./dependency/densecrf3d/include',
4445
'./dependency/densecrf/external/liblbfgs/include'],
4546
sources=['./densecrf_python/densecrf3d.cpp',
@@ -68,20 +69,6 @@
6869
with open('README.md', encoding='utf-8') as f:
6970
long_description = f.read()
7071

71-
from setuptools.command.build_ext import build_ext
72-
73-
class CustomBuildExtCommand(build_ext):
74-
"""build_ext command for use when numpy headers are needed."""
75-
def run(self):
76-
77-
# Import numpy here, only when headers are needed
78-
import numpy
79-
80-
# Add numpy headers to include_dirs
81-
self.include_dirs.append(numpy.get_include())
82-
83-
# Call original build_ext command
84-
build_ext.run(self)
8572

8673
setup(name=package_name,
8774
version = "0.1.1",
@@ -100,10 +87,7 @@ def run(self):
10087
'Programming Language :: Python :: 2',
10188
'Programming Language :: Python :: 3',
10289
],
103-
python_requires = '>=3.6',
104-
cmdclass = {'build_ext': CustomBuildExtCommand},
105-
install_requires=['numpy'],
106-
)
90+
python_requires = '>=3.6')
10791

10892

10993
# to build, run python stup.py build or python setup.py build_ext --inplace

0 commit comments

Comments
 (0)