这对于 Cargo 和 npm 来说相当容易。
当我从 shell $ pylint src && pylint tests
运行它时,我没有问题。
但是当我将它作为 pipenv 脚本运行时
[scripts]
lint = "pylint src && pylint tests"
$ pipenv run lint
************* Module &&
&&:1:0: F0001: No module named && (fatal)
Pylint 认为 &&
是另一个模块。
pipenv 运行时不只是终端吗?
答案 0 :(得分:1)
正如其 GitHub 跟踪器的 this issue 所指出的,这是由以下事实引起的:
<块引用>这很难做到,尤其是因为 Pipenv 需要支持跨平台体验
来源:https://github.com/pypa/pipenv/issues/2038#issuecomment-387506323
问题报告中指出了一个可能适合您的解决方法:
[scripts]
lint = "bash -c 'pylint src && pylint tests'"
pipenv
跟踪器上的相关问题: