Repository: copier-org/jinja2-jsonschema (language: python)

Issue:
build: drop support for Python 3.7
I've dropped support for Python 3.7 which reached its EOL already more than a year ago on June 27, 2023. This has been long overdue.


Discussion / hints:

Fix patch:
diff --git a/pyproject.toml b/pyproject.toml
index 3e8756a..e878c6f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -51,7 +51,7 @@ types-pyyaml = ">=6.0.12.10"
 [tool.ruff]
 src = ["src"]
 line-length = 88
-target-version = "py37"
+target-version = "py39"
 
 [tool.ruff.lint]
 ignore = ["D100", "D104", "D107", "ISC001"]
diff --git a/src/jinja2_jsonschema/extension.py b/src/jinja2_jsonschema/extension.py
index d0ec5fe..e900230 100644
--- a/src/jinja2_jsonschema/extension.py
+++ b/src/jinja2_jsonschema/extension.py
@@ -3,11 +3,11 @@
 from __future__ import annotations
 
 import json
+from collections.abc import Mapping
 from http import HTTPStatus
 from typing import TYPE_CHECKING
 from typing import Any
 from typing import Literal
-from typing import Mapping
 from urllib.error import HTTPError
 from urllib.parse import urlparse
 from urllib.request import urlopen


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
index 10f0752..9b217b9 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -11,8 +11,8 @@
 from socketserver import TCPServer
 from threading import Thread
 from time import sleep
+from typing import TYPE_CHECKING
 from typing import Callable
-from typing import Iterator
 from typing import cast
 from urllib.error import URLError
 from urllib.request import Request
@@ -20,6 +20,9 @@
 
 import pytest
 
+if TYPE_CHECKING:
+    from collections.abc import Iterator
+
 
 def get_unused_tcp_port() -> int:
     """Get an unused TCP port on the local host.
diff --git a/tests/filter/utils.py b/tests/filter/utils.py
index c44bc4c..e9bb698 100644
--- a/tests/filter/utils.py
+++ b/tests/filter/utils.py
@@ -4,11 +4,12 @@
 
 from typing import TYPE_CHECKING
 from typing import Any
-from typing import Sequence
 
 from pychoir import MatchesRegex
 
 if TYPE_CHECKING:
+    from collections.abc import Sequence
+
     from pychoir import Matchable
 
 TEST_CASES: Sequence[tuple[Any, Matchable]] = [
diff --git a/tests/test/utils.py b/tests/test/utils.py
index 75e640d..ac22bc5 100644
--- a/tests/test/utils.py
+++ b/tests/test/utils.py
@@ -2,8 +2,11 @@
 
 from __future__ import annotations
 
+from typing import TYPE_CHECKING
 from typing import Any
-from typing import Sequence
+
+if TYPE_CHECKING:
+    from collections.abc import Sequence
 
 TEST_CASES: Sequence[tuple[Any, str]] = [
     ({"age": 30}, "True"),
diff --git a/tests/utils.py b/tests/utils.py
index 8497d64..5fabb22 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -7,7 +7,6 @@
 from typing import TYPE_CHECKING
 from typing import Any
 from typing import Literal
-from typing import Mapping
 
 import yaml
 from jinja2 import Environment
@@ -16,6 +15,7 @@
 from jinja2_jsonschema import JsonSchemaExtension
 
 if TYPE_CHECKING:
+    from collections.abc import Mapping
     from pathlib import Path
 
 SCHEMA = {