Browse Source

Remove some deprecated functionality.

Jelmer Vernooij 2 years ago
parent
commit
c477828a3e
8 changed files with 2 additions and 107 deletions
  1. 0 25
      dulwich/client.py
  2. 0 24
      dulwich/config.py
  3. 0 6
      dulwich/object_store.py
  4. 0 8
      dulwich/objects.py
  5. 0 19
      dulwich/porcelain.py
  6. 0 12
      dulwich/refs.py
  7. 0 11
      dulwich/tests/test_objects.py
  8. 2 2
      setup.py

+ 0 - 25
dulwich/client.py

@@ -1533,31 +1533,6 @@ default_local_git_client_cls = LocalGitClient
 class SSHVendor(object):
     """A client side SSH implementation."""
 
-    def connect_ssh(
-        self,
-        host,
-        command,
-        username=None,
-        port=None,
-        password=None,
-        key_filename=None,
-    ):
-        # This function was deprecated in 0.9.1
-        import warnings
-
-        warnings.warn(
-            "SSHVendor.connect_ssh has been renamed to SSHVendor.run_command",
-            DeprecationWarning,
-        )
-        return self.run_command(
-            host,
-            command,
-            username=username,
-            port=port,
-            password=password,
-            key_filename=key_filename,
-        )
-
     def run_command(
         self,
         host,

+ 0 - 24
dulwich/config.py

@@ -28,7 +28,6 @@ TODO:
 
 import os
 import sys
-import warnings
 from typing import (
     BinaryIO,
     Iterable,
@@ -231,29 +230,6 @@ class Config(object):
         """
         raise NotImplementedError(self.items)
 
-    def iteritems(self, section: SectionLike) -> Iterator[Tuple[Name, Value]]:
-        """Iterate over the configuration pairs for a specific section.
-
-        Args:
-          section: Tuple with section name and optional subsection namee
-        Returns:
-          Iterator over (name, value) pairs
-        """
-        warnings.warn(
-            "Use %s.items instead." % type(self).__name__,
-            DeprecationWarning,
-            stacklevel=3,
-        )
-        return self.items(section)
-
-    def itersections(self) -> Iterator[Section]:
-        warnings.warn(
-            "Use %s.items instead." % type(self).__name__,
-            DeprecationWarning,
-            stacklevel=3,
-        )
-        return self.sections()
-
     def sections(self) -> Iterator[Section]:
         """Iterate over the sections.
 

+ 0 - 6
dulwich/object_store.py

@@ -1152,12 +1152,6 @@ class ObjectStoreIterator(ObjectIterator):
         """Return the number of objects."""
         return len(list(self.itershas()))
 
-    def empty(self):
-        import warnings
-
-        warnings.warn("Use bool() instead.", DeprecationWarning)
-        return self._empty()
-
     def _empty(self):
         it = self.itershas()
         try:

+ 0 - 8
dulwich/objects.py

@@ -34,7 +34,6 @@ from typing import (
     Union,
     Type,
 )
-import warnings
 import zlib
 from hashlib import sha1
 
@@ -1091,13 +1090,6 @@ class Tree(ShaFile):
           name: The name of the entry, as a string.
           hexsha: The hex SHA of the entry as a string.
         """
-        if isinstance(name, int) and isinstance(mode, bytes):
-            (name, mode) = (mode, name)
-            warnings.warn(
-                "Please use Tree.add(name, mode, hexsha)",
-                category=DeprecationWarning,
-                stacklevel=2,
-            )
         self._entries[name] = mode, hexsha
         self._needs_serialization = True
 

+ 0 - 19
dulwich/porcelain.py

@@ -905,15 +905,6 @@ def submodule_list(repo):
             yield path.decode(DEFAULT_ENCODING), sha.decode(DEFAULT_ENCODING)
 
 
-def tag(*args, **kwargs):
-    import warnings
-
-    warnings.warn(
-        "tag has been deprecated in favour of tag_create.", DeprecationWarning
-    )
-    return tag_create(*args, **kwargs)
-
-
 def tag_create(
     repo,
     tag,
@@ -974,16 +965,6 @@ def tag_create(
         r.refs[_make_tag_ref(tag)] = tag_id
 
 
-def list_tags(*args, **kwargs):
-    import warnings
-
-    warnings.warn(
-        "list_tags has been deprecated in favour of tag_list.",
-        DeprecationWarning,
-    )
-    return tag_list(*args, **kwargs)
-
-
 def tag_list(repo, outstream=sys.stdout):
     """List all tags.
 

+ 0 - 12
dulwich/refs.py

@@ -297,18 +297,6 @@ class RefsContainer(object):
                 raise KeyError(name)
         return refnames, contents
 
-    def _follow(self, name):
-        import warnings
-
-        warnings.warn(
-            "RefsContainer._follow is deprecated. Use RefsContainer.follow " "instead.",
-            DeprecationWarning,
-        )
-        refnames, contents = self.follow(name)
-        if not refnames:
-            return (None, contents)
-        return (refnames[-1], contents)
-
     def __contains__(self, refname):
         if self.read_ref(refname):
             return True

+ 0 - 11
dulwich/tests/test_objects.py

@@ -840,17 +840,6 @@ class TreeTests(ShaFileCheckTests):
         self.assertEqual(x[b"myname"], (0o100755, myhexsha))
         self.assertEqual(b"100755 myname\0" + hex_to_sha(myhexsha), x.as_raw_string())
 
-    def test_add_old_order(self):
-        myhexsha = b"d80c186a03f423a81b39df39dc87fd269736ca86"
-        x = Tree()
-        warnings.simplefilter("ignore", DeprecationWarning)
-        try:
-            x.add(0o100755, b"myname", myhexsha)
-        finally:
-            warnings.resetwarnings()
-        self.assertEqual(x[b"myname"], (0o100755, myhexsha))
-        self.assertEqual(b"100755 myname\0" + hex_to_sha(myhexsha), x.as_raw_string())
-
     def test_simple(self):
         myhexsha = b"d80c186a03f423a81b39df39dc87fd269736ca86"
         x = Tree()

+ 2 - 2
setup.py

@@ -111,8 +111,8 @@ setup(name='dulwich',
           "GitHub": "https://github.com/dulwich/dulwich",
       },
       keywords="git vcs",
-      packages=['dulwich', 'dulwich.tests', 'dulwich.tests.compat',
-                'dulwich.contrib'],
+      packages=['dulwich', 'dulwich.cloud', 'dulwich.tests',
+                'dulwich.tests.compat', 'dulwich.contrib'],
       package_data={'': ['../docs/tutorial/*.txt', 'py.typed']},
       scripts=scripts,
       ext_modules=ext_modules,