Python 的诗歌依赖管理器允许通过命令指定可选依赖项:
$ poetry add --optional redis
这导致了这种配置:
[tool.poetry.dependencies]
python = "^3.8"
redis = {version="^3.4.1", optional=true}
但是,您如何实际安装它们?文档似乎暗示:
$ poetry install -E redis
但这只是抛出和错误:
Installing dependencies from lock file
[ValueError]
Extra [redis] is not specified.