Skip to content

Commit

Permalink
Fix bug of install_requres in setup.py
Browse files Browse the repository at this point in the history
Signed-off-by: fengyuan <feng1.yuan@intel.com>
  • Loading branch information
fengyuan14 committed Feb 12, 2018
1 parent 93045fe commit 2085654
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ pip install -U setuptools

Then, install ideep from the source code:
```
pip install .
```
```
python setup.py install
```

Expand Down
17 changes: 11 additions & 6 deletions python/setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from setuptools import Command, distutils, Extension, setup
from numpy import get_include
from platform import system

import external
import sys

import setuptools.command.install
import setuptools.command.build_ext
import distutils.command.build
import distutils.command.clean

Expand Down Expand Up @@ -33,6 +33,13 @@ class build(distutils.command.build.build):
] + distutils.command.build.build.sub_commands


class build_ext(setuptools.command.build_ext.build_ext):
def run(self):
import numpy
self.include_dirs.append(numpy.get_include())
setuptools.command.build_ext.build_ext.run(self)


class install(setuptools.command.install.install):
def run(self):
if not self.skip_build:
Expand All @@ -48,6 +55,7 @@ def run(self):

cmdclass = {
'build': build,
'build_ext': build_ext,
'build_deps': build_deps,
'install': install,
'clean': clean,
Expand All @@ -73,8 +81,7 @@ def run(self):
link_opts = ['-Wl,-z,now', '-Wl,-z,noexecstack',
'-Wl,-rpath,' + '$ORIGIN/lib', '-L' + './external/lib']

includes = [get_include(),
'ideep4py/include',
includes = ['ideep4py/include',
'ideep4py/include/mkl',
'ideep4py/common',
'ideep4py/include/mm',
Expand Down Expand Up @@ -138,9 +145,7 @@ def run(self):
###############################################################################

install_requires = [
'numpy>=1.9.0'
'protobuf>=3.0.0',
'six>=1.9.0'
'numpy>=1.9,<=1.13',
]

tests_require = [
Expand Down

0 comments on commit 2085654

Please sign in to comment.