python: Remove remaining references to third_party python libs
authorAndrew Bartlett <abartlet@samba.org>
Tue, 18 Aug 2020 09:38:57 +0000 (21:38 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 21 Aug 2020 00:12:51 +0000 (00:12 +0000)
For now at least we do not have any in third_party.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 21 00:12:52 UTC 2020 on sn-devel-184

python/samba/__init__.py
python/samba/subunit/__init__.py
script/show_test_time

index 360918c49ad9750c30d79636e187c80c917ddbb1..0341cb36dfeaf4b5deb41c26d5d62aa54f66e132 100644 (file)
@@ -322,46 +322,6 @@ def valid_netbios_name(name):
     return True
 
 
-def import_bundled_package(modulename, location, source_tree_container,
-                           namespace):
-    """Import the bundled version of a package.
-
-    :note: This should only be called if the system version of the package
-        is not adequate.
-
-    :param modulename: Module name to import
-    :param location: Location to add to sys.path (can be relative to
-        ${srcdir}/${source_tree_container})
-    :param source_tree_container: Directory under source root that
-        contains the bundled third party modules.
-    :param namespace: Namespace to import module from, when not in source tree
-    """
-    if in_source_tree():
-        extra_path = os.path.join(source_tree_topdir(), source_tree_container,
-                                  location)
-        if extra_path not in sys.path:
-            sys.path.insert(0, extra_path)
-        sys.modules[modulename] = __import__(modulename)
-    else:
-        sys.modules[modulename] = __import__(
-            "%s.%s" % (namespace, modulename), fromlist=[namespace])
-
-
-def ensure_third_party_module(modulename, location):
-    """Add a location to sys.path if a third party dependency can't be found.
-
-    :param modulename: Module name to import
-    :param location: Location to add to sys.path (can be relative to
-        ${srcdir}/third_party)
-    """
-    try:
-        __import__(modulename)
-    except ImportError:
-        import_bundled_package(modulename, location,
-                               source_tree_container="third_party",
-                               namespace="samba.third_party")
-
-
 def dn_from_dns_name(dnsdomain):
     """return a DN from a DNS name domain/forest root"""
     return "DC=" + ",DC=".join(dnsdomain.split("."))
index ca5511f899e73247be2983d451a3b4a6e8aa3ddf..fef06ffa1cd157850023eccad41eafd943462aff 100644 (file)
@@ -19,7 +19,6 @@
 
 import samba
 
-samba.ensure_third_party_module("iso8601", "pyiso8601")
 import iso8601
 
 import unittest
index fae7b814f497e4ada0292fc7418b2ae9b8792368..5a84f19787c3dfa56f11301a90cd3e8355ea3c8b 100755 (executable)
@@ -10,8 +10,6 @@ parser.add_option("--limit", dest="limit", type=int,
                   help="Limit to this number of output entries.", default=0)
 (opts, args) = parser.parse_args()
 
-third_party_path = os.path.join(os.path.dirname(sys.argv[0]), "..", "lib")
-
 durations = {}
 
 cmd = "subunit-1to2 | subunit-ls --times --no-passthrough"