prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Not possible to install Ray from git
  I want to install Ray for Python 3.
  
  ```
  $ apt-get install -y cmake pkg-config python3-dev build-essential autoconf curl libtool libboost-all-dev unzip
  $ pip3 install git+https://github.com/ray-project/ray.git@37282330c0ea687fd1b983176dce85731fcf189d#subdirectory=python
  ```
  
  But this tries to install it for python2.7, and not python3, failing with:
  
  ```
      CMake Error at cmake_modules/FindNumPy.cmake:62 (message):
        NumPy import failure:
      
        Traceback (most recent call last):
      
          File "<string>", line 1, in <module>
      
        ImportError: No module named numpy
  ```
  
  Because numpy is installed only for Python 3.
  
  </issue>
  <code>
  [start of python/setup.py]
  1 from __future__ import absolute_import
  2 from __future__ import division
  3 from __future__ import print_function
  4 
  5 import os
  6 import shutil
  7 import subprocess
  8 import sys
  9 
  10 from setuptools import setup, find_packages, Distribution
  11 import setuptools.command.build_ext as _build_ext
  12 
  13 # Ideally, we could include these files by putting them in a
  14 # MANIFEST.in or using the package_data argument to setup, but the
  15 # MANIFEST.in gets applied at the very beginning when setup.py runs
  16 # before these files have been created, so we have to move the files
  17 # manually.
  18 ray_files = [
  19     "ray/core/src/common/thirdparty/redis/src/redis-server",
  20     "ray/core/src/common/redis_module/libray_redis_module.so",
  21     "ray/core/src/plasma/plasma_store",
  22     "ray/core/src/plasma/plasma_manager",
  23     "ray/core/src/local_scheduler/local_scheduler",
  24     "ray/core/src/local_scheduler/liblocal_scheduler_library.so",
  25     "ray/core/src/numbuf/libnumbuf.so",
  26     "ray/core/src/global_scheduler/global_scheduler",
  27     "ray/WebUI.ipynb"
  28 ]
  29 
  30 
  31 class build_ext(_build_ext.build_ext):
  32     def run(self):
  33         # Note: We are passing in sys.executable so that we use the same
  34         # version of Python to build pyarrow inside the build.sh script. Note
  35         # that certain flags will not be passed along such as --user or sudo.
  36         # TODO(rkn): Fix this.
  37         subprocess.check_call(["../build.sh", sys.executable])
  38 
  39         # We also need to install pyarrow along with Ray, so make sure that the
  40         # relevant non-Python pyarrow files get copied.
  41         pyarrow_files = [
  42             os.path.join("ray/pyarrow_files/pyarrow", filename)
  43             for filename in os.listdir("./ray/pyarrow_files/pyarrow")
  44             if not os.path.isdir(os.path.join("ray/pyarrow_files/pyarrow",
  45                                               filename))]
  46 
  47         files_to_include = ray_files + pyarrow_files
  48 
  49         for filename in files_to_include:
  50             self.move_file(filename)
  51         # Copy over the autogenerated flatbuffer Python bindings.
  52         generated_python_directory = "ray/core/generated"
  53         for filename in os.listdir(generated_python_directory):
  54             if filename[-3:] == ".py":
  55                 self.move_file(os.path.join(generated_python_directory,
  56                                             filename))
  57 
  58     def move_file(self, filename):
  59         # TODO(rkn): This feels very brittle. It may not handle all cases. See
  60         # https://github.com/apache/arrow/blob/master/python/setup.py for an
  61         # example.
  62         source = filename
  63         destination = os.path.join(self.build_lib, filename)
  64         # Create the target directory if it doesn't already exist.
  65         parent_directory = os.path.dirname(destination)
  66         if not os.path.exists(parent_directory):
  67             os.makedirs(parent_directory)
  68         print("Copying {} to {}.".format(source, destination))
  69         shutil.copy(source, destination)
  70 
  71 
  72 class BinaryDistribution(Distribution):
  73     def has_ext_modules(self):
  74         return True
  75 
  76 
  77 setup(name="ray",
  78       version="0.1.2",
  79       packages=find_packages(),
  80       cmdclass={"build_ext": build_ext},
  81       # The BinaryDistribution argument triggers build_ext.
  82       distclass=BinaryDistribution,
  83       install_requires=["numpy",
  84                         "funcsigs",
  85                         "click",
  86                         "colorama",
  87                         "psutil",
  88                         "redis",
  89                         "cloudpickle >= 0.2.2",
  90                         "flatbuffers"],
  91       entry_points={"console_scripts": ["ray=ray.scripts.scripts:main"]},
  92       include_package_data=True,
  93       zip_safe=False,
  94       license="Apache 2.0")
  95
  [end of python/setup.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/python/setup.py b/python/setup.py
  --- a/python/setup.py
  +++ b/python/setup.py
  @@ -81,12 +81,15 @@
         # The BinaryDistribution argument triggers build_ext.
         distclass=BinaryDistribution,
         install_requires=["numpy",
  +                        "cython",
                           "funcsigs",
                           "click",
                           "colorama",
                           "psutil",
                           "redis",
                           "cloudpickle >= 0.2.2",
  +                        # The six module is required by pyarrow.
  +                        "six >= 1.0.0",
                           "flatbuffers"],
         entry_points={"console_scripts": ["ray=ray.scripts.scripts:main"]},
         include_package_data=True,
  
verification_info: {"golden_diff": "diff --git a/python/setup.py b/python/setup.py\n--- a/python/setup.py\n+++ b/python/setup.py\n@@ -81,12 +81,15 @@\n       # The BinaryDistribution argument triggers build_ext.\n       distclass=BinaryDistribution,\n       install_requires=[\"numpy\",\n+                        \"cython\",\n                         \"funcsigs\",\n                         \"click\",\n                         \"colorama\",\n                         \"psutil\",\n                         \"redis\",\n                         \"cloudpickle >= 0.2.2\",\n+                        # The six module is required by pyarrow.\n+                        \"six >= 1.0.0\",\n                         \"flatbuffers\"],\n       entry_points={\"console_scripts\": [\"ray=ray.scripts.scripts:main\"]},\n       include_package_data=True,\n", "issue": "Not possible to install Ray from git\nI want to install Ray for Python 3.\r\n\r\n```\r\n$ apt-get install -y cmake pkg-config python3-dev build-essential autoconf curl libtool libboost-all-dev unzip\r\n$ pip3 install git+https://github.com/ray-project/ray.git@37282330c0ea687fd1b983176dce85731fcf189d#subdirectory=python\r\n```\r\n\r\nBut this tries to install it for python2.7, and not python3, failing with:\r\n\r\n```\r\n    CMake Error at cmake_modules/FindNumPy.cmake:62 (message):\r\n      NumPy import failure:\r\n    \r\n      Traceback (most recent call last):\r\n    \r\n        File \"<string>\", line 1, in <module>\r\n    \r\n      ImportError: No module named numpy\r\n```\r\n\r\nBecause numpy is installed only for Python 3.\n", "before_files": [{"content": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport shutil\nimport subprocess\nimport sys\n\nfrom setuptools import setup, find_packages, Distribution\nimport setuptools.command.build_ext as _build_ext\n\n# Ideally, we could include these files by putting them in a\n# MANIFEST.in or using the package_data argument to setup, but the\n# MANIFEST.in gets applied at the very beginning when setup.py runs\n# before these files have been created, so we have to move the files\n# manually.\nray_files = [\n    \"ray/core/src/common/thirdparty/redis/src/redis-server\",\n    \"ray/core/src/common/redis_module/libray_redis_module.so\",\n    \"ray/core/src/plasma/plasma_store\",\n    \"ray/core/src/plasma/plasma_manager\",\n    \"ray/core/src/local_scheduler/local_scheduler\",\n    \"ray/core/src/local_scheduler/liblocal_scheduler_library.so\",\n    \"ray/core/src/numbuf/libnumbuf.so\",\n    \"ray/core/src/global_scheduler/global_scheduler\",\n    \"ray/WebUI.ipynb\"\n]\n\n\nclass build_ext(_build_ext.build_ext):\n    def run(self):\n        # Note: We are passing in sys.executable so that we use the same\n        # version of Python to build pyarrow inside the build.sh script. Note\n        # that certain flags will not be passed along such as --user or sudo.\n        # TODO(rkn): Fix this.\n        subprocess.check_call([\"../build.sh\", sys.executable])\n\n        # We also need to install pyarrow along with Ray, so make sure that the\n        # relevant non-Python pyarrow files get copied.\n        pyarrow_files = [\n            os.path.join(\"ray/pyarrow_files/pyarrow\", filename)\n            for filename in os.listdir(\"./ray/pyarrow_files/pyarrow\")\n            if not os.path.isdir(os.path.join(\"ray/pyarrow_files/pyarrow\",\n                                              filename))]\n\n        files_to_include = ray_files + pyarrow_files\n\n        for filename in files_to_include:\n            self.move_file(filename)\n        # Copy over the autogenerated flatbuffer Python bindings.\n        generated_python_directory = \"ray/core/generated\"\n        for filename in os.listdir(generated_python_directory):\n            if filename[-3:] == \".py\":\n                self.move_file(os.path.join(generated_python_directory,\n                                            filename))\n\n    def move_file(self, filename):\n        # TODO(rkn): This feels very brittle. It may not handle all cases. See\n        # https://github.com/apache/arrow/blob/master/python/setup.py for an\n        # example.\n        source = filename\n        destination = os.path.join(self.build_lib, filename)\n        # Create the target directory if it doesn't already exist.\n        parent_directory = os.path.dirname(destination)\n        if not os.path.exists(parent_directory):\n            os.makedirs(parent_directory)\n        print(\"Copying {} to {}.\".format(source, destination))\n        shutil.copy(source, destination)\n\n\nclass BinaryDistribution(Distribution):\n    def has_ext_modules(self):\n        return True\n\n\nsetup(name=\"ray\",\n      version=\"0.1.2\",\n      packages=find_packages(),\n      cmdclass={\"build_ext\": build_ext},\n      # The BinaryDistribution argument triggers build_ext.\n      distclass=BinaryDistribution,\n      install_requires=[\"numpy\",\n                        \"funcsigs\",\n                        \"click\",\n                        \"colorama\",\n                        \"psutil\",\n                        \"redis\",\n                        \"cloudpickle >= 0.2.2\",\n                        \"flatbuffers\"],\n      entry_points={\"console_scripts\": [\"ray=ray.scripts.scripts:main\"]},\n      include_package_data=True,\n      zip_safe=False,\n      license=\"Apache 2.0\")\n", "path": "python/setup.py"}]}