Browse Source

Drop Python 3.7 support

Jelmer Vernooij 10 months ago
parent
commit
4ec8ab9d80
6 changed files with 14 additions and 28 deletions
  1. 1 1
      .github/workflows/pythontest.yml
  2. 2 0
      NEWS
  3. 1 5
      dulwich/object_store.py
  4. 6 11
      dulwich/pack.py
  5. 3 8
      dulwich/server.py
  6. 1 3
      pyproject.toml

+ 1 - 1
.github/workflows/pythontest.yml

@@ -13,7 +13,7 @@ jobs:
       matrix:
         os: [ubuntu-latest, macos-latest, windows-latest]
         python-version:
-          ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
+          ["3.8", "3.9", "3.10", "3.11", "3.12"]
       fail-fast: false
 
     steps:

+ 2 - 0
NEWS

@@ -6,6 +6,8 @@
 
  * Add initial integration with OSS-Fuzz for continuous fuzz testing and first fuzzing test (David Lakin, #1302)
 
+ * Drop Python 3.7 support. (Jelmer Vernooij)
+
 0.22.1	2024-04-23
 
  * Handle alternate case for worktreeconfig setting (Will Shanks, #1285)

+ 1 - 5
dulwich/object_store.py

@@ -36,17 +36,13 @@ from typing import (
     Iterator,
     List,
     Optional,
+    Protocol,
     Sequence,
     Set,
     Tuple,
     cast,
 )
 
-try:
-    from typing import Protocol
-except ImportError:  # python << 3.8
-    from typing_extensions import Protocol  # type: ignore
-
 from .errors import NotTreeError
 from .file import GitFile
 from .objects import (

+ 6 - 11
dulwich/pack.py

@@ -45,7 +45,12 @@ except ModuleNotFoundError:
 import os
 import struct
 import sys
+import warnings
+import zlib
+from hashlib import sha1
 from itertools import chain
+from os import SEEK_CUR, SEEK_END
+from struct import unpack_from
 from typing import (
     BinaryIO,
     Callable,
@@ -56,6 +61,7 @@ from typing import (
     Iterator,
     List,
     Optional,
+    Protocol,
     Sequence,
     Set,
     Tuple,
@@ -63,17 +69,6 @@ from typing import (
     Union,
 )
 
-try:
-    from typing import Protocol
-except ImportError:  # python << 3.8
-    from typing_extensions import Protocol  # type: ignore
-
-import warnings
-import zlib
-from hashlib import sha1
-from os import SEEK_CUR, SEEK_END
-from struct import unpack_from
-
 try:
     import mmap
 except ImportError:

+ 3 - 8
dulwich/server.py

@@ -45,18 +45,13 @@ Currently supported capabilities:
 import collections
 import os
 import socket
+import socketserver
 import sys
 import time
+import zlib
 from functools import partial
 from typing import Dict, Iterable, List, Optional, Set, Tuple, cast
-
-try:
-    from typing import Protocol as TypingProtocol
-except ImportError:  # python < 3.8
-    from typing_extensions import Protocol as TypingProtocol  # type: ignore
-
-import socketserver
-import zlib
+from typing import Protocol as TypingProtocol
 
 from dulwich import log_utils
 

+ 1 - 3
pyproject.toml

@@ -12,7 +12,6 @@ keywords = ["vcs", "git"]
 classifiers = [
     "Development Status :: 4 - Beta",
     "License :: OSI Approved :: Apache Software License",
-    "Programming Language :: Python :: 3.7",
     "Programming Language :: Python :: 3.8",
     "Programming Language :: Python :: 3.9",
     "Programming Language :: Python :: 3.10",
@@ -24,10 +23,9 @@ classifiers = [
     "Operating System :: Microsoft :: Windows",
     "Topic :: Software Development :: Version Control",
 ]
-requires-python = ">=3.7"
+requires-python = ">=3.8"
 dependencies = [
     "urllib3>=1.25",
-    'typing_extensions;python_version<="3.7"',
     'setuptools ; python_version >= "3.12"',
 ]
 dynamic = ["version"]