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
--- 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()
-