Show More
@@ -32,21 +32,14 b' def ipython_parent():' | |||||
32 |
|
32 | |||
33 | def ipython_submodules(root): |
|
33 | def ipython_submodules(root): | |
34 | """return IPython submodules relative to root""" |
|
34 | """return IPython submodules relative to root""" | |
35 | from IPython.frontend.html.notebook import DEFAULT_STATIC_FILES_PATH |
|
|||
36 | return [ |
|
35 | return [ | |
37 | pjoin(DEFAULT_STATIC_FILES_PATH, 'components') |
|
36 | pjoin(root, 'IPython', 'frontend', 'html', 'notebook', 'static', 'components'), | |
38 | ] |
|
37 | ] | |
39 |
|
38 | |||
40 | def is_repo(d): |
|
39 | def is_repo(d): | |
41 | """is d a git repo?""" |
|
40 | """is d a git repo?""" | |
42 | return os.path.exists(pjoin(d, '.git')) |
|
41 | return os.path.exists(pjoin(d, '.git')) | |
43 |
|
42 | |||
44 | def is_package(): |
|
|||
45 | """Is a package manager responsible for the static files path?""" |
|
|||
46 | from IPython.utils.path import get_ipython_package_dir |
|
|||
47 | from IPython.frontend.html.notebook import DEFAULT_STATIC_FILES_PATH |
|
|||
48 | return not DEFAULT_STATIC_FILES_PATH.startswith(get_ipython_package_dir()) |
|
|||
49 |
|
||||
50 | def check_submodule_status(root=None): |
|
43 | def check_submodule_status(root=None): | |
51 | """check submodule status |
|
44 | """check submodule status | |
52 |
|
45 | |||
@@ -60,13 +53,13 b' def check_submodule_status(root=None):' | |||||
60 | if hasattr(sys, "frozen"): |
|
53 | if hasattr(sys, "frozen"): | |
61 | # frozen via py2exe or similar, don't bother |
|
54 | # frozen via py2exe or similar, don't bother | |
62 | return 'clean' |
|
55 | return 'clean' | |
63 |
|
||||
64 | if is_package(): |
|
|||
65 | # package manager is responsible for static files, don't bother |
|
|||
66 | return 'clean' |
|
|||
67 |
|
56 | |||
68 | if not root: |
|
57 | if not root: | |
69 | root = ipython_parent() |
|
58 | root = ipython_parent() | |
|
59 | ||||
|
60 | if not is_repo(root): | |||
|
61 | # not in git, assume clean | |||
|
62 | return 'clean' | |||
70 |
|
63 | |||
71 | submodules = ipython_submodules(root) |
|
64 | submodules = ipython_submodules(root) | |
72 |
|
65 | |||
@@ -74,10 +67,6 b' def check_submodule_status(root=None):' | |||||
74 | if not os.path.exists(submodule): |
|
67 | if not os.path.exists(submodule): | |
75 | return 'missing' |
|
68 | return 'missing' | |
76 |
|
69 | |||
77 | if not is_repo(root): |
|
|||
78 | # not in git, assume clean |
|
|||
79 | return 'clean' |
|
|||
80 |
|
||||
81 | # check with git submodule status |
|
70 | # check with git submodule status | |
82 | proc = subprocess.Popen('git submodule status', |
|
71 | proc = subprocess.Popen('git submodule status', | |
83 | stdout=subprocess.PIPE, |
|
72 | stdout=subprocess.PIPE, |
@@ -121,6 +121,8 b' def require_clean_submodules():' | |||||
121 | after everything has been set in motion, |
|
121 | after everything has been set in motion, | |
122 | this is not a distutils command. |
|
122 | this is not a distutils command. | |
123 | """ |
|
123 | """ | |
|
124 | # PACKAGERS: Add a return here to skip checks for git submodules | |||
|
125 | ||||
124 | # don't do anything if nothing is actually supposed to happen |
|
126 | # don't do anything if nothing is actually supposed to happen | |
125 | for do_nothing in ('-h', '--help', '--help-commands', 'clean', 'submodule'): |
|
127 | for do_nothing in ('-h', '--help', '--help-commands', 'clean', 'submodule'): | |
126 | if do_nothing in sys.argv: |
|
128 | if do_nothing in sys.argv: |
General Comments 0
You need to be logged in to leave comments.
Login now