Skip to content

Commit

Permalink
Do not require cffi if pytorch build is disabled (#1014)
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Luehr <nluehr@nvidia.com>
  • Loading branch information
nluehr authored and alsrgv committed Apr 19, 2019
1 parent da85af2 commit 2770fca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,10 @@ def build_extensions(self):
raise DistutilsError(
'None of TensorFlow, PyTorch, or MXNet plugins were built. See errors above.')

require_list = ['cloudpickle', 'psutil', 'six']
# Skip cffi if pytorch extension explicitly disabled
if not os.environ.get('HOROVOD_WITHOUT_PYTORCH'):
require_list.append('cffi>=1.4.0')

setup(name='horovod',
version=__version__,
Expand All @@ -1007,7 +1011,7 @@ def build_extensions(self):
# If cffi is specified in setup_requires, it will need libffi to be installed on the machine,
# which is undesirable. Luckily, `install` action will install cffi before executing build,
# so it's only necessary for `build*` or `bdist*` actions.
setup_requires=['cffi>=1.4.0', 'cloudpickle', 'psutil', 'six'] if is_build_action() else [],
install_requires=['cffi>=1.4.0', 'cloudpickle', 'psutil', 'six'],
setup_requires=require_list if is_build_action() else [],
install_requires=require_list,
zip_safe=False,
scripts=['bin/horovodrun'])

0 comments on commit 2770fca

Please sign in to comment.