小编Max*_*len的帖子

setup.py如何安装npm模块?

我实现了一个我想测试的python web客户端.

服务器托管在npm注册表中.在运行我的功能测试之前,服务器在本地运行节点.

如何从setup.py脚本中正确安装npm模块?

这是我目前的解决方案灵感来自这篇文章:

class CustomInstallCommand(install):
    def run(self):
        arguments = [
            'npm',
            'install',
            '--prefix',
            'test/functional',
            'promisify'
        ]
        subprocess.call(arguments, shell=True)
        install.run(self)

setup(
    cmdclass={'install': CustomInstallCommand},
Run Code Online (Sandbox Code Playgroud)

python setup.py npm

6
推荐指数
1
解决办法
1016
查看次数

标签 统计

npm ×1

python ×1

setup.py ×1