prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Upgrade ruff target version to Python 3.8
  ### Initial Checks
  
  - [X] I confirm that I'm using Pydantic V2
  
  ### Description
  
  I deemed this as an action left out from [Dropping Python 3.7 Support](https://github.com/pydantic/pydantic/issues/7187)
  
  1. Update ruff's `target-version` to `py38`
  2. Run `make format` and adopt minimal changes to conform
  
  ### Example Code
  
  ```Python
  (pydantic-3.12) PS D:\dev\Elkiwa\pydantic> make format
  PDM, version 2.10.4
  pdm run ruff --fix pydantic tests docs/plugins
  pdm run ruff format pydantic tests docs/plugins
  164 files left unchanged
  ```
  
  
  ### Python, Pydantic & OS Version
  
  ```Text
               pydantic version: 2.6.0a1
          pydantic-core version: 2.14.5
            pydantic-core build: profile=release pgo=true
                   install path: D:\dev\Elkiwa\pydantic\pydantic
                 python version: 3.12.1 (tags/v3.12.1:2305ca5, Dec  7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)]
                       platform: Windows-11-10.0.22631-SP0
               related packages: email-validator-2.1.0.post1 mypy-1.1.1 pydantic-extra-types-2.1.0 pydantic-settings-2.1.0 typing_extensions-4.8.0
                         commit: a3c3037f
  ```
  
  
  </issue>
  <code>
  [start of pydantic/plugin/_loader.py]
  1 from __future__ import annotations
  2 
  3 import sys
  4 import warnings
  5 from typing import TYPE_CHECKING, Iterable
  6 
  7 from typing_extensions import Final
  8 
  9 if sys.version_info >= (3, 8):
  10     import importlib.metadata as importlib_metadata
  11 else:
  12     import importlib_metadata
  13 
  14 
  15 if TYPE_CHECKING:
  16     from . import PydanticPluginProtocol
  17 
  18 
  19 PYDANTIC_ENTRY_POINT_GROUP: Final[str] = 'pydantic'
  20 
  21 # cache of plugins
  22 _plugins: dict[str, PydanticPluginProtocol] | None = None
  23 # return no plugins while loading plugins to avoid recursion and errors while import plugins
  24 # this means that if plugins use pydantic
  25 _loading_plugins: bool = False
  26 
  27 
  28 def get_plugins() -> Iterable[PydanticPluginProtocol]:
  29     """Load plugins for Pydantic.
  30 
  31     Inspired by: https://github.com/pytest-dev/pluggy/blob/1.3.0/src/pluggy/_manager.py#L376-L402
  32     """
  33     global _plugins, _loading_plugins
  34     if _loading_plugins:
  35         # this happens when plugins themselves use pydantic, we return no plugins
  36         return ()
  37     elif _plugins is None:
  38         _plugins = {}
  39         # set _loading_plugins so any plugins that use pydantic don't themselves use plugins
  40         _loading_plugins = True
  41         try:
  42             for dist in importlib_metadata.distributions():
  43                 for entry_point in dist.entry_points:
  44                     if entry_point.group != PYDANTIC_ENTRY_POINT_GROUP:
  45                         continue
  46                     if entry_point.value in _plugins:
  47                         continue
  48                     try:
  49                         _plugins[entry_point.value] = entry_point.load()
  50                     except (ImportError, AttributeError) as e:
  51                         warnings.warn(
  52                             f'{e.__class__.__name__} while loading the `{entry_point.name}` Pydantic plugin, '
  53                             f'this plugin will not be installed.\n\n{e!r}'
  54                         )
  55         finally:
  56             _loading_plugins = False
  57 
  58     return _plugins.values()
  59
  [end of pydantic/plugin/_loader.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/pydantic/plugin/_loader.py b/pydantic/plugin/_loader.py
  --- a/pydantic/plugin/_loader.py
  +++ b/pydantic/plugin/_loader.py
  @@ -1,16 +1,8 @@
   from __future__ import annotations
   
  -import sys
  +import importlib.metadata as importlib_metadata
   import warnings
  -from typing import TYPE_CHECKING, Iterable
  -
  -from typing_extensions import Final
  -
  -if sys.version_info >= (3, 8):
  -    import importlib.metadata as importlib_metadata
  -else:
  -    import importlib_metadata
  -
  +from typing import TYPE_CHECKING, Final, Iterable
   
   if TYPE_CHECKING:
       from . import PydanticPluginProtocol
  
verification_info: {"golden_diff": "diff --git a/pydantic/plugin/_loader.py b/pydantic/plugin/_loader.py\n--- a/pydantic/plugin/_loader.py\n+++ b/pydantic/plugin/_loader.py\n@@ -1,16 +1,8 @@\n from __future__ import annotations\n \n-import sys\n+import importlib.metadata as importlib_metadata\n import warnings\n-from typing import TYPE_CHECKING, Iterable\n-\n-from typing_extensions import Final\n-\n-if sys.version_info >= (3, 8):\n-    import importlib.metadata as importlib_metadata\n-else:\n-    import importlib_metadata\n-\n+from typing import TYPE_CHECKING, Final, Iterable\n \n if TYPE_CHECKING:\n     from . import PydanticPluginProtocol\n", "issue": "Upgrade ruff target version to Python 3.8\n### Initial Checks\r\n\r\n- [X] I confirm that I'm using Pydantic V2\r\n\r\n### Description\r\n\r\nI deemed this as an action left out from [Dropping Python 3.7 Support](https://github.com/pydantic/pydantic/issues/7187)\r\n\r\n1. Update ruff's `target-version` to `py38`\r\n2. Run `make format` and adopt minimal changes to conform\r\n\r\n### Example Code\r\n\r\n```Python\r\n(pydantic-3.12) PS D:\\dev\\Elkiwa\\pydantic> make format\r\nPDM, version 2.10.4\r\npdm run ruff --fix pydantic tests docs/plugins\r\npdm run ruff format pydantic tests docs/plugins\r\n164 files left unchanged\r\n```\r\n\r\n\r\n### Python, Pydantic & OS Version\r\n\r\n```Text\r\n             pydantic version: 2.6.0a1\r\n        pydantic-core version: 2.14.5\r\n          pydantic-core build: profile=release pgo=true\r\n                 install path: D:\\dev\\Elkiwa\\pydantic\\pydantic\r\n               python version: 3.12.1 (tags/v3.12.1:2305ca5, Dec  7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)]\r\n                     platform: Windows-11-10.0.22631-SP0\r\n             related packages: email-validator-2.1.0.post1 mypy-1.1.1 pydantic-extra-types-2.1.0 pydantic-settings-2.1.0 typing_extensions-4.8.0\r\n                       commit: a3c3037f\r\n```\r\n\n", "before_files": [{"content": "from __future__ import annotations\n\nimport sys\nimport warnings\nfrom typing import TYPE_CHECKING, Iterable\n\nfrom typing_extensions import Final\n\nif sys.version_info >= (3, 8):\n    import importlib.metadata as importlib_metadata\nelse:\n    import importlib_metadata\n\n\nif TYPE_CHECKING:\n    from . import PydanticPluginProtocol\n\n\nPYDANTIC_ENTRY_POINT_GROUP: Final[str] = 'pydantic'\n\n# cache of plugins\n_plugins: dict[str, PydanticPluginProtocol] | None = None\n# return no plugins while loading plugins to avoid recursion and errors while import plugins\n# this means that if plugins use pydantic\n_loading_plugins: bool = False\n\n\ndef get_plugins() -> Iterable[PydanticPluginProtocol]:\n    \"\"\"Load plugins for Pydantic.\n\n    Inspired by: https://github.com/pytest-dev/pluggy/blob/1.3.0/src/pluggy/_manager.py#L376-L402\n    \"\"\"\n    global _plugins, _loading_plugins\n    if _loading_plugins:\n        # this happens when plugins themselves use pydantic, we return no plugins\n        return ()\n    elif _plugins is None:\n        _plugins = {}\n        # set _loading_plugins so any plugins that use pydantic don't themselves use plugins\n        _loading_plugins = True\n        try:\n            for dist in importlib_metadata.distributions():\n                for entry_point in dist.entry_points:\n                    if entry_point.group != PYDANTIC_ENTRY_POINT_GROUP:\n                        continue\n                    if entry_point.value in _plugins:\n                        continue\n                    try:\n                        _plugins[entry_point.value] = entry_point.load()\n                    except (ImportError, AttributeError) as e:\n                        warnings.warn(\n                            f'{e.__class__.__name__} while loading the `{entry_point.name}` Pydantic plugin, '\n                            f'this plugin will not be installed.\\n\\n{e!r}'\n                        )\n        finally:\n            _loading_plugins = False\n\n    return _plugins.values()\n", "path": "pydantic/plugin/_loader.py"}]}