gpt4 book ai didi

python - 在 pyproject.toml 中连接 2 个数组

转载 作者:行者123 更新时间:2023-12-05 03:23:58 25 4
gpt4 key购买 nike

我正在试一试 pyproject.toml 文件,但我坚持执行这个简单的任务。考虑以下可选依赖项:

[project.optional-dependencies]
style = ["black", "codespell", "isort", "flake8"]
test = ["pytest", "pytest-cov"]
all = ["black", "codespell", "isort", "flake8", "pytest", "pytest-cov"]

有没有办法避免复制/粘贴 all 键中的所有可选依赖项?有没有办法至少做到all = style + test

最佳答案

直接在toml中没有这样的功能标记。

不过,Python打包有一个技巧,靠自己:

[project.optional-dependencies]
style = ["black", "codespell", "isort", "flake8"]
test = ["pytest", "pytest-cov"]
all = ["myproject[style]", "myproject[test]"]

Source :

Circular dependency is a feature that Python packaging is explicitly designed to allow, so it works and should continue to work.

关于python - 在 pyproject.toml 中连接 2 个数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72398203/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com