Bug 1343718 - Avoid requiring an objdir when simply importing mozbuild.artifacts. r=chmanchester draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 01 Mar 2017 11:15:15 +0900
changeset 562403 db9dc89b09d146440392ec2aa6c84bce6aa398e3
parent 562355 3243c8fc3ce7831dda843b60d6bb2d7e4acf1fd4
child 562404 4bfd15f53cf0885a8b0984c0c8532a612f0bb4ae
push id54023
push userbmo:mh+mozilla@glandium.org
push dateThu, 13 Apr 2017 23:16:24 +0000
reviewerschmanchester
bugs1343718
milestone55.0a1
Bug 1343718 - Avoid requiring an objdir when simply importing mozbuild.artifacts. r=chmanchester
python/mozbuild/mozbuild/artifacts.py
--- a/python/mozbuild/mozbuild/artifacts.py
+++ b/python/mozbuild/mozbuild/artifacts.py
@@ -62,17 +62,16 @@ import zipfile
 
 import pylru
 from taskgraph.util.taskcluster import (
     find_task_id,
     get_artifact_url,
     list_artifacts,
 )
 
-from mozbuild.action.test_archive import OBJDIR_TEST_FILES
 from mozbuild.util import (
     ensureParentDir,
     FileAvoidWrite,
 )
 import mozinstall
 from mozpack.files import (
     JarFinder,
     TarFinder,
@@ -180,16 +179,17 @@ class ArtifactJob(object):
         if self._symbols_archive_suffix and filename.endswith(self._symbols_archive_suffix):
             return self.process_symbols_archive(filename, processed_filename)
         return self.process_package_artifact(filename, processed_filename)
 
     def process_package_artifact(self, filename, processed_filename):
         raise NotImplementedError("Subclasses must specialize process_package_artifact!")
 
     def process_tests_artifact(self, filename, processed_filename):
+        from mozbuild.action.test_archive import OBJDIR_TEST_FILES
         added_entry = False
 
         with JarWriter(file=processed_filename, optimize=False, compress_level=5) as writer:
             reader = JarReader(filename)
             for filename, entry in reader.entries.iteritems():
                 for pattern, (src_prefix, dest_prefix) in self.test_artifact_patterns:
                     if not mozpath.match(filename, pattern):
                         continue