mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 14:03:02 +00:00
setup.py: require npm, check that NPM CSS JSX commands succeed
This commit is contained in:
6
setup.py
6
setup.py
@@ -168,9 +168,6 @@ class NPM(BaseCommand):
|
|||||||
bower_dir = pjoin(static, 'components')
|
bower_dir = pjoin(static, 'components')
|
||||||
|
|
||||||
def should_run(self):
|
def should_run(self):
|
||||||
if not shutil.which('npm'):
|
|
||||||
print("npm unavailable", file=sys.stderr)
|
|
||||||
return False
|
|
||||||
if not os.path.exists(self.bower_dir):
|
if not os.path.exists(self.bower_dir):
|
||||||
return True
|
return True
|
||||||
if not os.path.exists(self.node_modules):
|
if not os.path.exists(self.node_modules):
|
||||||
@@ -195,6 +192,7 @@ class NPM(BaseCommand):
|
|||||||
os.utime(self.bower_dir)
|
os.utime(self.bower_dir)
|
||||||
# update data-files in case this created new files
|
# update data-files in case this created new files
|
||||||
self.distribution.data_files = get_data_files()
|
self.distribution.data_files = get_data_files()
|
||||||
|
assert not self.should_run(), 'NPM.run failed'
|
||||||
|
|
||||||
|
|
||||||
class CSS(BaseCommand):
|
class CSS(BaseCommand):
|
||||||
@@ -255,6 +253,7 @@ class CSS(BaseCommand):
|
|||||||
raise
|
raise
|
||||||
# update data-files in case this created new files
|
# update data-files in case this created new files
|
||||||
self.distribution.data_files = get_data_files()
|
self.distribution.data_files = get_data_files()
|
||||||
|
assert not self.should_run(), 'CSS.run failed'
|
||||||
|
|
||||||
|
|
||||||
class JSX(BaseCommand):
|
class JSX(BaseCommand):
|
||||||
@@ -314,6 +313,7 @@ class JSX(BaseCommand):
|
|||||||
|
|
||||||
# update data-files in case this created new files
|
# update data-files in case this created new files
|
||||||
self.distribution.data_files = get_data_files()
|
self.distribution.data_files = get_data_files()
|
||||||
|
assert not self.should_run(), 'JSX.run failed'
|
||||||
|
|
||||||
|
|
||||||
def js_css_first(cls, strict=True):
|
def js_css_first(cls, strict=True):
|
||||||
|
Reference in New Issue
Block a user