Bug 1542963 - Add absolute_imports to mozbuild and mozpack. r=#build
☠☠ backed out by cd02c0486c2e ☠ ☠
authorJustin Wood <Callek@gmail.com>
Mon, 08 Apr 2019 09:29:44 -0400
changeset 474131 a1a84e0feabbaf28257547dfecec84ddd72f0b61
parent 474130 14aa1bd254a48f74c05fccc4be7df847135ec090
child 474132 70fbe1a158ae2cc7a6730ba47a04b426ab803f0a
push id36023
push userncsoregi@mozilla.com
push dateThu, 16 May 2019 21:56:43 +0000
treeherdermozilla-central@786f094a30ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1542963
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1542963 - Add absolute_imports to mozbuild and mozpack. r=#build Lint python/mozbuild/{mozbuild,mozpack}. r=#build Add 'from __future__ import absolute_import' to all missing files in python/mozbuild/{mozbuild,mozpack}/**/*.py Differential Revision: https://phabricator.services.mozilla.com/D26643
python/mozbuild/mozbuild/action/check_binary.py
python/mozbuild/mozbuild/action/download_wpt_manifest.py
python/mozbuild/mozbuild/action/dump_env.py
python/mozbuild/mozbuild/action/exe_7z_archive.py
python/mozbuild/mozbuild/action/exe_7z_extract.py
python/mozbuild/mozbuild/action/generate_searchjson.py
python/mozbuild/mozbuild/action/make_dmg.py
python/mozbuild/mozbuild/action/make_unzip.py
python/mozbuild/mozbuild/action/make_zip.py
python/mozbuild/mozbuild/action/output_searchplugins_list.py
python/mozbuild/mozbuild/action/tooltool.py
python/mozbuild/mozbuild/action/unpack_dmg.py
python/mozbuild/mozbuild/analyze/graph.py
python/mozbuild/mozbuild/analyze/hg.py
python/mozbuild/mozbuild/artifact_builds.py
python/mozbuild/mozbuild/backend/__init__.py
python/mozbuild/mozbuild/chunkify.py
python/mozbuild/mozbuild/codecoverage/chrome_map.py
python/mozbuild/mozbuild/codecoverage/lcov_rewriter.py
python/mozbuild/mozbuild/codecoverage/manifest_handler.py
python/mozbuild/mozbuild/compilation/database.py
python/mozbuild/mozbuild/compilation/util.py
python/mozbuild/mozbuild/export_telemetry_schema.py
python/mozbuild/mozbuild/gen_test_backend.py
python/mozbuild/mozbuild/generated_sources.py
python/mozbuild/mozbuild/gn_processor.py
python/mozbuild/mozbuild/preprocessor.py
python/mozbuild/mozbuild/repackaging/application_ini.py
python/mozbuild/mozbuild/repackaging/dmg.py
python/mozbuild/mozbuild/repackaging/installer.py
python/mozbuild/mozbuild/repackaging/mar.py
python/mozbuild/mozbuild/repackaging/msi.py
python/mozbuild/mozbuild/shellutil.py
python/mozbuild/mozbuild/test/action/test_buildlist.py
python/mozbuild/mozbuild/test/action/test_langpack_manifest.py
python/mozbuild/mozbuild/test/action/test_package_fennec_apk.py
python/mozbuild/mozbuild/test/action/test_process_install_manifest.py
python/mozbuild/mozbuild/test/analyze/test_graph.py
python/mozbuild/mozbuild/test/backend/common.py
python/mozbuild/mozbuild/test/backend/test_build.py
python/mozbuild/mozbuild/test/backend/test_configenvironment.py
python/mozbuild/mozbuild/test/backend/test_fastermake.py
python/mozbuild/mozbuild/test/backend/test_gn_processor.py
python/mozbuild/mozbuild/test/backend/test_partialconfigenvironment.py
python/mozbuild/mozbuild/test/backend/test_recursivemake.py
python/mozbuild/mozbuild/test/backend/test_test_manifest.py
python/mozbuild/mozbuild/test/backend/test_visualstudio.py
python/mozbuild/mozbuild/test/codecoverage/test_lcov_rewrite.py
python/mozbuild/mozbuild/test/common.py
python/mozbuild/mozbuild/test/compilation/test_warnings.py
python/mozbuild/mozbuild/test/controller/test_ccachestats.py
python/mozbuild/mozbuild/test/controller/test_clobber.py
python/mozbuild/mozbuild/test/frontend/test_context.py
python/mozbuild/mozbuild/test/frontend/test_emitter.py
python/mozbuild/mozbuild/test/frontend/test_namespaces.py
python/mozbuild/mozbuild/test/frontend/test_reader.py
python/mozbuild/mozbuild/test/frontend/test_sandbox.py
python/mozbuild/mozbuild/test/test_android_version_code.py
python/mozbuild/mozbuild/test/test_artifact_cache.py
python/mozbuild/mozbuild/test/test_base.py
python/mozbuild/mozbuild/test/test_containers.py
python/mozbuild/mozbuild/test/test_dotproperties.py
python/mozbuild/mozbuild/test/test_expression.py
python/mozbuild/mozbuild/test/test_jarmaker.py
python/mozbuild/mozbuild/test/test_licenses.py
python/mozbuild/mozbuild/test/test_line_endings.py
python/mozbuild/mozbuild/test/test_makeutil.py
python/mozbuild/mozbuild/test/test_manifest.py
python/mozbuild/mozbuild/test/test_mozconfig.py
python/mozbuild/mozbuild/test/test_mozinfo.py
python/mozbuild/mozbuild/test/test_preprocessor.py
python/mozbuild/mozbuild/test/test_pythonutil.py
python/mozbuild/mozbuild/test/test_util.py
python/mozbuild/mozpack/dmg.py
python/mozbuild/mozpack/test/support/minify_js_verify.py
python/mozbuild/mozpack/test/test_chrome_flags.py
python/mozbuild/mozpack/test/test_chrome_manifest.py
python/mozbuild/mozpack/test/test_copier.py
python/mozbuild/mozpack/test/test_errors.py
python/mozbuild/mozpack/test/test_files.py
python/mozbuild/mozpack/test/test_manifests.py
python/mozbuild/mozpack/test/test_mozjar.py
python/mozbuild/mozpack/test/test_packager.py
python/mozbuild/mozpack/test/test_packager_formats.py
python/mozbuild/mozpack/test/test_packager_l10n.py
python/mozbuild/mozpack/test/test_packager_unpack.py
python/mozbuild/mozpack/test/test_path.py
--- a/python/mozbuild/mozbuild/action/check_binary.py
+++ b/python/mozbuild/mozbuild/action/check_binary.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+from __future__ import absolute_import, print_function, unicode_literals
 
 import argparse
 import os
 import re
 import subprocess
 import sys
 
 from distutils.version import StrictVersion as Version
