pipfile 中的自定义部分

Custom section in pipfile

是否可以在 pipfile 中设置自定义部分?

默认情况下我只看到 [packages][dev-packages],但我对某些环境有额外的依赖性。所以我想安装 packages,例如 [tests],而不是 [dev-packages]

例如:

pipenv install --tests
# or 
pipenv install --my-custom-section

之前我用过requirements.txtrequirements-dev.txtrequirements-integration.txt。用pipenv有什么好的实现方法吗?

让我们看看文档

如果我们查看 Pipfile. The Concept

Pipfile will be superior to requirements.txt file in a number of ways: ...

  • Existing requirements files tend to proliferate into multiple files - e.g. dev-requirements.txt, test-requirements.txt, etc. - but a Pipfile will allow seamlessly specifying groups of dependencies in one place. * This will be surfaced as only two built-in groups (default & development). (see note below)

Note

Custom groups may be added in the future. Remember, it is easier to add features in the future than it is to remove them. The Composer community has been successful with only default and development as group options for many years. This model is being followed.

回答

现在不可能了,虽然它是在设计时考虑到这种可能性的。

也许以后会有可能。