setup.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:geonotebook 作者: OpenGeoscience 项目源码 文件源码
def run(self):
        has_npm = self.has_npm()
        if not has_npm:
            log.error(
                "`npm` unavailable.  If you're running this command using "
                "sudo, make sure `npm` is available to sudo"
            )

        env = os.environ.copy()
        env['PATH'] = npm_path

        if self.should_run_npm_install():
            log.info(
                "Installing build dependencies with npm.  "
                "This may take a while..."
            )
            check_call(
                ['npm', 'install'],
                cwd=node_root, stdout=sys.stdout, stderr=sys.stderr
            )
            log.info(
                "Building static assets.  "
            )
            check_call(
                ['npm', 'run', 'build'],
                cwd=node_root, stdout=sys.stdout, stderr=sys.stderr
            )
            os.utime(self.node_modules, None)

        for t in self.targets:
            if not os.path.exists(t):
                msg = 'Missing file: %s' % t
                if not has_npm:
                    msg += '\nnpm is required to build a development version'
                raise ValueError(msg)

        # update package data in case this created new files
        update_package_data(self.distribution)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号