--- a/python/mozbuild/mozbuild/action/download_wpt_manifest.py
+++ b/python/mozbuild/mozbuild/action/download_wpt_manifest.py
@@ -1,14 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # This action is used to generate the wpt manifest
 
+from __future__ import absolute_import
+
 import sys
 
 import buildconfig
 
 
 def main():
     print("Downloading wpt manifest")
     sys.path.insert(0, buildconfig.topsrcdir)
--- a/python/mozbuild/mozbuild/action/dump_env.py
+++ b/python/mozbuild/mozbuild/action/dump_env.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 # We invoke a Python program to dump our environment in order to get
 # native paths printed on Windows so that these paths can be incorporated
 # into Python configure's environment.
 import os
 import sys
 
 sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
 
--- a/python/mozbuild/mozbuild/action/exe_7z_archive.py
+++ b/python/mozbuild/mozbuild/action/exe_7z_archive.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 import os
 import shutil
 import sys
 import subprocess
 import tempfile
 import mozpack.path as mozpath
 import buildconfig
--- a/python/mozbuild/mozbuild/action/exe_7z_extract.py
+++ b/python/mozbuild/mozbuild/action/exe_7z_extract.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 import shutil
 import sys
 import subprocess
 
 
 def extract_exe(package, target):
     subprocess.check_call(['7z', 'x', package, 'core'])
--- a/python/mozbuild/mozbuild/action/generate_searchjson.py
+++ b/python/mozbuild/mozbuild/action/generate_searchjson.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import sys
 import json
 import copy
 
 engines = []
 
 locale = sys.argv[2]
 output_file = sys.argv[3]
--- a/python/mozbuild/mozbuild/action/make_dmg.py
+++ b/python/mozbuild/mozbuild/action/make_dmg.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from mozpack import dmg
 
 import argparse
 import sys
 
 
 def main(args):
--- a/python/mozbuild/mozbuild/action/make_unzip.py
+++ b/python/mozbuild/mozbuild/action/make_unzip.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 import sys
 import subprocess
 
 
 def make_unzip(package):
     subprocess.check_call(['unzip', package])
 
--- a/python/mozbuild/mozbuild/action/make_zip.py
+++ b/python/mozbuild/mozbuild/action/make_zip.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 import sys
 import subprocess
 
 
 def make_zip(source, package):
     subprocess.check_call(['zip', '-r9D', package, source, '-x', '\*/.mkdir.done'])
 
--- a/python/mozbuild/mozbuild/action/output_searchplugins_list.py
+++ b/python/mozbuild/mozbuild/action/output_searchplugins_list.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import sys
 import json
 
 engines = []
 
 locale = sys.argv[2]
 
 with open(sys.argv[1]) as f:
