Bug 1396582 - Remove __main__ from mozbuild.virtualenv; r=nalexander
☠☠ backed out by 79a6260e52a7 ☠ ☠
authorGregory Szorc <gps@mozilla.com>
Mon, 08 Jan 2018 15:49:16 -0800
changeset 450222 a677efcd8768ff23c2b65aaeb9c680a10d3afeb8
parent 450221 4e81669959ed07c897875b88b93036ced6363848
child 450223 ab39d818d7b73dea685bdf71e1c0fb4f5a47b710
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1396582
milestone59.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 1396582 - Remove __main__ from mozbuild.virtualenv; r=nalexander I'm pretty certain nobody relies on this any more. The original use of this code was to support virtualenv creation in configure. Now that configure is written in Python and that Python code calls out to the VirtualenManager API directly, this wrapping code isn't used. MozReview-Commit-ID: Cii1GjVOGaA
python/mozbuild/mozbuild/virtualenv.py
--- a/python/mozbuild/mozbuild/virtualenv.py
+++ b/python/mozbuild/mozbuild/virtualenv.py
@@ -500,31 +500,8 @@ class VirtualenvManager(object):
         # the current Python interpreter may not be the virtualenv python.
         # This will confuse pip and cause the package to attempt to install
         # against the executing interpreter. By creating a new process, we
         # force the virtualenv's interpreter to be used and all is well.
         # It /might/ be possible to cheat and set sys.executable to
         # self.python_path. However, this seems more risk than it's worth.
         subprocess.check_call([os.path.join(self.bin_path, 'pip')] + args,
             stderr=subprocess.STDOUT)
-
-
-if __name__ == '__main__':
-    if len(sys.argv) < 5:
-        print('Usage: populate_virtualenv.py /path/to/topsrcdir /path/to/topobjdir /path/to/virtualenv /path/to/virtualenv_manifest')
-        sys.exit(1)
-
-    topsrcdir, topobjdir, virtualenv_path, manifest_path = sys.argv[1:5]
-    populate = False
-
-    # This should only be called internally.
-    if sys.argv[1] == 'populate':
-        populate = True
-        topsrcdir, topobjdir, virtualenv_path, manifest_path = sys.argv[2:]
-
-    manager = VirtualenvManager(topsrcdir, topobjdir, virtualenv_path,
-        sys.stdout, manifest_path)
-
-    if populate:
-        manager.populate()
-    else:
-        manager.ensure()
-