python-3.x - pipfile 中的自定义部分

标签 python-3.x pipenv

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

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

例如。:

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

之前我用过 requirements.txt , requirements-dev.txt , requirements-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.



回答

现在不可能了,尽管它的设计考虑了这种可能性。

也许将来有可能。

关于python-3.x - pipfile 中的自定义部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54652391/

相关文章:

为 C 和 Python 创建共享参数文件

python - 如何在 mac 上的 vscode 中自动加载 venv/bin/activate

python-3.x - 为 youtube-dl python 选择下载位置

python - for 循环不正确循环

python - 使用 docker-compose up 启动 redis-server

python - VSCode 没有选择 ipykernel

python - 在 Windows 上安装 pipenv 失败

python-3.x - PRNG 的种子大小(以位为单位)有什么不同吗?

python - 通过 Pipenv 使用 .env 文件修改 PYTHONPATH

Python 3 - 你如何告诉 pipenv 使用 python 3 而不是 python 2?