Bug 1176642 - Use absolute_import in mach_commands.py files; r=glandium
authorGregory Szorc <gps@mozilla.com>
Sun, 21 Jun 2015 17:39:09 -0700
changeset 280973 c8cedeb555cd8b3b084a1c3dad3a5e450e52f6e1
parent 280972 b6ab3b5ac90c920282b8eb13abb0180a9a66a667
child 280974 c2e532dc8fd097c948968470ca1bb3e6ae1d2c31
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1176642
milestone41.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 1176642 - Use absolute_import in mach_commands.py files; r=glandium This removes ambiguity as to which modules are being imported, making import slightly faster as Python doesn't need to test so many directories for file presence. All files should already be using absolute imports because mach command modules aren't imported to the package they belong to: they instead belong to the "mach" package. So relative imports shouldn't have been used.
addon-sdk/mach_commands.py
build/valgrind/mach_commands.py
dom/bindings/mach_commands.py
layout/tools/reftest/mach_commands.py
mobile/android/mach_commands.py
python/compare-locales/mach_commands.py
python/mach_commands.py
python/mozboot/mozboot/mach_commands.py
python/mozbuild/mozbuild/backend/mach_commands.py
python/mozbuild/mozbuild/compilation/codecomplete.py
python/mozbuild/mozbuild/frontend/mach_commands.py
python/mozbuild/mozbuild/mach_commands.py
services/common/tests/mach_commands.py
testing/luciddream/mach_commands.py
testing/mach_commands.py
testing/marionette/mach_commands.py
testing/mochitest/mach_commands.py
testing/talos/mach_commands.py
testing/taskcluster/mach_commands.py
testing/web-platform/mach_commands.py
testing/xpcshell/mach_commands.py
tools/docs/mach_commands.py
tools/mach_commands.py
tools/mercurial/mach_commands.py
--- a/addon-sdk/mach_commands.py
+++ b/addon-sdk/mach_commands.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/.
 
 # Integrates the xpcshell test runner with mach.
 
+from __future__ import absolute_import
+
 import os
 
 import mozpack.path as mozpath
 
 from mozbuild.base import (
     MachCommandBase,
     MozbuildObject,
 )
