prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  New versions of sphinx and jinja2 break docs linting
  This is observed by @tcbegley in #1034
  
  </issue>
  <code>
  [start of setup.py]
  1 # Copyright Contributors to the Pyro project.
  2 # SPDX-License-Identifier: Apache-2.0
  3 
  4 from __future__ import absolute_import, division, print_function
  5 
  6 import os
  7 import sys
  8 
  9 from setuptools import find_packages, setup
  10 
  11 PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
  12 
  13 # Find version
  14 for line in open(os.path.join(PROJECT_PATH, "numpyro", "version.py")):
  15     if line.startswith("__version__ = "):
  16         version = line.strip().split()[2][1:-1]
  17 
  18 # READ README.md for long description on PyPi.
  19 try:
  20     long_description = open("README.md", encoding="utf-8").read()
  21 except Exception as e:
  22     sys.stderr.write("Failed to read README.md:\n  {}\n".format(e))
  23     sys.stderr.flush()
  24     long_description = ""
  25 
  26 
  27 setup(
  28     name="numpyro",
  29     version=version,
  30     description="Pyro PPL on NumPy",
  31     packages=find_packages(include=["numpyro", "numpyro.*"]),
  32     url="https://github.com/pyro-ppl/numpyro",
  33     author="Uber AI Labs",
  34     install_requires=[
  35         "jax>=0.2.11",
  36         "jaxlib>=0.1.62",
  37         "tqdm",
  38     ],
  39     extras_require={
  40         "doc": [
  41             "ipython",  # sphinx needs this to render codes
  42             "jinja2<3.0.0",
  43             "nbsphinx",
  44             "sphinx<4.0.0",
  45             "sphinx_rtd_theme",
  46             "sphinx-gallery",
  47         ],
  48         "test": [
  49             "black",
  50             "flake8",
  51             "isort>=5.0",
  52             "pytest>=4.1",
  53             "pyro-api>=0.1.1",
  54             "scipy>=1.1",
  55         ],
  56         "dev": [
  57             "dm-haiku",
  58             "flax",
  59             # TODO: bump funsor version before the release
  60             "funsor @ git+https://github.com/pyro-ppl/funsor.git@d5574988665dd822ec64e41f2b54b9dc929959dc",
  61             "graphviz",
  62             "optax==0.0.6",
  63             # TODO: change this to tensorflow_probability>0.12.1 when the next version
  64             # of tfp is released. The current release is not compatible with jax>=0.2.12.
  65             "tfp-nightly",
  66         ],
  67         "examples": ["arviz", "jupyter", "matplotlib", "pandas", "seaborn"],
  68     },
  69     long_description=long_description,
  70     long_description_content_type="text/markdown",
  71     keywords="probabilistic machine learning bayesian statistics",
  72     license="Apache License 2.0",
  73     classifiers=[
  74         "Intended Audience :: Developers",
  75         "Intended Audience :: Education",
  76         "Intended Audience :: Science/Research",
  77         "License :: OSI Approved :: Apache Software License",
  78         "Operating System :: POSIX :: Linux",
  79         "Operating System :: MacOS :: MacOS X",
  80         "Programming Language :: Python :: 3.6",
  81         "Programming Language :: Python :: 3.7",
  82         "Programming Language :: Python :: 3.8",
  83         "Programming Language :: Python :: 3.9",
  84     ],
  85 )
  86
  [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
  @@ -39,9 +39,8 @@
       extras_require={
           "doc": [
               "ipython",  # sphinx needs this to render codes
  -            "jinja2<3.0.0",
  -            "nbsphinx",
  -            "sphinx<4.0.0",
  +            "nbsphinx>=0.8.5",
  +            "sphinx",
               "sphinx_rtd_theme",
               "sphinx-gallery",
           ],
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -39,9 +39,8 @@\n     extras_require={\n         \"doc\": [\n             \"ipython\",  # sphinx needs this to render codes\n-            \"jinja2<3.0.0\",\n-            \"nbsphinx\",\n-            \"sphinx<4.0.0\",\n+            \"nbsphinx>=0.8.5\",\n+            \"sphinx\",\n             \"sphinx_rtd_theme\",\n             \"sphinx-gallery\",\n         ],\n", "issue": "New versions of sphinx and jinja2 break docs linting\nThis is observed by @tcbegley in #1034\n", "before_files": [{"content": "# Copyright Contributors to the Pyro project.\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future__ import absolute_import, division, print_function\n\nimport os\nimport sys\n\nfrom setuptools import find_packages, setup\n\nPROJECT_PATH = os.path.dirname(os.path.abspath(__file__))\n\n# Find version\nfor line in open(os.path.join(PROJECT_PATH, \"numpyro\", \"version.py\")):\n    if line.startswith(\"__version__ = \"):\n        version = line.strip().split()[2][1:-1]\n\n# READ README.md for long description on PyPi.\ntry:\n    long_description = open(\"README.md\", encoding=\"utf-8\").read()\nexcept Exception as e:\n    sys.stderr.write(\"Failed to read README.md:\\n  {}\\n\".format(e))\n    sys.stderr.flush()\n    long_description = \"\"\n\n\nsetup(\n    name=\"numpyro\",\n    version=version,\n    description=\"Pyro PPL on NumPy\",\n    packages=find_packages(include=[\"numpyro\", \"numpyro.*\"]),\n    url=\"https://github.com/pyro-ppl/numpyro\",\n    author=\"Uber AI Labs\",\n    install_requires=[\n        \"jax>=0.2.11\",\n        \"jaxlib>=0.1.62\",\n        \"tqdm\",\n    ],\n    extras_require={\n        \"doc\": [\n            \"ipython\",  # sphinx needs this to render codes\n            \"jinja2<3.0.0\",\n            \"nbsphinx\",\n            \"sphinx<4.0.0\",\n            \"sphinx_rtd_theme\",\n            \"sphinx-gallery\",\n        ],\n        \"test\": [\n            \"black\",\n            \"flake8\",\n            \"isort>=5.0\",\n            \"pytest>=4.1\",\n            \"pyro-api>=0.1.1\",\n            \"scipy>=1.1\",\n        ],\n        \"dev\": [\n            \"dm-haiku\",\n            \"flax\",\n            # TODO: bump funsor version before the release\n            \"funsor @ git+https://github.com/pyro-ppl/funsor.git@d5574988665dd822ec64e41f2b54b9dc929959dc\",\n            \"graphviz\",\n            \"optax==0.0.6\",\n            # TODO: change this to tensorflow_probability>0.12.1 when the next version\n            # of tfp is released. The current release is not compatible with jax>=0.2.12.\n            \"tfp-nightly\",\n        ],\n        \"examples\": [\"arviz\", \"jupyter\", \"matplotlib\", \"pandas\", \"seaborn\"],\n    },\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    keywords=\"probabilistic machine learning bayesian statistics\",\n    license=\"Apache License 2.0\",\n    classifiers=[\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Education\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Operating System :: POSIX :: Linux\",\n        \"Operating System :: MacOS :: MacOS X\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n    ],\n)\n", "path": "setup.py"}]}