Bug 1396582 - Remove __main__ from mozbuild.virtualenv; r?Build draft
authorGregory Szorc <gps@mozilla.com>
Mon, 08 Jan 2018 15:49:16 -0800
changeset 717446 c2e3eb36c17a889f741eac5ca9db782e13ed69c5
parent 717445 57d85edf605daeedadd47efd24f7be4c754fcb12
child 745255 5a2cd0a691158811c8e07894f0351b2ec311f71d
push id94676
push userbmo:gps@mozilla.com
push dateMon, 08 Jan 2018 23:49:47 +0000
reviewersBuild
bugs1396582
milestone59.0a1
Bug 1396582 - Remove __main__ from mozbuild.virtualenv; r?Build 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()
-