prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Documentation: "older version" warning present on latest
  Every page under https://starlite-api.github.io/starlite/latest/ has the "You are viewing the documentation for an older version of Starlite. Click here to get to the latest version" warning, which links back to the welcome page. 
  
  The message is not present in https://starlite-api.github.io/starlite/1.50/, https://starlite-api.github.io/starlite/1.49/, or https://starlite-api.github.io/starlite/1.47/.
  Documentation: "older version" warning present on latest
  Every page under https://starlite-api.github.io/starlite/latest/ has the "You are viewing the documentation for an older version of Starlite. Click here to get to the latest version" warning, which links back to the welcome page. 
  
  The message is not present in https://starlite-api.github.io/starlite/1.50/, https://starlite-api.github.io/starlite/1.49/, or https://starlite-api.github.io/starlite/1.47/.
  
  </issue>
  <code>
  [start of tools/publish_docs.py]
  1 import importlib.metadata
  2 import json
  3 import shutil
  4 import subprocess
  5 from pathlib import Path
  6 import argparse
  7 import shutil
  8 
  9 parser = argparse.ArgumentParser()
  10 parser.add_argument("--version", required=False)
  11 parser.add_argument("--push", action="store_true")
  12 parser.add_argument("--latest", action="store_true")
  13 
  14 
  15 def update_versions_file(version: str) -> None:
  16     versions_file = Path("versions.json")
  17     versions = []
  18     if versions_file.exists():
  19         versions = json.loads(versions_file.read_text())
  20 
  21     new_version_spec = {"version": version, "title": version, "aliases": []}
  22     if any(v["version"] == version for v in versions):
  23         versions = [v if v["version"] != version else new_version_spec for v in versions]
  24     else:
  25         versions.insert(0, new_version_spec)
  26 
  27     versions_file.write_text(json.dumps(versions))
  28 
  29 
  30 def make_version(version: str, push: bool, latest: bool) -> None:
  31     subprocess.run(["make", "docs"], check=True)
  32 
  33     subprocess.run(["git", "checkout", "gh-pages"], check=True)
  34 
  35     update_versions_file(version)
  36 
  37     docs_src_path = Path("docs/_build/html")
  38     docs_dest_path = Path(version)
  39     docs_dest_path_latest = Path("latest")
  40     if docs_dest_path.exists():
  41         shutil.rmtree(docs_dest_path)
  42 
  43     docs_src_path.rename(docs_dest_path)
  44     if latest:
  45         if docs_dest_path_latest.exists():
  46             shutil.rmtree(docs_dest_path_latest)
  47         shutil.copytree(docs_dest_path, docs_dest_path_latest)
  48         subprocess.run(["git", "add", "latest"], check=True)
  49 
  50     subprocess.run(["git", "add", version], check=True)
  51     subprocess.run(["git", "add", "versions.json"], check=True)
  52     subprocess.run(["git", "commit", "-m", f"automated docs build: {version}"], check=True)
  53     if push:
  54         subprocess.run(["git", "push"], check=True)
  55     subprocess.run(["git", "checkout", "-"], check=True)
  56 
  57 
  58 def main() -> None:
  59     args = parser.parse_args()
  60     version = args.version or importlib.metadata.version("starlite").rsplit(".", 1)[0]
  61     make_version(version=version, push=args.push, latest=args.latest)
  62 
  63 
  64 if __name__ == "__main__":
  65     main()
  66
  [end of tools/publish_docs.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/tools/publish_docs.py b/tools/publish_docs.py
  --- a/tools/publish_docs.py
  +++ b/tools/publish_docs.py
  @@ -12,7 +12,7 @@
   parser.add_argument("--latest", action="store_true")
   
   
  -def update_versions_file(version: str) -> None:
  +def add_to_versions_file(version: str, latest: bool) -> None:
       versions_file = Path("versions.json")
       versions = []
       if versions_file.exists():
  @@ -24,6 +24,11 @@
       else:
           versions.insert(0, new_version_spec)
   
  +    if latest:
  +        for version in versions:
  +            version["aliases"] = []
  +        versions[0]["aliases"] = ["latest"]
  +
       versions_file.write_text(json.dumps(versions))
   
   
  @@ -32,7 +37,7 @@
   
       subprocess.run(["git", "checkout", "gh-pages"], check=True)
   
  -    update_versions_file(version)
  +    add_to_versions_file(version, latest)
   
       docs_src_path = Path("docs/_build/html")
       docs_dest_path = Path(version)
  
verification_info: {"golden_diff": "diff --git a/tools/publish_docs.py b/tools/publish_docs.py\n--- a/tools/publish_docs.py\n+++ b/tools/publish_docs.py\n@@ -12,7 +12,7 @@\n parser.add_argument(\"--latest\", action=\"store_true\")\n \n \n-def update_versions_file(version: str) -> None:\n+def add_to_versions_file(version: str, latest: bool) -> None:\n     versions_file = Path(\"versions.json\")\n     versions = []\n     if versions_file.exists():\n@@ -24,6 +24,11 @@\n     else:\n         versions.insert(0, new_version_spec)\n \n+    if latest:\n+        for version in versions:\n+            version[\"aliases\"] = []\n+        versions[0][\"aliases\"] = [\"latest\"]\n+\n     versions_file.write_text(json.dumps(versions))\n \n \n@@ -32,7 +37,7 @@\n \n     subprocess.run([\"git\", \"checkout\", \"gh-pages\"], check=True)\n \n-    update_versions_file(version)\n+    add_to_versions_file(version, latest)\n \n     docs_src_path = Path(\"docs/_build/html\")\n     docs_dest_path = Path(version)\n", "issue": "Documentation: \"older version\" warning present on latest\nEvery page under https://starlite-api.github.io/starlite/latest/ has the \"You are viewing the documentation for an older version of Starlite. Click here to get to the latest version\" warning, which links back to the welcome page. \r\n\r\nThe message is not present in https://starlite-api.github.io/starlite/1.50/, https://starlite-api.github.io/starlite/1.49/, or https://starlite-api.github.io/starlite/1.47/.\nDocumentation: \"older version\" warning present on latest\nEvery page under https://starlite-api.github.io/starlite/latest/ has the \"You are viewing the documentation for an older version of Starlite. Click here to get to the latest version\" warning, which links back to the welcome page. \r\n\r\nThe message is not present in https://starlite-api.github.io/starlite/1.50/, https://starlite-api.github.io/starlite/1.49/, or https://starlite-api.github.io/starlite/1.47/.\n", "before_files": [{"content": "import importlib.metadata\nimport json\nimport shutil\nimport subprocess\nfrom pathlib import Path\nimport argparse\nimport shutil\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--version\", required=False)\nparser.add_argument(\"--push\", action=\"store_true\")\nparser.add_argument(\"--latest\", action=\"store_true\")\n\n\ndef update_versions_file(version: str) -> None:\n    versions_file = Path(\"versions.json\")\n    versions = []\n    if versions_file.exists():\n        versions = json.loads(versions_file.read_text())\n\n    new_version_spec = {\"version\": version, \"title\": version, \"aliases\": []}\n    if any(v[\"version\"] == version for v in versions):\n        versions = [v if v[\"version\"] != version else new_version_spec for v in versions]\n    else:\n        versions.insert(0, new_version_spec)\n\n    versions_file.write_text(json.dumps(versions))\n\n\ndef make_version(version: str, push: bool, latest: bool) -> None:\n    subprocess.run([\"make\", \"docs\"], check=True)\n\n    subprocess.run([\"git\", \"checkout\", \"gh-pages\"], check=True)\n\n    update_versions_file(version)\n\n    docs_src_path = Path(\"docs/_build/html\")\n    docs_dest_path = Path(version)\n    docs_dest_path_latest = Path(\"latest\")\n    if docs_dest_path.exists():\n        shutil.rmtree(docs_dest_path)\n\n    docs_src_path.rename(docs_dest_path)\n    if latest:\n        if docs_dest_path_latest.exists():\n            shutil.rmtree(docs_dest_path_latest)\n        shutil.copytree(docs_dest_path, docs_dest_path_latest)\n        subprocess.run([\"git\", \"add\", \"latest\"], check=True)\n\n    subprocess.run([\"git\", \"add\", version], check=True)\n    subprocess.run([\"git\", \"add\", \"versions.json\"], check=True)\n    subprocess.run([\"git\", \"commit\", \"-m\", f\"automated docs build: {version}\"], check=True)\n    if push:\n        subprocess.run([\"git\", \"push\"], check=True)\n    subprocess.run([\"git\", \"checkout\", \"-\"], check=True)\n\n\ndef main() -> None:\n    args = parser.parse_args()\n    version = args.version or importlib.metadata.version(\"starlite\").rsplit(\".\", 1)[0]\n    make_version(version=version, push=args.push, latest=args.latest)\n\n\nif __name__ == \"__main__\":\n    main()\n", "path": "tools/publish_docs.py"}]}