--- a/python/mozbuild/mozbuild/action/tooltool.py
+++ b/python/mozbuild/mozbuild/action/tooltool.py
@@ -12,16 +12,18 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301, USA.
 
+from __future__ import absolute_import
+
 # A manifest file specifies files in that directory that are stored
 # elsewhere. This file should only list files in the same directory
 # in which the manifest file resides and it should be called
 # 'manifest.tt'
 
 from __future__ import print_function
 
 import base64
--- a/python/mozbuild/mozbuild/action/unpack_dmg.py
+++ b/python/mozbuild/mozbuild/action/unpack_dmg.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from mozpack import dmg
 
 import argparse
 import sys
 
 
 def main(args):
--- a/python/mozbuild/mozbuild/analyze/graph.py
+++ b/python/mozbuild/mozbuild/analyze/graph.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import os
 import sqlite3 as lite
 
 
 class Node(object):
 
     def __init__(self, graph, node_id):
         sql_result = graph.query_arg('SELECT id, dir, type, mtime, name \
--- a/python/mozbuild/mozbuild/analyze/hg.py
+++ b/python/mozbuild/mozbuild/analyze/hg.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import bisect
 import gzip
 import json
 import math
 import requests
 
 from datetime import datetime, timedelta
 from collections import Counter
--- a/python/mozbuild/mozbuild/artifact_builds.py
+++ b/python/mozbuild/mozbuild/artifact_builds.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 # The values correspond to entries at
 # https://tools.taskcluster.net/index/artifacts/#gecko.v2.mozilla-central.latest/gecko.v2.mozilla-central.latest
 JOB_CHOICES = {
     'android-api-16-opt',
     'android-api-16-debug',
     'android-x86-opt',
     'android-x86_64-opt',
     'android-x86_64-debug',
--- a/python/mozbuild/mozbuild/backend/__init__.py
+++ b/python/mozbuild/mozbuild/backend/__init__.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 backends = {
     'ChromeMap': 'mozbuild.codecoverage.chrome_map',
     'CompileDB': 'mozbuild.compilation.database',
     'CppEclipse': 'mozbuild.backend.cpp_eclipse',
     'FasterMake': 'mozbuild.backend.fastermake',
     'FasterMake+RecursiveMake': None,
     'GnConfigGen': 'mozbuild.gn_processor',
     'GnMozbuildWriter': 'mozbuild.gn_processor',
--- a/python/mozbuild/mozbuild/chunkify.py
+++ b/python/mozbuild/mozbuild/chunkify.py
@@ -2,16 +2,18 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # This file is a direct clone of
 # https://github.com/bhearsum/chunkify/blob/master/chunkify/__init__.py
 # of version 1.2. Its license (MPL2) is contained in repo root LICENSE file.
 # Please make modifications there where possible.
 
+from __future__ import absolute_import
+
 from itertools import islice
 
 
 class ChunkingError(Exception):
     pass
 
 
 def split_evenly(n, chunks):
--- a/python/mozbuild/mozbuild/codecoverage/chrome_map.py
+++ b/python/mozbuild/mozbuild/codecoverage/chrome_map.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import json
 import os
 import re
 
 from mach.config import ConfigSettings
 from mach.logging import LoggingManager
 from mozbuild.backend.common import CommonBackend
 from mozbuild.base import MozbuildObject
@@ -15,17 +17,17 @@ from mozbuild.frontend.data import (
     FinalTargetPreprocessedFiles,
 )
 from mozbuild.frontend.data import JARManifest, ChromeManifestEntry
 from mozpack.copier import FileRegistry
 from mozpack.files import PreprocessedFile
 from mozpack.manifests import InstallManifest
 import mozpack.path as mozpath
 
-from manifest_handler import ChromeManifestHandler
+from .manifest_handler import ChromeManifestHandler
 
 
 _line_comment_re = re.compile('^//@line (\d+) "(.+)"$')
 
 
 def generate_pp_info(path, topsrcdir):
     with open(path) as fh:
         # (start, end) -> (included_source, start)
--- a/python/mozbuild/mozbuild/codecoverage/lcov_rewriter.py
+++ b/python/mozbuild/mozbuild/codecoverage/lcov_rewriter.py
@@ -1,26 +1,28 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 from argparse import ArgumentParser
 import json
 import os
 
 try:
     import urlparse
 except ImportError:
     import urllib.parse as urlparse
 
 from six import viewitems
 
 from mozpack.chrome.manifest import parse_manifest
 import mozpack.path as mozpath
-from manifest_handler import ChromeManifestHandler
+from .manifest_handler import ChromeManifestHandler
 
 
 class LcovRecord(object):
     __slots__ = ("test_name",
                  "source_file",
                  "functions",
                  "function_exec_counts",
                  "function_count",
--- a/python/mozbuild/mozbuild/codecoverage/manifest_handler.py
+++ b/python/mozbuild/mozbuild/codecoverage/manifest_handler.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 from collections import defaultdict
 
 try:
     import urlparse
 except ImportError:
     import urllib.parse as urlparse
 
 from mozpack.chrome.manifest import (
--- a/python/mozbuild/mozbuild/compilation/database.py
+++ b/python/mozbuild/mozbuild/compilation/database.py
@@ -1,14 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # This modules provides functionality for dealing with code completion.
 
+from __future__ import absolute_import
+
 import os
 import types
 
 from mozbuild.backend.common import CommonBackend
 from mozbuild.frontend.data import (
     ComputedFlags,
     Sources,
     GeneratedSources,
--- a/python/mozbuild/mozbuild/compilation/util.py
+++ b/python/mozbuild/mozbuild/compilation/util.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import os
 
 
 def check_top_objdir(topobjdir):
     top_make = os.path.join(topobjdir, 'Makefile')
     if not os.path.exists(top_make):
         print('Your tree has not been built yet. Please run '
               '|mach build| with no arguments.')
--- a/python/mozbuild/mozbuild/export_telemetry_schema.py
+++ b/python/mozbuild/mozbuild/export_telemetry_schema.py
@@ -1,11 +1,11 @@
 #!/usr/bin/env python
 
-from __future__ import print_function, unicode_literals
+from __future__ import absolute_import, print_function, unicode_literals
 
 """
 This script converts the build system telemetry schema from voluptuous format to json-schema.
 You should run it with `mach python`.
 """
 
 import argparse
 from mozbuild.base import MozbuildObject
--- a/python/mozbuild/mozbuild/gen_test_backend.py
+++ b/python/mozbuild/mozbuild/gen_test_backend.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import sys
 
 from mozbuild.backend.test_manifest import TestManifestBackend
 from mozbuild.base import BuildEnvironmentNotFoundException, MozbuildObject
 from mozbuild.frontend.emitter import TreeMetadataEmitter
 from mozbuild.frontend.reader import BuildReader, EmptyConfig
 import mozpack.path as mozpath
 
--- a/python/mozbuild/mozbuild/generated_sources.py
+++ b/python/mozbuild/mozbuild/generated_sources.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import hashlib
 import json
 import os
 
 from mozpack.files import FileFinder
 import mozpack.path as mozpath
 
 
--- a/python/mozbuild/mozbuild/gn_processor.py
+++ b/python/mozbuild/mozbuild/gn_processor.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 
 from collections import defaultdict
 from copy import deepcopy
 import glob
 import json
 import os
 import subprocess
 import sys
--- a/python/mozbuild/mozbuild/preprocessor.py
+++ b/python/mozbuild/mozbuild/preprocessor.py
@@ -17,22 +17,24 @@ test:
 unary :
   '!'? value ;
 value :
   [0-9]+ # integer
   | 'defined(' \w+ ')'
   | \w+  # string identifier or value;
 """
 
+from __future__ import absolute_import
+
 import sys
 import os
 import re
 from optparse import OptionParser
 import errno
-from makeutil import Makefile
+from mozbuild.makeutil import Makefile
 
 # hack around win32 mangling our line endings
 # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65443
 if sys.platform == "win32":
     import msvcrt
     msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
     os.linesep = '\n'
 
@@ -490,21 +492,16 @@ class Preprocessor:
             args = [sys.stdin]
             if options.depend:
                 raise Preprocessor.Error(self, "--depend doesn't work with stdin",
                                          None)
         if options.depend:
             if not options.output:
                 raise Preprocessor.Error(self, "--depend doesn't work with stdout",
                                          None)
-            try:
-                from makeutil import Makefile
-            except Exception:
-                raise Preprocessor.Error(self, "--depend requires the "
-                                               "mozbuild.makeutil module", None)
             depfile = get_output_file(options.depend)
 
         if args:
             for f in args:
                 with open(f, 'rU') as input:
                     self.processFile(input=input, output=out)
             if depfile:
                 mk = Makefile()
--- a/python/mozbuild/mozbuild/repackaging/application_ini.py
+++ b/python/mozbuild/mozbuild/repackaging/application_ini.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import os
 import ConfigParser
 import mozpack.path as mozpath
 
 
 def get_application_ini_value(application_directory, section, value,
                               fallback=None):
     rc = None
--- a/python/mozbuild/mozbuild/repackaging/dmg.py
+++ b/python/mozbuild/mozbuild/repackaging/dmg.py
@@ -1,20 +1,22 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import errno
 import os
 import tempfile
 import tarfile
 import shutil
 import mozpack.path as mozpath
 from mozpack.dmg import create_dmg
-from application_ini import get_application_ini_value
+from mozbuild.repackaging.application_ini import get_application_ini_value
 
 
 def repackage_dmg(infile, output):
 
     if not tarfile.is_tarfile(infile):
         raise Exception("Input file %s is not a valid tarfile." % infile)
 
     tmpdir = tempfile.mkdtemp()
--- a/python/mozbuild/mozbuild/repackaging/installer.py
+++ b/python/mozbuild/mozbuild/repackaging/installer.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import os
 import tempfile
 import shutil
 import zipfile
 import mozpack.path as mozpath
 from mozbuild.action.exe_7z_archive import archive_exe
 from mozbuild.util import ensureParentDir
 
--- a/python/mozbuild/mozbuild/repackaging/mar.py
+++ b/python/mozbuild/mozbuild/repackaging/mar.py
@@ -1,21 +1,23 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import os
 import sys
 import tempfile
 import shutil
 import zipfile
 import tarfile
 import subprocess
 import mozpack.path as mozpath
-from application_ini import get_application_ini_value
+from mozbuild.repackaging.application_ini import get_application_ini_value
 from mozbuild.util import ensureParentDir
 
 
 _BCJ_OPTIONS = {
     'x86': ['--x86'],
     'x86_64': ['--x86'],
     'aarch64': [],
 }
--- a/python/mozbuild/mozbuild/repackaging/msi.py
+++ b/python/mozbuild/mozbuild/repackaging/msi.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import os
 import tempfile
 import shutil
 import mozpack.path as mozpath
 import sys
 import subprocess
 from xml.dom import minidom
 from mozbuild.util import ensureParentDir
--- a/python/mozbuild/mozbuild/shellutil.py
+++ b/python/mozbuild/mozbuild/shellutil.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import re
 
 
 def _tokens2re(**tokens):
     # Create a pattern for non-escaped tokens, in the form:
     #   (?<!\\)(?:a|b|c...)
     # This is meant to match patterns a, b, or c, or ... if they are not
     # preceded by a backslash.
--- a/python/mozbuild/mozbuild/test/action/test_buildlist.py
+++ b/python/mozbuild/mozbuild/test/action/test_buildlist.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import unittest
 
 import os
 import os.path
 from tempfile import mkdtemp
 from shutil import rmtree
 import mozunit
 
--- a/python/mozbuild/mozbuild/test/action/test_langpack_manifest.py
+++ b/python/mozbuild/mozbuild/test/action/test_langpack_manifest.py
@@ -1,13 +1,15 @@
 # -*- coding: utf-8 -*-
 
 # Any copyright is dedicated to the Public Domain.
 # http://creativecommons.org/publicdomain/zero/1.0/
 
+from __future__ import absolute_import
+
 import unittest
 import json
 
 import mozunit
 
 import mozbuild.action.langpack_manifest as langpack_manifest
 from mozbuild.preprocessor import Context
 
--- a/python/mozbuild/mozbuild/test/action/test_package_fennec_apk.py
+++ b/python/mozbuild/mozbuild/test/action/test_package_fennec_apk.py
@@ -1,14 +1,14 @@
 # -*- coding: utf-8 -*-
 
 # Any copyright is dedicated to the Public Domain.
 # http://creativecommons.org/publicdomain/zero/1.0/
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import os
 import unittest
 
 import mozunit
 
 from mozbuild.action.package_fennec_apk import (
     package_fennec_apk as package,
--- a/python/mozbuild/mozbuild/test/action/test_process_install_manifest.py
+++ b/python/mozbuild/mozbuild/test/action/test_process_install_manifest.py
@@ -1,13 +1,15 @@
 # -*- coding: utf-8 -*-
 
 # Any copyright is dedicated to the Public Domain.
 # http://creativecommons.org/publicdomain/zero/1.0/
 
+from __future__ import absolute_import
+
 import os
 
 import mozunit
 
 from mozpack.manifests import (
     InstallManifest,
 )
 from mozpack.test.test_files import TestWithTmpDir
--- a/python/mozbuild/mozbuild/test/analyze/test_graph.py
+++ b/python/mozbuild/mozbuild/test/analyze/test_graph.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import unittest
 import sqlite3 as lite
 import mozunit
 
 from mozbuild.analyze.graph import Graph
 
 CREATE_NODE = """CREATE TABLE node
         (id integer PRIMARY KEY NOT NULL,
--- a/python/mozbuild/mozbuild/test/backend/common.py
+++ b/python/mozbuild/mozbuild/test/backend/common.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import os
 import unittest
 
 from collections import defaultdict
 from shutil import rmtree
 from tempfile import mkdtemp
 
--- a/python/mozbuild/mozbuild/test/backend/test_build.py
+++ b/python/mozbuild/mozbuild/test/backend/test_build.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals, print_function
+from __future__ import absolute_import, unicode_literals, print_function
 
 import buildconfig
 import os
 import shutil
 import sys
 import unittest
 import mozpack.path as mozpath
 from contextlib import contextmanager
--- a/python/mozbuild/mozbuild/test/backend/test_configenvironment.py
+++ b/python/mozbuild/mozbuild/test/backend/test_configenvironment.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import os
 import unittest
 from mozunit import main
 
 import mozbuild.backend.configenvironment as ConfigStatus
 
 from mozbuild.util import ReadOnlyDict
 
--- a/python/mozbuild/mozbuild/test/backend/test_fastermake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_fastermake.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import os
 
 from mozpack.copier import FileRegistry
 from mozpack.manifests import InstallManifest
 from mozunit import main
 
 from mozbuild.backend.fastermake import FasterMakeBackend
--- a/python/mozbuild/mozbuild/test/backend/test_gn_processor.py
+++ b/python/mozbuild/mozbuild/test/backend/test_gn_processor.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import os
 import shutil
 import tempfile
 import unittest
 
 from copy import deepcopy
 
--- a/python/mozbuild/mozbuild/test/backend/test_partialconfigenvironment.py
+++ b/python/mozbuild/mozbuild/test/backend/test_partialconfigenvironment.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import buildconfig
 import os
 import unittest
 from mozunit import main
 from tempfile import mkdtemp
 from shutil import rmtree
 
 import mozpack.path as mozpath
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import cPickle as pickle
 import os
 import unittest
 
 from mozpack.manifests import (
     InstallManifest,
 )
--- a/python/mozbuild/mozbuild/test/backend/test_test_manifest.py
+++ b/python/mozbuild/mozbuild/test/backend/test_test_manifest.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import cPickle as pickle
 import os
 
 import mozpack.path as mozpath
 from mozunit import main
 
 from mozbuild.backend.test_manifest import TestManifestBackend
--- a/python/mozbuild/mozbuild/test/backend/test_visualstudio.py
+++ b/python/mozbuild/mozbuild/test/backend/test_visualstudio.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 from xml.dom.minidom import parse
 import os
 import unittest
 
 from mozbuild.backend.visualstudio import VisualStudioBackend
 from mozbuild.test.backend.common import BackendTester
 
--- a/python/mozbuild/mozbuild/test/codecoverage/test_lcov_rewrite.py
+++ b/python/mozbuild/mozbuild/test/codecoverage/test_lcov_rewrite.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import os
 import unittest
 import shutil
 from StringIO import StringIO
 import json
 from tempfile import NamedTemporaryFile
 
 from mozbuild.codecoverage import chrome_map
--- a/python/mozbuild/mozbuild/test/common.py
+++ b/python/mozbuild/mozbuild/test/common.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import errno
 import os
 import shutil
 
 from buildconfig import topsrcdir
 
 from mach.logging import LoggingManager
--- a/python/mozbuild/mozbuild/test/compilation/test_warnings.py
+++ b/python/mozbuild/mozbuild/test/compilation/test_warnings.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import os
 import unittest
 
 from mozfile.mozfile import NamedTemporaryFile
 
 from mozbuild.compilation.warnings import CompilerWarning
 from mozbuild.compilation.warnings import WarningsCollector
 from mozbuild.compilation.warnings import WarningsDatabase
--- a/python/mozbuild/mozbuild/test/controller/test_ccachestats.py
+++ b/python/mozbuild/mozbuild/test/controller/test_ccachestats.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import time
 import unittest
 
 from mozunit import main
 
 from mozbuild.controller.building import CCacheStats
 
--- a/python/mozbuild/mozbuild/test/controller/test_clobber.py
+++ b/python/mozbuild/mozbuild/test/controller/test_clobber.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import os
 import shutil
 import tempfile
 import unittest
 
 from mozunit import main
 
--- a/python/mozbuild/mozbuild/test/frontend/test_context.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_context.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import os
 import unittest
 
 from mozunit import main
 
 from mozbuild.frontend.context import (
     AbsolutePath,
     Context,
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import os
 import unittest
 
 from mozunit import main
 
 from mozbuild.frontend.context import (
     ObjDirPath,
--- a/python/mozbuild/mozbuild/test/frontend/test_namespaces.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_namespaces.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import unittest
 
 from mozunit import main
 
 from mozbuild.frontend.context import (
     Context,
     ContextDerivedValue,
--- a/python/mozbuild/mozbuild/test/frontend/test_reader.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_reader.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import os
 import sys
 import unittest
 
 from mozunit import main
 
 from mozbuild import schedules
--- a/python/mozbuild/mozbuild/test/frontend/test_sandbox.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_sandbox.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import unittest
 
 from mozunit import main
 
 from mozbuild.frontend.reader import (
     MozbuildSandbox,
     SandboxCalledError,
--- a/python/mozbuild/mozbuild/test/test_android_version_code.py
+++ b/python/mozbuild/mozbuild/test/test_android_version_code.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 from mozunit import main
 import unittest
 
 from mozbuild.android_version_code import (
     android_version_code_v0,
     android_version_code_v1,
 )
 
--- a/python/mozbuild/mozbuild/test/test_artifact_cache.py
+++ b/python/mozbuild/mozbuild/test/test_artifact_cache.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import os
 import mozunit
 import time
 import unittest
 from tempfile import mkdtemp
 from shutil import rmtree
 
--- a/python/mozbuild/mozbuild/test/test_base.py
+++ b/python/mozbuild/mozbuild/test/test_base.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import json
 import os
 import shutil
 import subprocess
 import sys
 import tempfile
 import unittest
--- a/python/mozbuild/mozbuild/test/test_containers.py
+++ b/python/mozbuild/mozbuild/test/test_containers.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import unittest
 
 from mozunit import main
 
 from mozbuild.util import (
     KeyedDefaultDict,
     List,
     OrderedDefaultDict,
--- a/python/mozbuild/mozbuild/test/test_dotproperties.py
+++ b/python/mozbuild/mozbuild/test/test_dotproperties.py
@@ -1,11 +1,11 @@
 # -*- coding: utf-8 -*-
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import os
 import unittest
 
 from StringIO import StringIO
 
 import mozpack.path as mozpath
 
--- a/python/mozbuild/mozbuild/test/test_expression.py
+++ b/python/mozbuild/mozbuild/test/test_expression.py
@@ -1,8 +1,10 @@
+from __future__ import absolute_import
+
 import unittest
 
 import mozunit
 
 from mozbuild.preprocessor import Expression, Context
 
 
 class TestContext(unittest.TestCase):
--- a/python/mozbuild/mozbuild/test/test_jarmaker.py
+++ b/python/mozbuild/mozbuild/test/test_jarmaker.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 import unittest
 
 import os
 import sys
 import os.path
 from filecmp import dircmp
 from tempfile import mkdtemp
 from shutil import rmtree, copy2
--- a/python/mozbuild/mozbuild/test/test_licenses.py
+++ b/python/mozbuild/mozbuild/test/test_licenses.py
@@ -1,8 +1,10 @@
+from __future__ import absolute_import
+
 import unittest
 
 import mozunit
 
 from mozbuild.vendor_rust import VendorRust
 
 
 class TestLicenses(unittest.TestCase):
--- a/python/mozbuild/mozbuild/test/test_line_endings.py
+++ b/python/mozbuild/mozbuild/test/test_line_endings.py
@@ -1,8 +1,10 @@
+from __future__ import absolute_import
+
 import unittest
 
 from StringIO import StringIO
 import os
 import os.path
 import mozunit
 
 from mozbuild.preprocessor import Preprocessor
--- a/python/mozbuild/mozbuild/test/test_makeutil.py
+++ b/python/mozbuild/mozbuild/test/test_makeutil.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 from mozbuild.makeutil import (
     Makefile,
     read_dep_makefile,
     Rule,
     write_dep_makefile,
 )
 from mozunit import main
 import os
--- a/python/mozbuild/mozbuild/test/test_manifest.py
+++ b/python/mozbuild/mozbuild/test/test_manifest.py
@@ -1,14 +1,14 @@
 # coding: utf-8
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import unittest
 
 import mozfile
 from mozbuild.moz_yaml import load_moz_yaml, VerifyError
 from nose.tools import raises
 
 
--- a/python/mozbuild/mozbuild/test/test_mozconfig.py
+++ b/python/mozbuild/mozbuild/test/test_mozconfig.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import os
 import unittest
 
 from shutil import rmtree
 
 from tempfile import (
     gettempdir,
--- a/python/mozbuild/mozbuild/test/test_mozinfo.py
+++ b/python/mozbuild/mozbuild/test/test_mozinfo.py
@@ -1,13 +1,15 @@
 #!/usr/bin/env python
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import json
 import os
 import tempfile
 import unittest
 
 from StringIO import StringIO
 
 import mozunit
--- a/python/mozbuild/mozbuild/test/test_preprocessor.py
+++ b/python/mozbuild/mozbuild/test/test_preprocessor.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import unittest
 
 from StringIO import StringIO
 import os
 import shutil
 
 from tempfile import mkdtemp
 
--- a/python/mozbuild/mozbuild/test/test_pythonutil.py
+++ b/python/mozbuild/mozbuild/test/test_pythonutil.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 from mozbuild.pythonutil import iter_modules_in_path
 from mozunit import main
 import os
 
 
 def test_iter_modules_in_path():
     tests_path = os.path.normcase(os.path.dirname(__file__))
     paths = list(iter_modules_in_path(tests_path))
--- a/python/mozbuild/mozbuild/test/test_util.py
+++ b/python/mozbuild/mozbuild/test/test_util.py
@@ -1,14 +1,14 @@
 # coding: utf-8
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import itertools
 import hashlib
 import os
 import unittest
 import shutil
 import string
 import sys
--- a/python/mozbuild/mozpack/dmg.py
+++ b/python/mozbuild/mozpack/dmg.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import buildconfig
 import errno
 import mozfile
 import os
 import platform
 import shutil
 import subprocess
 
--- a/python/mozbuild/mozpack/test/support/minify_js_verify.py
+++ b/python/mozbuild/mozpack/test/support/minify_js_verify.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 import sys
 
 
 if len(sys.argv) != 4:
     raise Exception('Usage: minify_js_verify <exitcode> <orig> <minified>')
 
 retcode = int(sys.argv[1])
 
--- a/python/mozbuild/mozpack/test/test_chrome_flags.py
+++ b/python/mozbuild/mozpack/test/test_chrome_flags.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import unittest
 import mozunit
 from mozpack.chrome.flags import (
     Flag,
     StringFlag,
     VersionFlag,
     Flags,
 )
--- a/python/mozbuild/mozpack/test/test_chrome_manifest.py
+++ b/python/mozbuild/mozpack/test/test_chrome_manifest.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import unittest
 import mozunit
 import os
 from mozpack.chrome.manifest import (
     ManifestContent,
     ManifestLocale,
     ManifestSkin,
     Manifest,
--- a/python/mozbuild/mozpack/test/test_copier.py
+++ b/python/mozbuild/mozpack/test/test_copier.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 from mozpack.copier import (
     FileCopier,
     FileRegistry,
     FileRegistrySubtree,
     Jarrer,
 )
 from mozpack.files import (
     GeneratedFile,
--- a/python/mozbuild/mozpack/test/test_errors.py
+++ b/python/mozbuild/mozpack/test/test_errors.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 from mozpack.errors import (
     errors,
     ErrorMessage,
     AccumulatedErrors,
 )
 import unittest
 import mozunit
 import sys
--- a/python/mozbuild/mozpack/test/test_files.py
+++ b/python/mozbuild/mozpack/test/test_files.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 from mozbuild.util import ensureParentDir
 
 from mozpack.errors import (
     ErrorMessage,
     errors,
 )
 from mozpack.files import (
     AbsoluteSymlinkFile,
--- a/python/mozbuild/mozpack/test/test_manifests.py
+++ b/python/mozbuild/mozpack/test/test_manifests.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
 
 import os
 
 import mozunit
 
 from mozpack.copier import (
     FileCopier,
     FileRegistry,
--- a/python/mozbuild/mozpack/test/test_mozjar.py
+++ b/python/mozbuild/mozpack/test/test_mozjar.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 from mozpack.files import FileFinder
 from mozpack.mozjar import (
     JarReaderError,
     JarWriterError,
     JarStruct,
     JarReader,
     JarWriter,
     Deflater,
--- a/python/mozbuild/mozpack/test/test_packager.py
+++ b/python/mozbuild/mozpack/test/test_packager.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import unittest
 import mozunit
 import os
 from buildconfig import topobjdir
 from mozpack.packager import (
     preprocess_manifest,
     CallDeque,
     Component,
--- a/python/mozbuild/mozpack/test/test_packager_formats.py
+++ b/python/mozbuild/mozpack/test/test_packager_formats.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import mozunit
 import unittest
 from mozpack.packager.formats import (
     FlatFormatter,
     JarFormatter,
     OmniJarFormatter,
 )
 from mozpack.copier import FileRegistry
--- a/python/mozbuild/mozpack/test/test_packager_l10n.py
+++ b/python/mozbuild/mozpack/test/test_packager_l10n.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import unittest
 import mozunit
 from test_packager import MockFinder
 from mozpack.packager import l10n
 from mozpack.files import (
     GeneratedFile,
     ManifestFile,
 )
--- a/python/mozbuild/mozpack/test/test_packager_unpack.py
+++ b/python/mozbuild/mozpack/test/test_packager_unpack.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 import mozunit
 from mozpack.packager.formats import (
     FlatFormatter,
     JarFormatter,
     OmniJarFormatter,
 )
 from mozpack.packager.unpack import unpack_to_registry
 from mozpack.copier import (
--- a/python/mozbuild/mozpack/test/test_path.py
+++ b/python/mozbuild/mozpack/test/test_path.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from __future__ import absolute_import
+
 from mozpack.path import (
     relpath,
     join,
     normpath,
     dirname,
     commonprefix,
     basename,
     split,