diff --git a/IPython/utils/submodule.py b/IPython/utils/submodule.py index 4ca093a..cbabf6b 100644 --- a/IPython/utils/submodule.py +++ b/IPython/utils/submodule.py @@ -32,21 +32,14 @@ def ipython_parent(): def ipython_submodules(root): """return IPython submodules relative to root""" - from IPython.frontend.html.notebook import DEFAULT_STATIC_FILES_PATH return [ - pjoin(DEFAULT_STATIC_FILES_PATH, 'components') + pjoin(root, 'IPython', 'frontend', 'html', 'notebook', 'static', 'components'), ] def is_repo(d): """is d a git repo?""" return os.path.exists(pjoin(d, '.git')) -def is_package(): - """Is a package manager responsible for the static files path?""" - from IPython.utils.path import get_ipython_package_dir - from IPython.frontend.html.notebook import DEFAULT_STATIC_FILES_PATH - return not DEFAULT_STATIC_FILES_PATH.startswith(get_ipython_package_dir()) - def check_submodule_status(root=None): """check submodule status @@ -60,13 +53,13 @@ def check_submodule_status(root=None): if hasattr(sys, "frozen"): # frozen via py2exe or similar, don't bother return 'clean' - - if is_package(): - # package manager is responsible for static files, don't bother - return 'clean' if not root: root = ipython_parent() + + if not is_repo(root): + # not in git, assume clean + return 'clean' submodules = ipython_submodules(root) @@ -74,10 +67,6 @@ def check_submodule_status(root=None): if not os.path.exists(submodule): return 'missing' - if not is_repo(root): - # not in git, assume clean - return 'clean' - # check with git submodule status proc = subprocess.Popen('git submodule status', stdout=subprocess.PIPE, diff --git a/setup.py b/setup.py index 44991bf..18c92ad 100755 --- a/setup.py +++ b/setup.py @@ -121,6 +121,8 @@ def require_clean_submodules(): after everything has been set in motion, this is not a distutils command. """ + # PACKAGERS: Add a return here to skip checks for git submodules + # don't do anything if nothing is actually supposed to happen for do_nothing in ('-h', '--help', '--help-commands', 'clean', 'submodule'): if do_nothing in sys.argv: