如何使用 Zef 仅安装测试依赖项

How to install only test dependencies with Zef

zefinstall 子命令提供了一个 --deps-only 标志,用于仅安装模块的依赖项。

zef install --deps-only .

这会在 META6.json 中安装 depends 对象中引用的所有模块。在META6.json中的test-depends对象中是否有类似的标志来安装所有模块?

zef install . --deps-only --/depends --/build-depends --test-depends

末尾的 --test-depends 不是必需的,但为了清楚起见包含在内。 --/depends 跳过 depends META6 字段下的项目,--/build-depends 跳过 build-depends META6 字段下的项目。


来自zef --help的相关位:

FLAGS
    --deps-only             Install only the dependency chains of the requested distributions

    --/depends              Do not fetch runtime dependencies
    --/test-depends         Do not fetch test dependencies
    --/build-depends        Do not fetch build dependencies