def check_assets(): from distutils.version import LooseVersion # Representative files that should exist after a successful build targets = [ 'static/package.json', 'schemas/@jupyterlab/shortcuts-extension/plugin.json', 'themes/@jupyterlab/theme-light-extension/images/jupyterlab.svg' ] if 'develop' in sys.argv: if skip_npm: return run(npm, cwd=HERE) for t in targets: if not os.path.exists(pjoin(HERE, NAME, t)): msg = ('Missing file: %s, `build:prod` script did not complete ' 'successfully' % t) raise ValueError(msg) if 'sdist' not in sys.argv and 'bdist_wheel' not in sys.argv: return target = pjoin(HERE, NAME, 'static', 'package.json') with open(target) as fid: version = json.load(fid)['jupyterlab']['version'] if LooseVersion(version) != LooseVersion(VERSION): raise ValueError('Version mismatch, please run `build:update`')
def run(self): if not skip_npm: if not which('node'): log.error('Please install nodejs and npm before continuing installation. nodejs may be installed using conda or directly from the nodejs website.') return run(npm, cwd=HERE) develop.run(self)
def run(self): if not skip_npm: if not which('node'): error_message = """ Please install nodejs and npm before continuing installation. nodejs may be installed using conda or directly from: https://nodejs.org/ """ log.error(error_message) return run(npm, cwd=HERE) develop.run(self)
def runPackLabextension(): if (lab_path / "package.json").is_file(): try: run(["jlpm", "build:labextension"], cwd=str(lab_path)) except CalledProcessError: pass
def runPackLabextension(): if Path('package.json').is_file(): try: run(['jlpm', 'build:labextension']) except CalledProcessError: pass
def runPackLabextension(): if Path("package.json").is_file(): try: run(["jlpm", "build:labextension"]) except CalledProcessError: pass
def run(self): if not skip_npm: run(npm, cwd=HERE) develop.run(self)