Merge pull request #87 from 128technology/master

Python interpreter can now be overridden
diff --git a/compiler/cli.py b/compiler/cli.py
index 083f931..7a34b4e 100644
--- a/compiler/cli.py
+++ b/compiler/cli.py
@@ -60,6 +60,9 @@
         '--stub_file',
         help='Read imports and interpreter path from the specified stub file',
         required=True)
+    parser.add_argument(
+        '--interpreter',
+        help='Interpreter to use instead of determining it from the stub file')
     # The default timestamp is "Jan 1 1980 00:00:00 utc", which is the
     # earliest time that can be stored in a zip file.
     #
@@ -138,6 +141,9 @@
     # Parse information from stub file that's too hard to compute in Skylark
     import_roots, interpreter = parse_stub(args.stub_file)
 
+    if args.interpreter:
+        interpreter = args.interpreter
+
     par = python_archive.PythonArchive(
         main_filename=args.main_filename,
         import_roots=import_roots,
diff --git a/compiler/cli_test.py b/compiler/cli_test.py
index 56a6f18..a30c067 100644
--- a/compiler/cli_test.py
+++ b/compiler/cli_test.py
@@ -42,6 +42,19 @@
         ])
         self.assertEqual(args.manifest_file, 'bar')
 
+    def test_make_command_line_parser_for_interprerter(self):
+        parser = cli.make_command_line_parser()
+        args = parser.parse_args([
+            '--manifest_file=bar',
+            '--manifest_root=bazz',
+            '--outputpar=baz',
+            '--stub_file=quux',
+            '--zip_safe=False',
+            '--interpreter=foobar',
+            'foo',
+        ])
+        self.assertEqual(args.interpreter, 'foobar')
+
     def test_stub(self):
         valid_cases = [
             # Empty list