Ver código fonte

Move greenthreads to contrib/

Jelmer Vernooij 1 mês atrás
pai
commit
4de55ae850

+ 9 - 0
NEWS

@@ -1,5 +1,14 @@
 0.25.0	UNRELEASED
 
+**PLEASE NOTE**: This release makes quite a lot of changes to public APIs. This
+is ahead of a 1.0 release, after which API changes will be kept backwards
+compatible.
+
+ * Move greenthreads support to dulwich/contrib.
+   This code isn't really developed and only used
+   by the swift support.
+   (Jelmer Vernooij)
+
  * Move protocol-level peeled tags functions (``serialize_refs()``,
    ``write_info_refs()``, ``split_peeled_refs()``, ``strip_peeled_refs()``)
    from ``dulwich.refs`` to ``dulwich.protocol``. The ``^{}`` peeled tags syntax

+ 1 - 0
dulwich/contrib/__init__.py

@@ -27,6 +27,7 @@ have additional dependencies or more specialized use cases.
 
 Available modules:
 - diffstat: Generate diff statistics similar to git's --stat option
+- greenthreads: Green-threaded support for finding missing objects
 - paramiko_vendor: SSH client implementation using paramiko
 - release_robot: Automated release management utilities
 - requests_vendor: HTTP client implementation using requests

+ 2 - 2
dulwich/greenthreads.py → dulwich/contrib/greenthreads.py

@@ -28,13 +28,13 @@ from collections.abc import Callable, Sequence
 import gevent
 from gevent import pool
 
-from .object_store import (
+from ..object_store import (
     BaseObjectStore,
     MissingObjectFinder,
     _collect_ancestors,
     _collect_filetree_revs,
 )
-from .objects import Commit, ObjectID, Tag
+from ..objects import Commit, ObjectID, Tag
 
 
 def _split_commits_and_tags(

+ 1 - 1
dulwich/contrib/swift.py

@@ -44,7 +44,6 @@ from typing import Any, BinaryIO, cast
 from geventhttpclient import HTTPClient
 
 from ..file import _GitFile
-from ..greenthreads import GreenThreadsMissingObjectFinder
 from ..lru_cache import LRUSizeCache
 from ..object_store import INFODIR, PACKDIR, PackBasedObjectStore
 from ..objects import S_ISGITLINK, Blob, Commit, ObjectID, Tag, Tree
@@ -69,6 +68,7 @@ from ..protocol import TCP_GIT_PORT, split_peeled_refs, write_info_refs
 from ..refs import HEADREF, Ref, RefsContainer, read_info_refs
 from ..repo import OBJECTDIR, BaseRepo
 from ..server import Backend, BackendRepo, TCPGitServer
+from .greenthreads import GreenThreadsMissingObjectFinder
 
 """
 # Configuration file sample

+ 0 - 1
tests/__init__.py

@@ -149,7 +149,6 @@ def self_test_suite() -> unittest.TestSuite:
         "gc",
         "grafts",
         "graph",
-        "greenthreads",
         "hooks",
         "ignore",
         "index",

+ 1 - 0
tests/contrib/__init__.py

@@ -25,6 +25,7 @@ import unittest
 def test_suite() -> unittest.TestSuite:
     names = [
         "diffstat",
+        "greenthreads",
         "paramiko_vendor",
         "release_robot",
         "swift",

+ 2 - 2
tests/test_greenthreads.py → tests/contrib/test_greenthreads.py

@@ -26,7 +26,7 @@ import time
 from dulwich.object_store import MemoryObjectStore
 from dulwich.objects import Blob, Commit, Tree, parse_timezone
 
-from . import TestCase, skipIf
+from .. import TestCase, skipIf
 
 try:
     import gevent  # noqa: F401
@@ -36,7 +36,7 @@ except ImportError:
     gevent_support = False
 
 if gevent_support:
-    from dulwich.greenthreads import GreenThreadsMissingObjectFinder
+    from dulwich.contrib.greenthreads import GreenThreadsMissingObjectFinder
 
 skipmsg = "Gevent library is not installed"