prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  pip install torchtext==0.7.0 installs incompatible PyTorch 1.7.0
  ## 🐛 Bug
  **Describe the bug**
  Recently, after I do `pip install torchtext==0.7.0`, import torchtext would cause segmentation fault. I found that degrading pytorch to 1.6.0 fixes this issue. 
  
  **To Reproduce**
  Steps to reproduce the behavior:
  1. `pip install torchtext==0.7.0` (assuming that pytorch is not installed yet, and this command will install the latest pytorch)
  2. python -c "import torchtext"
  
  **Expected behavior**
  Segmentation Fault
  
  **Environment**
  
   - PyTorch Version (e.g., 1.0): 1.7.0
   - OS (e.g., Linux): Linux/MacOS
   - Python: 3.8.3
  
  </issue>
  <code>
  [start of setup.py]
  1 #!/usr/bin/env python
  2 import io
  3 import os
  4 import shutil
  5 import subprocess
  6 from pathlib import Path
  7 import distutils.command.clean
  8 from setuptools import setup, find_packages
  9 
  10 from build_tools import setup_helpers
  11 
  12 ROOT_DIR = Path(__file__).parent.resolve()
  13 
  14 
  15 def read(*names, **kwargs):
  16     with io.open(ROOT_DIR.joinpath(*names), encoding=kwargs.get("encoding", "utf8")) as fp:
  17         return fp.read()
  18 
  19 
  20 def _get_version():
  21     version = '0.9.0a0'
  22     sha = None
  23 
  24     try:
  25         cmd = ['git', 'rev-parse', 'HEAD']
  26         sha = subprocess.check_output(cmd, cwd=str(ROOT_DIR)).decode('ascii').strip()
  27     except Exception:
  28         pass
  29 
  30     if os.getenv('BUILD_VERSION'):
  31         version = os.getenv('BUILD_VERSION')
  32     elif sha is not None:
  33         version += '+' + sha[:7]
  34 
  35     if sha is None:
  36         sha = 'Unknown'
  37     return version, sha
  38 
  39 
  40 def _export_version(version, sha):
  41     version_path = ROOT_DIR / 'torchtext' / 'version.py'
  42     with open(version_path, 'w') as fileobj:
  43         fileobj.write("__version__ = '{}'\n".format(version))
  44         fileobj.write("git_version = {}\n".format(repr(sha)))
  45 
  46 
  47 VERSION, SHA = _get_version()
  48 _export_version(VERSION, SHA)
  49 
  50 print('-- Building version ' + VERSION)
  51 
  52 
  53 class clean(distutils.command.clean.clean):
  54     def run(self):
  55         # Run default behavior first
  56         distutils.command.clean.clean.run(self)
  57 
  58         # Remove torchtext extension
  59         for path in (ROOT_DIR / 'torchtext').glob('**/*.so'):
  60             print(f'removing \'{path}\'')
  61             path.unlink()
  62         # Remove build directory
  63         build_dirs = [
  64             ROOT_DIR / 'build',
  65             ROOT_DIR / 'third_party' / 'build',
  66         ]
  67         for path in build_dirs:
  68             if path.exists():
  69                 print(f'removing \'{path}\' (and everything under it)')
  70                 shutil.rmtree(str(path), ignore_errors=True)
  71 
  72 
  73 setup_info = dict(
  74     # Metadata
  75     name='torchtext',
  76     version=VERSION,
  77     author='PyTorch core devs and James Bradbury',
  78     author_email='jekbradbury@gmail.com',
  79     url='https://github.com/pytorch/text',
  80     description='Text utilities and datasets for PyTorch',
  81     long_description=read('README.rst'),
  82     license='BSD',
  83 
  84     install_requires=[
  85         'tqdm', 'requests', 'torch', 'numpy'
  86     ],
  87     python_requires='>=3.5',
  88     classifiers=[
  89         'Programming Language :: Python :: 3',
  90         'Programming Language :: Python :: 3.5',
  91         'Programming Language :: Python :: 3.6',
  92         'Programming Language :: Python :: 3.7',
  93         'Programming Language :: Python :: 3.8',
  94         'Programming Language :: Python :: 3 :: Only',
  95     ],
  96     # Package info
  97     packages=find_packages(exclude=('test*', 'build_tools*')),
  98     zip_safe=False,
  99     # Extension info
  100     # If you are trying to use torchtext.so and see no registered op.
  101     # See here: https://github.com/pytorch/vision/issues/2134"
  102     ext_modules=setup_helpers.get_ext_modules(),
  103     cmdclass={
  104         'build_ext': setup_helpers.BuildExtension.with_options(no_python_abi_suffix=True),
  105         'clean': clean,
  106     },
  107 )
  108 
  109 setup(**setup_info)
  110
  [end of 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/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -49,6 +49,12 @@
   
   print('-- Building version ' + VERSION)
   
  +pytorch_package_version = os.getenv('PYTORCH_VERSION')
  +
  +pytorch_package_dep = 'torch'
  +if pytorch_package_version is not None:
  +    pytorch_package_dep += "==" + pytorch_package_version
  +
   
   class clean(distutils.command.clean.clean):
       def run(self):
  @@ -82,7 +88,7 @@
       license='BSD',
   
       install_requires=[
  -        'tqdm', 'requests', 'torch', 'numpy'
  +        'tqdm', 'requests', pytorch_package_dep, 'numpy'
       ],
       python_requires='>=3.5',
       classifiers=[
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -49,6 +49,12 @@\n \n print('-- Building version ' + VERSION)\n \n+pytorch_package_version = os.getenv('PYTORCH_VERSION')\n+\n+pytorch_package_dep = 'torch'\n+if pytorch_package_version is not None:\n+    pytorch_package_dep += \"==\" + pytorch_package_version\n+\n \n class clean(distutils.command.clean.clean):\n     def run(self):\n@@ -82,7 +88,7 @@\n     license='BSD',\n \n     install_requires=[\n-        'tqdm', 'requests', 'torch', 'numpy'\n+        'tqdm', 'requests', pytorch_package_dep, 'numpy'\n     ],\n     python_requires='>=3.5',\n     classifiers=[\n", "issue": "pip install torchtext==0.7.0 installs incompatible PyTorch 1.7.0\n## \ud83d\udc1b Bug\r\n**Describe the bug**\r\nRecently, after I do `pip install torchtext==0.7.0`, import torchtext would cause segmentation fault. I found that degrading pytorch to 1.6.0 fixes this issue. \r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1. `pip install torchtext==0.7.0` (assuming that pytorch is not installed yet, and this command will install the latest pytorch)\r\n2. python -c \"import torchtext\"\r\n\r\n**Expected behavior**\r\nSegmentation Fault\r\n\r\n**Environment**\r\n\r\n - PyTorch Version (e.g., 1.0): 1.7.0\r\n - OS (e.g., Linux): Linux/MacOS\r\n - Python: 3.8.3\n", "before_files": [{"content": "#!/usr/bin/env python\nimport io\nimport os\nimport shutil\nimport subprocess\nfrom pathlib import Path\nimport distutils.command.clean\nfrom setuptools import setup, find_packages\n\nfrom build_tools import setup_helpers\n\nROOT_DIR = Path(__file__).parent.resolve()\n\n\ndef read(*names, **kwargs):\n    with io.open(ROOT_DIR.joinpath(*names), encoding=kwargs.get(\"encoding\", \"utf8\")) as fp:\n        return fp.read()\n\n\ndef _get_version():\n    version = '0.9.0a0'\n    sha = None\n\n    try:\n        cmd = ['git', 'rev-parse', 'HEAD']\n        sha = subprocess.check_output(cmd, cwd=str(ROOT_DIR)).decode('ascii').strip()\n    except Exception:\n        pass\n\n    if os.getenv('BUILD_VERSION'):\n        version = os.getenv('BUILD_VERSION')\n    elif sha is not None:\n        version += '+' + sha[:7]\n\n    if sha is None:\n        sha = 'Unknown'\n    return version, sha\n\n\ndef _export_version(version, sha):\n    version_path = ROOT_DIR / 'torchtext' / 'version.py'\n    with open(version_path, 'w') as fileobj:\n        fileobj.write(\"__version__ = '{}'\\n\".format(version))\n        fileobj.write(\"git_version = {}\\n\".format(repr(sha)))\n\n\nVERSION, SHA = _get_version()\n_export_version(VERSION, SHA)\n\nprint('-- Building version ' + VERSION)\n\n\nclass clean(distutils.command.clean.clean):\n    def run(self):\n        # Run default behavior first\n        distutils.command.clean.clean.run(self)\n\n        # Remove torchtext extension\n        for path in (ROOT_DIR / 'torchtext').glob('**/*.so'):\n            print(f'removing \\'{path}\\'')\n            path.unlink()\n        # Remove build directory\n        build_dirs = [\n            ROOT_DIR / 'build',\n            ROOT_DIR / 'third_party' / 'build',\n        ]\n        for path in build_dirs:\n            if path.exists():\n                print(f'removing \\'{path}\\' (and everything under it)')\n                shutil.rmtree(str(path), ignore_errors=True)\n\n\nsetup_info = dict(\n    # Metadata\n    name='torchtext',\n    version=VERSION,\n    author='PyTorch core devs and James Bradbury',\n    author_email='jekbradbury@gmail.com',\n    url='https://github.com/pytorch/text',\n    description='Text utilities and datasets for PyTorch',\n    long_description=read('README.rst'),\n    license='BSD',\n\n    install_requires=[\n        'tqdm', 'requests', 'torch', 'numpy'\n    ],\n    python_requires='>=3.5',\n    classifiers=[\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: 3 :: Only',\n    ],\n    # Package info\n    packages=find_packages(exclude=('test*', 'build_tools*')),\n    zip_safe=False,\n    # Extension info\n    # If you are trying to use torchtext.so and see no registered op.\n    # See here: https://github.com/pytorch/vision/issues/2134\"\n    ext_modules=setup_helpers.get_ext_modules(),\n    cmdclass={\n        'build_ext': setup_helpers.BuildExtension.with_options(no_python_abi_suffix=True),\n        'clean': clean,\n    },\n)\n\nsetup(**setup_info)\n", "path": "setup.py"}]}