prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Test the upcoming pip dependency resolver in CI
  From pypi-announce@python.org, about pip 20.2:
  
  > NOTICE: This release includes the beta of the next-generation dependency resolver. It is significantly stricter and more consistent when it receives incompatible instructions, and reduces support for certain kinds of constraints files, so some workarounds and workflows may break. Please test it with the `--use-feature=2020-resolver` flag. Please see our guide on how to test and migrate, and how to report issues
  <https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-2-2020>.
  > 
  > The new dependency resolver is *off by default* because it is *not yet
  ready for everyday use*.
  
  </issue>
  <code>
  [start of setup.py]
  1 from os.path import dirname, join
  2 from pkg_resources import parse_version
  3 from setuptools import setup, find_packages, __version__ as setuptools_version
  4 
  5 
  6 with open(join(dirname(__file__), 'scrapy/VERSION'), 'rb') as f:
  7     version = f.read().decode('ascii').strip()
  8 
  9 
  10 def has_environment_marker_platform_impl_support():
  11     """Code extracted from 'pytest/setup.py'
  12     https://github.com/pytest-dev/pytest/blob/7538680c/setup.py#L31
  13 
  14     The first known release to support environment marker with range operators
  15     it is 18.5, see:
  16     https://setuptools.readthedocs.io/en/latest/history.html#id235
  17     """
  18     return parse_version(setuptools_version) >= parse_version('18.5')
  19 
  20 
  21 install_requires = [
  22     'Twisted>=17.9.0',
  23     'cryptography>=2.0',
  24     'cssselect>=0.9.1',
  25     'itemloaders>=1.0.1',
  26     'parsel>=1.5.0',
  27     'PyDispatcher>=2.0.5',
  28     'pyOpenSSL>=16.2.0',
  29     'queuelib>=1.4.2',
  30     'service_identity>=16.0.0',
  31     'w3lib>=1.17.0',
  32     'zope.interface>=4.1.3',
  33     'protego>=0.1.15',
  34     'itemadapter>=0.1.0',
  35 ]
  36 extras_require = {}
  37 
  38 if has_environment_marker_platform_impl_support():
  39     extras_require[':platform_python_implementation == "CPython"'] = [
  40         'lxml>=3.5.0',
  41     ]
  42     extras_require[':platform_python_implementation == "PyPy"'] = [
  43         # Earlier lxml versions are affected by
  44         # https://foss.heptapod.net/pypy/pypy/-/issues/2498,
  45         # which was fixed in Cython 0.26, released on 2017-06-19, and used to
  46         # generate the C headers of lxml release tarballs published since then, the
  47         # first of which was:
  48         'lxml>=4.0.0',
  49         'PyPyDispatcher>=2.1.0',
  50     ]
  51 else:
  52     install_requires.append('lxml>=3.5.0')
  53 
  54 
  55 setup(
  56     name='Scrapy',
  57     version=version,
  58     url='https://scrapy.org',
  59     project_urls={
  60         'Documentation': 'https://docs.scrapy.org/',
  61         'Source': 'https://github.com/scrapy/scrapy',
  62         'Tracker': 'https://github.com/scrapy/scrapy/issues',
  63     },
  64     description='A high-level Web Crawling and Web Scraping framework',
  65     long_description=open('README.rst').read(),
  66     author='Scrapy developers',
  67     maintainer='Pablo Hoffman',
  68     maintainer_email='pablo@pablohoffman.com',
  69     license='BSD',
  70     packages=find_packages(exclude=('tests', 'tests.*')),
  71     include_package_data=True,
  72     zip_safe=False,
  73     entry_points={
  74         'console_scripts': ['scrapy = scrapy.cmdline:execute']
  75     },
  76     classifiers=[
  77         'Framework :: Scrapy',
  78         'Development Status :: 5 - Production/Stable',
  79         'Environment :: Console',
  80         'Intended Audience :: Developers',
  81         'License :: OSI Approved :: BSD License',
  82         'Operating System :: OS Independent',
  83         'Programming Language :: Python',
  84         'Programming Language :: Python :: 3',
  85         'Programming Language :: Python :: 3.6',
  86         'Programming Language :: Python :: 3.7',
  87         'Programming Language :: Python :: 3.8',
  88         'Programming Language :: Python :: Implementation :: CPython',
  89         'Programming Language :: Python :: Implementation :: PyPy',
  90         'Topic :: Internet :: WWW/HTTP',
  91         'Topic :: Software Development :: Libraries :: Application Frameworks',
  92         'Topic :: Software Development :: Libraries :: Python Modules',
  93     ],
  94     python_requires='>=3.6',
  95     install_requires=install_requires,
  96     extras_require=extras_require,
  97 )
  98
  [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
  @@ -24,7 +24,6 @@
       'cssselect>=0.9.1',
       'itemloaders>=1.0.1',
       'parsel>=1.5.0',
  -    'PyDispatcher>=2.0.5',
       'pyOpenSSL>=16.2.0',
       'queuelib>=1.4.2',
       'service_identity>=16.0.0',
  @@ -34,11 +33,12 @@
       'itemadapter>=0.1.0',
   ]
   extras_require = {}
  -
  +cpython_dependencies = [
  +    'lxml>=3.5.0',
  +    'PyDispatcher>=2.0.5',
  +]
   if has_environment_marker_platform_impl_support():
  -    extras_require[':platform_python_implementation == "CPython"'] = [
  -        'lxml>=3.5.0',
  -    ]
  +    extras_require[':platform_python_implementation == "CPython"'] = cpython_dependencies
       extras_require[':platform_python_implementation == "PyPy"'] = [
           # Earlier lxml versions are affected by
           # https://foss.heptapod.net/pypy/pypy/-/issues/2498,
  @@ -49,7 +49,7 @@
           'PyPyDispatcher>=2.1.0',
       ]
   else:
  -    install_requires.append('lxml>=3.5.0')
  +    install_requires.extend(cpython_dependencies)
   
   
   setup(
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -24,7 +24,6 @@\n     'cssselect>=0.9.1',\n     'itemloaders>=1.0.1',\n     'parsel>=1.5.0',\n-    'PyDispatcher>=2.0.5',\n     'pyOpenSSL>=16.2.0',\n     'queuelib>=1.4.2',\n     'service_identity>=16.0.0',\n@@ -34,11 +33,12 @@\n     'itemadapter>=0.1.0',\n ]\n extras_require = {}\n-\n+cpython_dependencies = [\n+    'lxml>=3.5.0',\n+    'PyDispatcher>=2.0.5',\n+]\n if has_environment_marker_platform_impl_support():\n-    extras_require[':platform_python_implementation == \"CPython\"'] = [\n-        'lxml>=3.5.0',\n-    ]\n+    extras_require[':platform_python_implementation == \"CPython\"'] = cpython_dependencies\n     extras_require[':platform_python_implementation == \"PyPy\"'] = [\n         # Earlier lxml versions are affected by\n         # https://foss.heptapod.net/pypy/pypy/-/issues/2498,\n@@ -49,7 +49,7 @@\n         'PyPyDispatcher>=2.1.0',\n     ]\n else:\n-    install_requires.append('lxml>=3.5.0')\n+    install_requires.extend(cpython_dependencies)\n \n \n setup(\n", "issue": "Test the upcoming pip dependency resolver in CI\nFrom pypi-announce@python.org, about pip 20.2:\r\n\r\n> NOTICE: This release includes the beta of the next-generation dependency resolver. It is significantly stricter and more consistent when it receives incompatible instructions, and reduces support for certain kinds of constraints files, so some workarounds and workflows may break. Please test it with the `--use-feature=2020-resolver` flag. Please see our guide on how to test and migrate, and how to report issues\r\n<https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-2-2020>.\r\n> \r\n> The new dependency resolver is *off by default* because it is *not yet\r\nready for everyday use*.\n", "before_files": [{"content": "from os.path import dirname, join\nfrom pkg_resources import parse_version\nfrom setuptools import setup, find_packages, __version__ as setuptools_version\n\n\nwith open(join(dirname(__file__), 'scrapy/VERSION'), 'rb') as f:\n    version = f.read().decode('ascii').strip()\n\n\ndef has_environment_marker_platform_impl_support():\n    \"\"\"Code extracted from 'pytest/setup.py'\n    https://github.com/pytest-dev/pytest/blob/7538680c/setup.py#L31\n\n    The first known release to support environment marker with range operators\n    it is 18.5, see:\n    https://setuptools.readthedocs.io/en/latest/history.html#id235\n    \"\"\"\n    return parse_version(setuptools_version) >= parse_version('18.5')\n\n\ninstall_requires = [\n    'Twisted>=17.9.0',\n    'cryptography>=2.0',\n    'cssselect>=0.9.1',\n    'itemloaders>=1.0.1',\n    'parsel>=1.5.0',\n    'PyDispatcher>=2.0.5',\n    'pyOpenSSL>=16.2.0',\n    'queuelib>=1.4.2',\n    'service_identity>=16.0.0',\n    'w3lib>=1.17.0',\n    'zope.interface>=4.1.3',\n    'protego>=0.1.15',\n    'itemadapter>=0.1.0',\n]\nextras_require = {}\n\nif has_environment_marker_platform_impl_support():\n    extras_require[':platform_python_implementation == \"CPython\"'] = [\n        'lxml>=3.5.0',\n    ]\n    extras_require[':platform_python_implementation == \"PyPy\"'] = [\n        # Earlier lxml versions are affected by\n        # https://foss.heptapod.net/pypy/pypy/-/issues/2498,\n        # which was fixed in Cython 0.26, released on 2017-06-19, and used to\n        # generate the C headers of lxml release tarballs published since then, the\n        # first of which was:\n        'lxml>=4.0.0',\n        'PyPyDispatcher>=2.1.0',\n    ]\nelse:\n    install_requires.append('lxml>=3.5.0')\n\n\nsetup(\n    name='Scrapy',\n    version=version,\n    url='https://scrapy.org',\n    project_urls={\n        'Documentation': 'https://docs.scrapy.org/',\n        'Source': 'https://github.com/scrapy/scrapy',\n        'Tracker': 'https://github.com/scrapy/scrapy/issues',\n    },\n    description='A high-level Web Crawling and Web Scraping framework',\n    long_description=open('README.rst').read(),\n    author='Scrapy developers',\n    maintainer='Pablo Hoffman',\n    maintainer_email='pablo@pablohoffman.com',\n    license='BSD',\n    packages=find_packages(exclude=('tests', 'tests.*')),\n    include_package_data=True,\n    zip_safe=False,\n    entry_points={\n        'console_scripts': ['scrapy = scrapy.cmdline:execute']\n    },\n    classifiers=[\n        'Framework :: Scrapy',\n        'Development Status :: 5 - Production/Stable',\n        'Environment :: Console',\n        'Intended Audience :: Developers',\n        'License :: OSI Approved :: BSD License',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: Implementation :: CPython',\n        'Programming Language :: Python :: Implementation :: PyPy',\n        'Topic :: Internet :: WWW/HTTP',\n        'Topic :: Software Development :: Libraries :: Application Frameworks',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n    ],\n    python_requires='>=3.6',\n    install_requires=install_requires,\n    extras_require=extras_require,\n)\n", "path": "setup.py"}]}