Repository: pydantic/pydantic

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
```



Discussion:

Resolving patch:
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


Test patch:
diff --git a/tests/test_edge_cases.py b/tests/test_edge_cases.py
--- a/tests/test_edge_cases.py
+++ b/tests/test_edge_cases.py
@@ -2724,22 +2724,20 @@ def test_eq_with_cached_property():
     model instances. This is not compatible with e.g. functools.cached_property,
     which caches the computed values in the instance's __dict__
     """
-    # functools.cached_property doesn't exist in python 3.7
-    if sys.version_info >= (3, 8):
 
-        class Model(BaseModel):
-            attr: int
-
-            @functools.cached_property
-            def cached(self) -> int:
-                return 0
-
-        obj1 = Model(attr=1)
-        obj2 = Model(attr=1)
-        # ensure the instances are indeed equal before __dict__ mutations
-        assert obj1 == obj2
-        # This access to the cached_property has the side-effect of modifying obj1.__dict__
-        # See functools.cached_property documentation and source code
-        obj1.cached
-        # Ensure the objects still compare equals after caching a property
-        assert obj1 == obj2
+    class Model(BaseModel):
+        attr: int
+
+        @functools.cached_property
+        def cached(self) -> int:
+            return 0
+
+    obj1 = Model(attr=1)
+    obj2 = Model(attr=1)
+    # ensure the instances are indeed equal before __dict__ mutations
+    assert obj1 == obj2
+    # This access to the cached_property has the side-effect of modifying obj1.__dict__
+    # See functools.cached_property documentation and source code
+    obj1.cached
+    # Ensure the objects still compare equals after caching a property
+    assert obj1 == obj2
diff --git a/tests/test_typing.py b/tests/test_typing.py
--- a/tests/test_typing.py
+++ b/tests/test_typing.py
@@ -27,13 +27,7 @@
 except ImportError:
     typing_extensions_TypedDict = None
 
-
-try:
-    from mypy_extensions import TypedDict as mypy_extensions_TypedDict
-except ImportError:
-    mypy_extensions_TypedDict = None
-
-ALL_TYPEDDICT_KINDS = (typing_TypedDict, typing_extensions_TypedDict, mypy_extensions_TypedDict)
+ALL_TYPEDDICT_KINDS = (typing_TypedDict, typing_extensions_TypedDict)
 
 
 def test_is_namedtuple():