prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  cryptography_vectors is missing from `test` extra
  There is missing `cryptography_vectors` in the `test` extra in `pyproject.toml` so when tests are run from sdist with the `test` extra installed then testing fails and `cryptography_vectors` needs to be installed manually to make tests passing.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `release.py`
  Content:
  ```
  1 # This file is dual licensed under the terms of the Apache License, Version
  2 # 2.0, and the BSD License. See the LICENSE file in the root of this repository
  3 # for complete details.
  4 
  5 import pathlib
  6 import re
  7 import subprocess
  8 
  9 import click
  10 import tomllib
  11 from packaging.version import Version
  12 
  13 
  14 def run(*args: str) -> None:
  15     print(f"[running] {list(args)}")
  16     subprocess.check_call(list(args))
  17 
  18 
  19 @click.group()
  20 def cli():
  21     pass
  22 
  23 
  24 @cli.command()
  25 def release() -> None:
  26     base_dir = pathlib.Path(__file__).parent
  27     with (base_dir / "pyproject.toml").open("rb") as f:
  28         pyproject = tomllib.load(f)
  29         version = pyproject["project"]["version"]
  30 
  31     if Version(version).is_prerelease:
  32         raise RuntimeError(
  33             f"Can't release, pyproject.toml version is pre-release: {version}"
  34         )
  35 
  36     # Tag and push the tag (this will trigger the wheel builder in Actions)
  37     run("git", "tag", "-s", version, "-m", f"{version} release")
  38     run("git", "push", "--tags", "git@github.com:pyca/cryptography.git")
  39 
  40 
  41 def replace_version(
  42     p: pathlib.Path, variable_name: str, new_version: str
  43 ) -> None:
  44     content = p.read_text()
  45 
  46     pattern = rf"^{variable_name}\s*=\s*.*$"
  47     match = re.search(pattern, content, re.MULTILINE)
  48     assert match is not None
  49 
  50     start, end = match.span()
  51     new_content = (
  52         content[:start] + f'{variable_name} = "{new_version}"' + content[end:]
  53     )
  54 
  55     p.write_text(new_content)
  56 
  57 
  58 @cli.command()
  59 @click.argument("new_version")
  60 def bump_version(new_version: str) -> None:
  61     base_dir = pathlib.Path(__file__).parent
  62 
  63     replace_version(base_dir / "pyproject.toml", "version", new_version)
  64     replace_version(
  65         base_dir / "src/cryptography/__about__.py", "__version__", new_version
  66     )
  67     replace_version(
  68         base_dir / "vectors/pyproject.toml",
  69         "version",
  70         new_version,
  71     )
  72     replace_version(
  73         base_dir / "vectors/cryptography_vectors/__about__.py",
  74         "__version__",
  75         new_version,
  76     )
  77 
  78 
  79 if __name__ == "__main__":
  80     cli()
  81
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/release.py b/release.py
  --- a/release.py
  +++ b/release.py
  @@ -38,23 +38,24 @@
       run("git", "push", "--tags", "git@github.com:pyca/cryptography.git")
   
   
  -def replace_version(
  -    p: pathlib.Path, variable_name: str, new_version: str
  -) -> None:
  +def replace_pattern(p: pathlib.Path, pattern: str, replacement: str) -> None:
       content = p.read_text()
  -
  -    pattern = rf"^{variable_name}\s*=\s*.*$"
       match = re.search(pattern, content, re.MULTILINE)
       assert match is not None
   
       start, end = match.span()
  -    new_content = (
  -        content[:start] + f'{variable_name} = "{new_version}"' + content[end:]
  -    )
  -
  +    new_content = content[:start] + replacement + content[end:]
       p.write_text(new_content)
   
   
  +def replace_version(
  +    p: pathlib.Path, variable_name: str, new_version: str
  +) -> None:
  +    replace_pattern(
  +        p, rf"^{variable_name}\s*=\s*.*$", f'{variable_name} = "{new_version}"'
  +    )
  +
  +
   @cli.command()
   @click.argument("new_version")
   def bump_version(new_version: str) -> None:
  @@ -75,6 +76,19 @@
           new_version,
       )
   
  +    if Version(new_version).is_prerelease:
  +        replace_pattern(
  +            base_dir / "pyproject.toml",
  +            r'"cryptography_vectors(==.*?)?"',
  +            '"cryptography_vectors"',
  +        )
  +    else:
  +        replace_pattern(
  +            base_dir / "pyproject.toml",
  +            r'"cryptography_vectors(==.*?)?"',
  +            f'"cryptography_vectors=={new_version}"',
  +        )
  +
   
   if __name__ == "__main__":
       cli()
  
verification_info: {"golden_diff": "diff --git a/release.py b/release.py\n--- a/release.py\n+++ b/release.py\n@@ -38,23 +38,24 @@\n     run(\"git\", \"push\", \"--tags\", \"git@github.com:pyca/cryptography.git\")\n \n \n-def replace_version(\n-    p: pathlib.Path, variable_name: str, new_version: str\n-) -> None:\n+def replace_pattern(p: pathlib.Path, pattern: str, replacement: str) -> None:\n     content = p.read_text()\n-\n-    pattern = rf\"^{variable_name}\\s*=\\s*.*$\"\n     match = re.search(pattern, content, re.MULTILINE)\n     assert match is not None\n \n     start, end = match.span()\n-    new_content = (\n-        content[:start] + f'{variable_name} = \"{new_version}\"' + content[end:]\n-    )\n-\n+    new_content = content[:start] + replacement + content[end:]\n     p.write_text(new_content)\n \n \n+def replace_version(\n+    p: pathlib.Path, variable_name: str, new_version: str\n+) -> None:\n+    replace_pattern(\n+        p, rf\"^{variable_name}\\s*=\\s*.*$\", f'{variable_name} = \"{new_version}\"'\n+    )\n+\n+\n @cli.command()\n @click.argument(\"new_version\")\n def bump_version(new_version: str) -> None:\n@@ -75,6 +76,19 @@\n         new_version,\n     )\n \n+    if Version(new_version).is_prerelease:\n+        replace_pattern(\n+            base_dir / \"pyproject.toml\",\n+            r'\"cryptography_vectors(==.*?)?\"',\n+            '\"cryptography_vectors\"',\n+        )\n+    else:\n+        replace_pattern(\n+            base_dir / \"pyproject.toml\",\n+            r'\"cryptography_vectors(==.*?)?\"',\n+            f'\"cryptography_vectors=={new_version}\"',\n+        )\n+\n \n if __name__ == \"__main__\":\n     cli()\n", "issue": "cryptography_vectors is missing from `test` extra\nThere is missing `cryptography_vectors` in the `test` extra in `pyproject.toml` so when tests are run from sdist with the `test` extra installed then testing fails and `cryptography_vectors` needs to be installed manually to make tests passing.\n", "before_files": [{"content": "# This file is dual licensed under the terms of the Apache License, Version\n# 2.0, and the BSD License. See the LICENSE file in the root of this repository\n# for complete details.\n\nimport pathlib\nimport re\nimport subprocess\n\nimport click\nimport tomllib\nfrom packaging.version import Version\n\n\ndef run(*args: str) -> None:\n    print(f\"[running] {list(args)}\")\n    subprocess.check_call(list(args))\n\n\n@click.group()\ndef cli():\n    pass\n\n\n@cli.command()\ndef release() -> None:\n    base_dir = pathlib.Path(__file__).parent\n    with (base_dir / \"pyproject.toml\").open(\"rb\") as f:\n        pyproject = tomllib.load(f)\n        version = pyproject[\"project\"][\"version\"]\n\n    if Version(version).is_prerelease:\n        raise RuntimeError(\n            f\"Can't release, pyproject.toml version is pre-release: {version}\"\n        )\n\n    # Tag and push the tag (this will trigger the wheel builder in Actions)\n    run(\"git\", \"tag\", \"-s\", version, \"-m\", f\"{version} release\")\n    run(\"git\", \"push\", \"--tags\", \"git@github.com:pyca/cryptography.git\")\n\n\ndef replace_version(\n    p: pathlib.Path, variable_name: str, new_version: str\n) -> None:\n    content = p.read_text()\n\n    pattern = rf\"^{variable_name}\\s*=\\s*.*$\"\n    match = re.search(pattern, content, re.MULTILINE)\n    assert match is not None\n\n    start, end = match.span()\n    new_content = (\n        content[:start] + f'{variable_name} = \"{new_version}\"' + content[end:]\n    )\n\n    p.write_text(new_content)\n\n\n@cli.command()\n@click.argument(\"new_version\")\ndef bump_version(new_version: str) -> None:\n    base_dir = pathlib.Path(__file__).parent\n\n    replace_version(base_dir / \"pyproject.toml\", \"version\", new_version)\n    replace_version(\n        base_dir / \"src/cryptography/__about__.py\", \"__version__\", new_version\n    )\n    replace_version(\n        base_dir / \"vectors/pyproject.toml\",\n        \"version\",\n        new_version,\n    )\n    replace_version(\n        base_dir / \"vectors/cryptography_vectors/__about__.py\",\n        \"__version__\",\n        new_version,\n    )\n\n\nif __name__ == \"__main__\":\n    cli()\n", "path": "release.py"}], "after_files": [{"content": "# This file is dual licensed under the terms of the Apache License, Version\n# 2.0, and the BSD License. See the LICENSE file in the root of this repository\n# for complete details.\n\nimport pathlib\nimport re\nimport subprocess\n\nimport click\nimport tomllib\nfrom packaging.version import Version\n\n\ndef run(*args: str) -> None:\n    print(f\"[running] {list(args)}\")\n    subprocess.check_call(list(args))\n\n\n@click.group()\ndef cli():\n    pass\n\n\n@cli.command()\ndef release() -> None:\n    base_dir = pathlib.Path(__file__).parent\n    with (base_dir / \"pyproject.toml\").open(\"rb\") as f:\n        pyproject = tomllib.load(f)\n        version = pyproject[\"project\"][\"version\"]\n\n    if Version(version).is_prerelease:\n        raise RuntimeError(\n            f\"Can't release, pyproject.toml version is pre-release: {version}\"\n        )\n\n    # Tag and push the tag (this will trigger the wheel builder in Actions)\n    run(\"git\", \"tag\", \"-s\", version, \"-m\", f\"{version} release\")\n    run(\"git\", \"push\", \"--tags\", \"git@github.com:pyca/cryptography.git\")\n\n\ndef replace_pattern(p: pathlib.Path, pattern: str, replacement: str) -> None:\n    content = p.read_text()\n    match = re.search(pattern, content, re.MULTILINE)\n    assert match is not None\n\n    start, end = match.span()\n    new_content = content[:start] + replacement + content[end:]\n    p.write_text(new_content)\n\n\ndef replace_version(\n    p: pathlib.Path, variable_name: str, new_version: str\n) -> None:\n    replace_pattern(\n        p, rf\"^{variable_name}\\s*=\\s*.*$\", f'{variable_name} = \"{new_version}\"'\n    )\n\n\n@cli.command()\n@click.argument(\"new_version\")\ndef bump_version(new_version: str) -> None:\n    base_dir = pathlib.Path(__file__).parent\n\n    replace_version(base_dir / \"pyproject.toml\", \"version\", new_version)\n    replace_version(\n        base_dir / \"src/cryptography/__about__.py\", \"__version__\", new_version\n    )\n    replace_version(\n        base_dir / \"vectors/pyproject.toml\",\n        \"version\",\n        new_version,\n    )\n    replace_version(\n        base_dir / \"vectors/cryptography_vectors/__about__.py\",\n        \"__version__\",\n        new_version,\n    )\n\n    if Version(new_version).is_prerelease:\n        replace_pattern(\n            base_dir / \"pyproject.toml\",\n            r'\"cryptography_vectors(==.*?)?\"',\n            '\"cryptography_vectors\"',\n        )\n    else:\n        replace_pattern(\n            base_dir / \"pyproject.toml\",\n            r'\"cryptography_vectors(==.*?)?\"',\n            f'\"cryptography_vectors=={new_version}\"',\n        )\n\n\nif __name__ == \"__main__\":\n    cli()\n", "path": "release.py"}]}