--- a/build/valgrind/mach_commands.py
+++ b/build/valgrind/mach_commands.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 os
 import subprocess
 
 from mach.decorators import (
     Command,
     CommandArgument,
     CommandProvider,
--- a/dom/bindings/mach_commands.py
+++ b/dom/bindings/mach_commands.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
 
 from mach.decorators import (
     CommandArgument,
     CommandProvider,
     Command,
--- a/layout/tools/reftest/mach_commands.py
+++ b/layout/tools/reftest/mach_commands.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 mozpack.path as mozpath
 import os
 import re
 import sys
 import warnings
 import which
 
--- a/mobile/android/mach_commands.py
+++ b/mobile/android/mach_commands.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 logging
 import os
 
 import mozpack.path as mozpath
 
 from mozbuild.base import (
--- a/python/compare-locales/mach_commands.py
+++ b/python/compare-locales/mach_commands.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
 
 from mach.decorators import (
     CommandArgument,
     CommandProvider,
     Command,
 )
 
 from mozbuild.base import (
--- a/python/mach_commands.py
+++ b/python/mach_commands.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 glob
 import logging
 import mozpack.path as mozpath
 import os
 
 from mozbuild.base import (
--- a/python/mozboot/mozboot/mach_commands.py
+++ b/python/mozboot/mozboot/mach_commands.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 mach.decorators import (
     CommandProvider,
     Command,
 )
 
 
 @CommandProvider
--- a/python/mozbuild/mozbuild/backend/mach_commands.py
+++ b/python/mozbuild/mozbuild/backend/mach_commands.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 sys
 import subprocess
 import which
 
 from mozbuild.backend.cpp_eclipse import CppEclipseBackend
--- a/python/mozbuild/mozbuild/compilation/codecomplete.py
+++ b/python/mozbuild/mozbuild/compilation/codecomplete.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
 
 from mach.decorators import (
     CommandArgument,
     CommandProvider,
     Command,
 )
 
--- a/python/mozbuild/mozbuild/frontend/mach_commands.py
+++ b/python/mozbuild/mozbuild/frontend/mach_commands.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
 
 from collections import defaultdict
 import os
 
 from mach.decorators import (
     CommandArgument,
     CommandProvider,
     Command,
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.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 json
 import logging
 import operator
 import os
 import subprocess
 import sys
--- a/services/common/tests/mach_commands.py
+++ b/services/common/tests/mach_commands.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 mozpack.path as mozpath
 
 from mozbuild.base import (
     MachCommandBase,
 )
 
 from mach.decorators import (
--- a/testing/luciddream/mach_commands.py
+++ b/testing/luciddream/mach_commands.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/.
 
 # Integrates luciddream test runner with mach.
 
+from __future__ import absolute_import
+
 import os
 
 from mozbuild.base import (
     MachCommandBase,
     MachCommandConditions as conditions,
     MozbuildObject,
 )
 
--- a/testing/mach_commands.py
+++ b/testing/mach_commands.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 os
 import pprint
 import sys
 
 from mach.decorators import (
     CommandArgument,
     CommandProvider,
--- a/testing/marionette/mach_commands.py
+++ b/testing/marionette/mach_commands.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 argparse
 
 from mozlog.structured import commandline
 
 from mozbuild.base import (
--- a/testing/mochitest/mach_commands.py
+++ b/testing/mochitest/mach_commands.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 argparse import Namespace
 from collections import defaultdict
 from itertools import chain
 import logging
 import os
 import shutil
 import sys
--- a/testing/talos/mach_commands.py
+++ b/testing/talos/mach_commands.py
@@ -1,15 +1,15 @@
 # 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/.
 
 # Integrates Talos mozharness with mach
 
-from __future__ import print_function, unicode_literals
+from __future__ import absolute_import, print_function, unicode_literals
 
 import os
 import sys
 import json
 import which
 import socket
 
 from mozbuild.base import (
--- a/testing/taskcluster/mach_commands.py
+++ b/testing/taskcluster/mach_commands.py
@@ -1,14 +1,16 @@
 # -*- 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 absolute_import
+
 import os
 import json
 import copy
 import sys
 import urllib2
 
 from mach.decorators import (
     CommandArgument,
--- a/testing/web-platform/mach_commands.py
+++ b/testing/web-platform/mach_commands.py
@@ -1,15 +1,15 @@
 # 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/.
 
 # Integrates the web-platform-tests test runner with mach.
 
-from __future__ import unicode_literals, print_function
+from __future__ import absolute_import, unicode_literals, print_function
 
 import os
 import sys
 
 from mozbuild.base import (
     MachCommandBase,
     MachCommandConditions as conditions,
     MozbuildObject,
--- a/testing/xpcshell/mach_commands.py
+++ b/testing/xpcshell/mach_commands.py
@@ -1,15 +1,15 @@
 # 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/.
 
 # Integrates the xpcshell test runner with mach.
 
-from __future__ import unicode_literals, print_function
+from __future__ import absolute_import, unicode_literals, print_function
 
 import argparse
 import os
 import shutil
 import sys
 import urllib2
 
 from mozlog import structured
--- a/tools/docs/mach_commands.py
+++ b/tools/docs/mach_commands.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 mach.decorators import (
     CommandArgument,
     CommandProvider,
     Command,
 )
--- a/tools/mach_commands.py
+++ b/tools/mach_commands.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 sys
 import os
 import stat
 import platform
 import urllib2
 import errno
 
--- a/tools/mercurial/mach_commands.py
+++ b/tools/mercurial/mach_commands.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 os
 import sys
 
 from mach.decorators import (
     CommandProvider,
     CommandArgument,
     Command,