We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Dependency links in setup.py causing issues with private registry 
**Environment:**
1. Framework: (TensorFlow, Keras, PyTorch, MXNet) all
2. Framework version: n/a
3. Horovod version: 0.20.1+
4. MPI version: n/a
5. CUDA version: n/a
6. NCCL version:
7. Python version:
8. Spark / PySpark version:
9. OS and version:
10. GCC version:
11. CMake version:

**Checklist:**
1. Did you search issues to find if somebody asked this question before?
2. If your question is about hang, did you read [this doc](https://github.com/horovod/horovod/blob/master/docs/running.rst)?
3. If your question is about docker, did you read [this doc](https://github.com/horovod/horovod/blob/master/docs/docker.rst)?
4. Did you check if you question is answered in the [troubleshooting guide](https://github.com/horovod/horovod/blob/master/docs/troubleshooting.rst)?

**Bug report:**
Please describe erroneous behavior you're observing and steps to reproduce it.

In horovod 0.20.x the setup.py was updated to add dependency links. Although it says it is removed from pip, it still causes issues in enterprise settings when a private registry is used as pip for some reason tries to connect to download.pytorch.org. This causes horovod versions 0.20.x to be uninstallable as pip just waits for a timeout on these for a long long time. Can we please remove these from the setup.py? 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 # Copyright 2019 Uber Technologies, Inc. All Rights Reserved.
2 # Modifications copyright Microsoft
3 # Modifications copyright (C) 2020, NVIDIA CORPORATION. All rights reserved.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ==============================================================================
17 
18 import os
19 import subprocess
20 import sys
21 import textwrap
22 
23 from setuptools import setup, Extension, find_packages
24 from setuptools.command.build_ext import build_ext
25 
26 from horovod import __version__
27 
28 
29 class CMakeExtension(Extension):
30     def __init__(self, name, cmake_lists_dir='.', sources=[], **kwa):
31         Extension.__init__(self, name, sources=sources, **kwa)
32         self.cmake_lists_dir = os.path.abspath(cmake_lists_dir)
33 
34 
35 tensorflow_mpi_lib = CMakeExtension('horovod.tensorflow.mpi_lib',
36                                      cmake_lists_dir='.', sources=[])
37 torch_mpi_lib_v2 = CMakeExtension('horovod.torch.mpi_lib_v2',
38                                      cmake_lists_dir='.', sources=[])
39 mxnet_mpi_lib = CMakeExtension('horovod.mxnet.mpi_lib',
40                                      cmake_lists_dir='.', sources=[])
41 
42 def is_build_action():
43     if len(sys.argv) <= 1:
44         return False
45 
46     if sys.argv[1].startswith('build'):
47         return True
48 
49     if sys.argv[1].startswith('bdist'):
50         return True
51 
52     if sys.argv[1].startswith('install'):
53         return True
54 
55 
56 def get_cmake_bin():
57     return os.environ.get('HOROVOD_CMAKE', 'cmake')
58 
59 
60 class custom_build_ext(build_ext):
61     def build_extensions(self):
62         cmake_bin = get_cmake_bin()
63 
64         config = 'Debug' if self.debug else 'RelWithDebInfo'
65 
66         ext_name = self.extensions[0].name
67         build_dir = self.get_ext_fullpath(ext_name).replace(self.get_ext_filename(ext_name), '')
68         build_dir = os.path.abspath(build_dir)
69 
70         cmake_args = ['-DCMAKE_BUILD_TYPE=' + config,
71                       '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(config.upper(), build_dir),
72                       '-DPYTHON_EXECUTABLE:FILEPATH=' + sys.executable]
73 
74         make_args = []
75         if self.verbose:
76             make_args.append('VERBOSE=1')
77 
78         cmake_build_args = ['--config', config]
79         if make_args:
80             # -- specifies that these args are going to the native build tool: make
81             cmake_build_args += ['--'] + make_args
82 
83         if not os.path.exists(self.build_temp):
84             os.makedirs(self.build_temp)
85 
86         # Config and build the extension
87         try:
88             subprocess.check_call([cmake_bin, self.extensions[0].cmake_lists_dir] + cmake_args,
89                                   cwd=self.build_temp)
90             subprocess.check_call([cmake_bin, '--build', '.'] + cmake_build_args,
91                                   cwd=self.build_temp)
92         except OSError as e:
93             raise RuntimeError('CMake failed: {}'.format(str(e)))
94 
95 
96 # python packages required to use horovod in general
97 require_list = ['cloudpickle', 'psutil', 'pyyaml', 'dataclasses;python_version<"3.7"']
98 
99 # framework dependencies
100 tensorflow_require_list = ['tensorflow']
101 tensorflow_cpu_require_list = ['tensorflow-cpu']
102 tensorflow_gpu_require_list = ['tensorflow-gpu']
103 keras_require_list = ['keras>=2.0.8,!=2.0.9,!=2.1.0,!=2.1.1']
104 pytorch_require_list = ['torch']
105 mxnet_require_list = ['mxnet>=1.4.1']
106 pyspark_require_list = ['pyspark>=2.3.2;python_version<"3.8"',
107                         'pyspark>=3.0.0;python_version>="3.8"']
108 # Pin h5py: https://github.com/h5py/h5py/issues/1732
109 spark_require_list = ['h5py<3', 'numpy', 'petastorm>=0.9.8', 'pyarrow>=0.15.0'] + \
110                      pyspark_require_list
111 ray_require_list = ['ray']
112 
113 # all frameworks' dependencies
114 all_frameworks_require_list = tensorflow_require_list + \
115                               tensorflow_gpu_require_list + \
116                               keras_require_list + \
117                               pytorch_require_list + \
118                               mxnet_require_list + \
119                               spark_require_list
120 
121 # python packages required / recommended to develop horovod
122 # e.g., set of framework versions pinned for development, keep in sync with Dockerfile.test.cpu
123 # NOTE: do not use versions with +cpu or +gpu here as users would need to add --find-links to pip
124 dev_require_list = ['tensorflow-cpu==1.15.0',
125                     'keras==2.2.4',
126                     'torch==1.2.0',
127                     'torchvision==0.4.0',
128                     'mxnet==1.5.0',
129                     'pyspark==2.4.7'] + spark_require_list
130 
131 # python packages required only to run tests
132 # Pin h5py: https://github.com/h5py/h5py/issues/1732
133 test_require_list = ['mock', 'pytest', 'pytest-forked', 'parameterized', 'h5py<3']
134 
135 # Skip cffi if pytorch extension explicitly disabled
136 if not os.environ.get('HOROVOD_WITHOUT_PYTORCH'):
137     require_list.append('cffi>=1.4.0')
138 
139 
140 def get_package_version():
141     return __version__ + "+" + os.environ['HOROVOD_LOCAL_VERSION'] if 'HOROVOD_LOCAL_VERSION' in os.environ else __version__
142 
143 
144 setup(name='horovod',
145       version=get_package_version(),
146       packages=find_packages(),
147       description='Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.',
148       author='The Horovod Authors',
149       long_description=textwrap.dedent('''\
150           Horovod is a distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.
151           The goal of Horovod is to make distributed Deep Learning fast and easy to use.'''),
152       url='https://github.com/horovod/horovod',
153       keywords=['deep learning', 'tensorflow', 'keras', 'pytorch', 'mxnet', 'spark', 'AI'],
154       classifiers=[
155           'License :: OSI Approved :: Apache Software License',
156           'Development Status :: 4 - Beta',
157           'Intended Audience :: Developers',
158           'Topic :: Scientific/Engineering :: Artificial Intelligence',
159       ],
160       ext_modules=[tensorflow_mpi_lib, torch_mpi_lib_v2, mxnet_mpi_lib],
161       cmdclass={'build_ext': custom_build_ext},
162       # cffi is required for PyTorch
163       # If cffi is specified in setup_requires, it will need libffi to be installed on the machine,
164       # which is undesirable.  Luckily, `install` action will install cffi before executing build,
165       # so it's only necessary for `build*` or `bdist*` actions.
166       setup_requires=require_list if is_build_action() else [],
167       install_requires=require_list,
168       tests_require=test_require_list,
169       extras_require={
170           'all-frameworks': all_frameworks_require_list,
171           'tensorflow': tensorflow_require_list,
172           'tensorflow-cpu': tensorflow_cpu_require_list,
173           'tensorflow-gpu': tensorflow_gpu_require_list,
174           'keras': keras_require_list,
175           'pytorch': pytorch_require_list,
176           'mxnet': mxnet_require_list,
177           'spark': spark_require_list,
178           'ray': ray_require_list,
179           'dev': dev_require_list,
180           'test': test_require_list,
181       },
182       # not used by pip since 19.0: https://github.com/pypa/pip/issues/4187#issuecomment-415067034
183       # here for completeness as pip install needs some of these via -f for versions with '+cpu'
184       # for examples, see Dockerfile.test.cpu and Dockerfile.test.gpu
185       dependency_links=[
186           'https://download.pytorch.org/whl/torch_stable.html',
187           'https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html'
188       ],
189       python_requires='>=3.6',
190       zip_safe=False,
191       entry_points={
192           'console_scripts': [
193               'horovodrun = horovod.runner.launch:run_commandline'
194           ]
195       })
196
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -179,13 +179,6 @@
           'dev': dev_require_list,
           'test': test_require_list,
       },
-      # not used by pip since 19.0: https://github.com/pypa/pip/issues/4187#issuecomment-415067034
-      # here for completeness as pip install needs some of these via -f for versions with '+cpu'
-      # for examples, see Dockerfile.test.cpu and Dockerfile.test.gpu
-      dependency_links=[
-          'https://download.pytorch.org/whl/torch_stable.html',
-          'https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html'
-      ],
       python_requires='>=3.6',
       zip_safe=False,
       entry_points={

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -179,13 +179,6 @@\n           'dev': dev_require_list,\n           'test': test_require_list,\n       },\n-      # not used by pip since 19.0: https://github.com/pypa/pip/issues/4187#issuecomment-415067034\n-      # here for completeness as pip install needs some of these via -f for versions with '+cpu'\n-      # for examples, see Dockerfile.test.cpu and Dockerfile.test.gpu\n-      dependency_links=[\n-          'https://download.pytorch.org/whl/torch_stable.html',\n-          'https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html'\n-      ],\n       python_requires='>=3.6',\n       zip_safe=False,\n       entry_points={\n", "issue": "Dependency links in setup.py causing issues with private registry \n**Environment:**\r\n1. Framework: (TensorFlow, Keras, PyTorch, MXNet) all\r\n2. Framework version: n/a\r\n3. Horovod version: 0.20.1+\r\n4. MPI version: n/a\r\n5. CUDA version: n/a\r\n6. NCCL version:\r\n7. Python version:\r\n8. Spark / PySpark version:\r\n9. OS and version:\r\n10. GCC version:\r\n11. CMake version:\r\n\r\n**Checklist:**\r\n1. Did you search issues to find if somebody asked this question before?\r\n2. If your question is about hang, did you read [this doc](https://github.com/horovod/horovod/blob/master/docs/running.rst)?\r\n3. If your question is about docker, did you read [this doc](https://github.com/horovod/horovod/blob/master/docs/docker.rst)?\r\n4. Did you check if you question is answered in the [troubleshooting guide](https://github.com/horovod/horovod/blob/master/docs/troubleshooting.rst)?\r\n\r\n**Bug report:**\r\nPlease describe erroneous behavior you're observing and steps to reproduce it.\r\n\r\nIn horovod 0.20.x the setup.py was updated to add dependency links. Although it says it is removed from pip, it still causes issues in enterprise settings when a private registry is used as pip for some reason tries to connect to download.pytorch.org. This causes horovod versions 0.20.x to be uninstallable as pip just waits for a timeout on these for a long long time. Can we please remove these from the setup.py? \n", "before_files": [{"content": "# Copyright 2019 Uber Technologies, Inc. All Rights Reserved.\n# Modifications copyright Microsoft\n# Modifications copyright (C) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# ==============================================================================\n\nimport os\nimport subprocess\nimport sys\nimport textwrap\n\nfrom setuptools import setup, Extension, find_packages\nfrom setuptools.command.build_ext import build_ext\n\nfrom horovod import __version__\n\n\nclass CMakeExtension(Extension):\n    def __init__(self, name, cmake_lists_dir='.', sources=[], **kwa):\n        Extension.__init__(self, name, sources=sources, **kwa)\n        self.cmake_lists_dir = os.path.abspath(cmake_lists_dir)\n\n\ntensorflow_mpi_lib = CMakeExtension('horovod.tensorflow.mpi_lib',\n                                     cmake_lists_dir='.', sources=[])\ntorch_mpi_lib_v2 = CMakeExtension('horovod.torch.mpi_lib_v2',\n                                     cmake_lists_dir='.', sources=[])\nmxnet_mpi_lib = CMakeExtension('horovod.mxnet.mpi_lib',\n                                     cmake_lists_dir='.', sources=[])\n\ndef is_build_action():\n    if len(sys.argv) <= 1:\n        return False\n\n    if sys.argv[1].startswith('build'):\n        return True\n\n    if sys.argv[1].startswith('bdist'):\n        return True\n\n    if sys.argv[1].startswith('install'):\n        return True\n\n\ndef get_cmake_bin():\n    return os.environ.get('HOROVOD_CMAKE', 'cmake')\n\n\nclass custom_build_ext(build_ext):\n    def build_extensions(self):\n        cmake_bin = get_cmake_bin()\n\n        config = 'Debug' if self.debug else 'RelWithDebInfo'\n\n        ext_name = self.extensions[0].name\n        build_dir = self.get_ext_fullpath(ext_name).replace(self.get_ext_filename(ext_name), '')\n        build_dir = os.path.abspath(build_dir)\n\n        cmake_args = ['-DCMAKE_BUILD_TYPE=' + config,\n                      '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(config.upper(), build_dir),\n                      '-DPYTHON_EXECUTABLE:FILEPATH=' + sys.executable]\n\n        make_args = []\n        if self.verbose:\n            make_args.append('VERBOSE=1')\n\n        cmake_build_args = ['--config', config]\n        if make_args:\n            # -- specifies that these args are going to the native build tool: make\n            cmake_build_args += ['--'] + make_args\n\n        if not os.path.exists(self.build_temp):\n            os.makedirs(self.build_temp)\n\n        # Config and build the extension\n        try:\n            subprocess.check_call([cmake_bin, self.extensions[0].cmake_lists_dir] + cmake_args,\n                                  cwd=self.build_temp)\n            subprocess.check_call([cmake_bin, '--build', '.'] + cmake_build_args,\n                                  cwd=self.build_temp)\n        except OSError as e:\n            raise RuntimeError('CMake failed: {}'.format(str(e)))\n\n\n# python packages required to use horovod in general\nrequire_list = ['cloudpickle', 'psutil', 'pyyaml', 'dataclasses;python_version<\"3.7\"']\n\n# framework dependencies\ntensorflow_require_list = ['tensorflow']\ntensorflow_cpu_require_list = ['tensorflow-cpu']\ntensorflow_gpu_require_list = ['tensorflow-gpu']\nkeras_require_list = ['keras>=2.0.8,!=2.0.9,!=2.1.0,!=2.1.1']\npytorch_require_list = ['torch']\nmxnet_require_list = ['mxnet>=1.4.1']\npyspark_require_list = ['pyspark>=2.3.2;python_version<\"3.8\"',\n                        'pyspark>=3.0.0;python_version>=\"3.8\"']\n# Pin h5py: https://github.com/h5py/h5py/issues/1732\nspark_require_list = ['h5py<3', 'numpy', 'petastorm>=0.9.8', 'pyarrow>=0.15.0'] + \\\n                     pyspark_require_list\nray_require_list = ['ray']\n\n# all frameworks' dependencies\nall_frameworks_require_list = tensorflow_require_list + \\\n                              tensorflow_gpu_require_list + \\\n                              keras_require_list + \\\n                              pytorch_require_list + \\\n                              mxnet_require_list + \\\n                              spark_require_list\n\n# python packages required / recommended to develop horovod\n# e.g., set of framework versions pinned for development, keep in sync with Dockerfile.test.cpu\n# NOTE: do not use versions with +cpu or +gpu here as users would need to add --find-links to pip\ndev_require_list = ['tensorflow-cpu==1.15.0',\n                    'keras==2.2.4',\n                    'torch==1.2.0',\n                    'torchvision==0.4.0',\n                    'mxnet==1.5.0',\n                    'pyspark==2.4.7'] + spark_require_list\n\n# python packages required only to run tests\n# Pin h5py: https://github.com/h5py/h5py/issues/1732\ntest_require_list = ['mock', 'pytest', 'pytest-forked', 'parameterized', 'h5py<3']\n\n# Skip cffi if pytorch extension explicitly disabled\nif not os.environ.get('HOROVOD_WITHOUT_PYTORCH'):\n    require_list.append('cffi>=1.4.0')\n\n\ndef get_package_version():\n    return __version__ + \"+\" + os.environ['HOROVOD_LOCAL_VERSION'] if 'HOROVOD_LOCAL_VERSION' in os.environ else __version__\n\n\nsetup(name='horovod',\n      version=get_package_version(),\n      packages=find_packages(),\n      description='Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.',\n      author='The Horovod Authors',\n      long_description=textwrap.dedent('''\\\n          Horovod is a distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.\n          The goal of Horovod is to make distributed Deep Learning fast and easy to use.'''),\n      url='https://github.com/horovod/horovod',\n      keywords=['deep learning', 'tensorflow', 'keras', 'pytorch', 'mxnet', 'spark', 'AI'],\n      classifiers=[\n          'License :: OSI Approved :: Apache Software License',\n          'Development Status :: 4 - Beta',\n          'Intended Audience :: Developers',\n          'Topic :: Scientific/Engineering :: Artificial Intelligence',\n      ],\n      ext_modules=[tensorflow_mpi_lib, torch_mpi_lib_v2, mxnet_mpi_lib],\n      cmdclass={'build_ext': custom_build_ext},\n      # cffi is required for PyTorch\n      # If cffi is specified in setup_requires, it will need libffi to be installed on the machine,\n      # which is undesirable.  Luckily, `install` action will install cffi before executing build,\n      # so it's only necessary for `build*` or `bdist*` actions.\n      setup_requires=require_list if is_build_action() else [],\n      install_requires=require_list,\n      tests_require=test_require_list,\n      extras_require={\n          'all-frameworks': all_frameworks_require_list,\n          'tensorflow': tensorflow_require_list,\n          'tensorflow-cpu': tensorflow_cpu_require_list,\n          'tensorflow-gpu': tensorflow_gpu_require_list,\n          'keras': keras_require_list,\n          'pytorch': pytorch_require_list,\n          'mxnet': mxnet_require_list,\n          'spark': spark_require_list,\n          'ray': ray_require_list,\n          'dev': dev_require_list,\n          'test': test_require_list,\n      },\n      # not used by pip since 19.0: https://github.com/pypa/pip/issues/4187#issuecomment-415067034\n      # here for completeness as pip install needs some of these via -f for versions with '+cpu'\n      # for examples, see Dockerfile.test.cpu and Dockerfile.test.gpu\n      dependency_links=[\n          'https://download.pytorch.org/whl/torch_stable.html',\n          'https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html'\n      ],\n      python_requires='>=3.6',\n      zip_safe=False,\n      entry_points={\n          'console_scripts': [\n              'horovodrun = horovod.runner.launch:run_commandline'\n          ]\n      })\n", "path": "setup.py"}], "after_files": [{"content": "# Copyright 2019 Uber Technologies, Inc. All Rights Reserved.\n# Modifications copyright Microsoft\n# Modifications copyright (C) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# ==============================================================================\n\nimport os\nimport subprocess\nimport sys\nimport textwrap\n\nfrom setuptools import setup, Extension, find_packages\nfrom setuptools.command.build_ext import build_ext\n\nfrom horovod import __version__\n\n\nclass CMakeExtension(Extension):\n    def __init__(self, name, cmake_lists_dir='.', sources=[], **kwa):\n        Extension.__init__(self, name, sources=sources, **kwa)\n        self.cmake_lists_dir = os.path.abspath(cmake_lists_dir)\n\n\ntensorflow_mpi_lib = CMakeExtension('horovod.tensorflow.mpi_lib',\n                                     cmake_lists_dir='.', sources=[])\ntorch_mpi_lib_v2 = CMakeExtension('horovod.torch.mpi_lib_v2',\n                                     cmake_lists_dir='.', sources=[])\nmxnet_mpi_lib = CMakeExtension('horovod.mxnet.mpi_lib',\n                                     cmake_lists_dir='.', sources=[])\n\ndef is_build_action():\n    if len(sys.argv) <= 1:\n        return False\n\n    if sys.argv[1].startswith('build'):\n        return True\n\n    if sys.argv[1].startswith('bdist'):\n        return True\n\n    if sys.argv[1].startswith('install'):\n        return True\n\n\ndef get_cmake_bin():\n    return os.environ.get('HOROVOD_CMAKE', 'cmake')\n\n\nclass custom_build_ext(build_ext):\n    def build_extensions(self):\n        cmake_bin = get_cmake_bin()\n\n        config = 'Debug' if self.debug else 'RelWithDebInfo'\n\n        ext_name = self.extensions[0].name\n        build_dir = self.get_ext_fullpath(ext_name).replace(self.get_ext_filename(ext_name), '')\n        build_dir = os.path.abspath(build_dir)\n\n        cmake_args = ['-DCMAKE_BUILD_TYPE=' + config,\n                      '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(config.upper(), build_dir),\n                      '-DPYTHON_EXECUTABLE:FILEPATH=' + sys.executable]\n\n        make_args = []\n        if self.verbose:\n            make_args.append('VERBOSE=1')\n\n        cmake_build_args = ['--config', config]\n        if make_args:\n            # -- specifies that these args are going to the native build tool: make\n            cmake_build_args += ['--'] + make_args\n\n        if not os.path.exists(self.build_temp):\n            os.makedirs(self.build_temp)\n\n        # Config and build the extension\n        try:\n            subprocess.check_call([cmake_bin, self.extensions[0].cmake_lists_dir] + cmake_args,\n                                  cwd=self.build_temp)\n            subprocess.check_call([cmake_bin, '--build', '.'] + cmake_build_args,\n                                  cwd=self.build_temp)\n        except OSError as e:\n            raise RuntimeError('CMake failed: {}'.format(str(e)))\n\n\n# python packages required to use horovod in general\nrequire_list = ['cloudpickle', 'psutil', 'pyyaml', 'dataclasses;python_version<\"3.7\"']\n\n# framework dependencies\ntensorflow_require_list = ['tensorflow']\ntensorflow_cpu_require_list = ['tensorflow-cpu']\ntensorflow_gpu_require_list = ['tensorflow-gpu']\nkeras_require_list = ['keras>=2.0.8,!=2.0.9,!=2.1.0,!=2.1.1']\npytorch_require_list = ['torch']\nmxnet_require_list = ['mxnet>=1.4.1']\npyspark_require_list = ['pyspark>=2.3.2;python_version<\"3.8\"',\n                        'pyspark>=3.0.0;python_version>=\"3.8\"']\n# Pin h5py: https://github.com/h5py/h5py/issues/1732\nspark_require_list = ['h5py<3', 'numpy', 'petastorm>=0.9.8', 'pyarrow>=0.15.0'] + \\\n                     pyspark_require_list\nray_require_list = ['ray']\n\n# all frameworks' dependencies\nall_frameworks_require_list = tensorflow_require_list + \\\n                              tensorflow_gpu_require_list + \\\n                              keras_require_list + \\\n                              pytorch_require_list + \\\n                              mxnet_require_list + \\\n                              spark_require_list\n\n# python packages required / recommended to develop horovod\n# e.g., set of framework versions pinned for development, keep in sync with Dockerfile.test.cpu\n# NOTE: do not use versions with +cpu or +gpu here as users would need to add --find-links to pip\ndev_require_list = ['tensorflow-cpu==1.15.0',\n                    'keras==2.2.4',\n                    'torch==1.2.0',\n                    'torchvision==0.4.0',\n                    'mxnet==1.5.0',\n                    'pyspark==2.4.7'] + spark_require_list\n\n# python packages required only to run tests\n# Pin h5py: https://github.com/h5py/h5py/issues/1732\ntest_require_list = ['mock', 'pytest', 'pytest-forked', 'parameterized', 'h5py<3']\n\n# Skip cffi if pytorch extension explicitly disabled\nif not os.environ.get('HOROVOD_WITHOUT_PYTORCH'):\n    require_list.append('cffi>=1.4.0')\n\n\ndef get_package_version():\n    return __version__ + \"+\" + os.environ['HOROVOD_LOCAL_VERSION'] if 'HOROVOD_LOCAL_VERSION' in os.environ else __version__\n\n\nsetup(name='horovod',\n      version=get_package_version(),\n      packages=find_packages(),\n      description='Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.',\n      author='The Horovod Authors',\n      long_description=textwrap.dedent('''\\\n          Horovod is a distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.\n          The goal of Horovod is to make distributed Deep Learning fast and easy to use.'''),\n      url='https://github.com/horovod/horovod',\n      keywords=['deep learning', 'tensorflow', 'keras', 'pytorch', 'mxnet', 'spark', 'AI'],\n      classifiers=[\n          'License :: OSI Approved :: Apache Software License',\n          'Development Status :: 4 - Beta',\n          'Intended Audience :: Developers',\n          'Topic :: Scientific/Engineering :: Artificial Intelligence',\n      ],\n      ext_modules=[tensorflow_mpi_lib, torch_mpi_lib_v2, mxnet_mpi_lib],\n      cmdclass={'build_ext': custom_build_ext},\n      # cffi is required for PyTorch\n      # If cffi is specified in setup_requires, it will need libffi to be installed on the machine,\n      # which is undesirable.  Luckily, `install` action will install cffi before executing build,\n      # so it's only necessary for `build*` or `bdist*` actions.\n      setup_requires=require_list if is_build_action() else [],\n      install_requires=require_list,\n      tests_require=test_require_list,\n      extras_require={\n          'all-frameworks': all_frameworks_require_list,\n          'tensorflow': tensorflow_require_list,\n          'tensorflow-cpu': tensorflow_cpu_require_list,\n          'tensorflow-gpu': tensorflow_gpu_require_list,\n          'keras': keras_require_list,\n          'pytorch': pytorch_require_list,\n          'mxnet': mxnet_require_list,\n          'spark': spark_require_list,\n          'ray': ray_require_list,\n          'dev': dev_require_list,\n          'test': test_require_list,\n      },\n      python_requires='>=3.6',\n      zip_safe=False,\n      entry_points={\n          'console_scripts': [\n              'horovodrun = horovod.runner.launch:run_commandline'\n          ]\n      })\n", "path": "setup.py"}]}