You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/01/11 00:09:24 UTC

[GitHub] marcoabreu closed pull request #13809: Add Local test stage and option to jump directly to menu item from co…

marcoabreu closed pull request #13809: Add Local test stage and option to jump directly to menu item from co…
URL: https://github.com/apache/incubator-mxnet/pull/13809
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/dev_menu.py b/dev_menu.py
index 79202dd7d5d..7329b446ed3 100755
--- a/dev_menu.py
+++ b/dev_menu.py
@@ -110,11 +110,14 @@ def create_virtualenv_default():
     logging.info("You can use the virtualenv by executing 'source %s/bin/activate'", DEFAULT_PYENV)
 
 COMMANDS = OrderedDict([
-    ('[Local build] CMake/Ninja build (using cmake_options.yaml (cp cmake/cmake_options.yml .) and edit) (creates {} virtualenv in "{}")'.format(DEFAULT_PYTHON, DEFAULT_PYENV),
+    ('[Local] BUILD CMake/Ninja (using cmake_options.yaml (cp cmake/cmake_options.yml .) and edit) ({} virtualenv in "{}")'.format(DEFAULT_PYTHON, DEFAULT_PYENV),
     [
         CMake(),
         create_virtualenv_default,
     ]),
+    ('[Local] Python Unit tests',
+        "./py3_venv/bin/nosetests -v tests/python/unittest/"
+    ),
     ('[Website and docs build] Will build to docs/_build/html/',
         "ci/docker/runtime_functions.sh deploy_docs"),
     ('[Docker] sanity_check. Check for linting and code formatting.',
@@ -184,7 +187,10 @@ def handle_command(cmd):
 
 def use_menu_ui(args) -> None:
     command_list = list(COMMANDS.keys())
-    choice = show_menu(command_list, 'Available actions')
+    if hasattr(args, 'choice') and args.choice and args.choice[0].isdigit():
+        choice = int(args.choice[0]) - 1
+    else:
+        choice = show_menu(command_list, 'Available actions')
     handle_commands(COMMANDS[command_list[choice]])
 
 def build(args) -> None:
@@ -192,7 +198,7 @@ def build(args) -> None:
     venv_exe = shutil.which('virtualenv')
     pyexe = shutil.which(args.pyexe)
     if not venv_exe:
-        logging.warn("virtualenv wasn't found in path, it's recommended to install virutalenv to manage python environments")
+        logging.warn("virtualenv wasn't found in path, it's recommended to install virtualenv to manage python environments")
     if not pyexe:
         logging.warn("Python executable %s not found in path", args.pyexe)
     if args.cmake_options:
@@ -219,8 +225,12 @@ def main():
         type=str,
         default=DEFAULT_PYTHON,
         help='python executable')
-
     build_parser.set_defaults(command='build')
+
+    menu_parser = subparsers.add_parser('menu', help='jump to menu option #')
+    menu_parser.set_defaults(command='use_menu_ui')
+    menu_parser.add_argument('choice', nargs=1)
+
     args = parser.parse_args()
     globals()[args.command](args)
     return 0


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services