mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-12 04:23:01 +00:00
Don't build admin app on readthedocs
This commit is contained in:
22
setup.py
22
setup.py
@@ -270,16 +270,20 @@ class JSX(BaseCommand):
|
|||||||
js_target = pjoin(static, 'js', 'admin-react.js')
|
js_target = pjoin(static, 'js', 'admin-react.js')
|
||||||
|
|
||||||
def should_run(self):
|
def should_run(self):
|
||||||
update_needed = False
|
if os.getenv('READTHEDOCS'):
|
||||||
|
# yarn not available on RTD
|
||||||
|
return False
|
||||||
|
|
||||||
if not os.path.exists(self.js_target):
|
if not os.path.exists(self.js_target):
|
||||||
update_needed = True
|
return True
|
||||||
else:
|
|
||||||
js_target_mtime = mtime(self.js_target)
|
js_target_mtime = mtime(self.js_target)
|
||||||
# The sdist doesn't contain the jsx directory so this always returns 0:
|
# The sdist doesn't contain the jsx directory so this always returns 0
|
||||||
jsx_mtime = recursive_mtime(self.jsx_dir)
|
# if run from the dist/*.tar.gz
|
||||||
if js_target_mtime < jsx_mtime:
|
jsx_mtime = recursive_mtime(self.jsx_dir)
|
||||||
update_needed = True
|
if js_target_mtime < jsx_mtime:
|
||||||
return update_needed
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.should_run():
|
if not self.should_run():
|
||||||
|
Reference in New Issue
Block a user