setup.py的pip-compile install_requires而不是需求.txt

发布于 2025-02-09 10:14:48 字数 268 浏览 0 评论 0原文

pip-compile启用sumplions.txt的固定要求的可食用性。我真的很喜欢

我的问题是,我们可以以某种方式做同样的事情,但是对于install_requires list setup.py ?

换句话说,如果我没有unignts.txt,而只是setup.py,是否可以使用pip compile

pip-compile enables traceability in pinning requirements inside a requirements.txt with an external requirements.in. I really like this

My question is, can we somehow do the same, but for an install_requires list inside setup.py?

In other words, if I don't have a requirements.txt but instead just a setup.py, is it possible to use pip-compile?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

意犹 2025-02-16 10:14:48

是的,pip-tools支持pyproject.tomlsetup.cfgsetup.py配置文件来自版本6.1.0(2021-04) -14)。

您应该只运行:

pip-compile -o requirements.txt YOUR_CONFIG_FILE
# where YOUR_CONFIG_FILE can be a setup.py
# or even simpler
pip-compile YOUR_CONFIG_FILE

查看文档:

来自pyproject.toml

setup.py和setup.cfg

changElog,verson,verson 6.1.0(2021-04-14)

Yes, pip-tools supports pyproject.toml, setup.cfg, and setup.py configuration files from version 6.1.0 (2021-04-14).

You should just run:

pip-compile -o requirements.txt YOUR_CONFIG_FILE
# where YOUR_CONFIG_FILE can be a setup.py
# or even simpler
pip-compile YOUR_CONFIG_FILE

Take a look at the documentation:

Requirements from pyproject.toml

Requirements from setup.py and setup.cfg

Changelog, verson 6.1.0 (2021-04-14)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文