[英]How can I separate out dependencies from requirements.txt?
I am maintaining a requirements.txt
file for my Python project, including version numbers and hashes for each package. 我正在为我的Python项目维护一个requirements.txt
文件,包括每个软件包的版本号和哈希值。 (This is so I can install with pip install --no-deps --require-hashes
.) (因此,我可以使用pip install --no-deps --require-hashes
。)
Some packages in the list are my actual requirements (for example, Sphinx
) while others are just dependencies of those requirements (for example, everything else you get when you pip install Sphinx
). 列表中的某些软件包是我的实际需求(例如Sphinx
),而其他软件包仅仅是这些需求的依赖项(例如,通过pip install Sphinx
时获得的所有其他内容)。
I want to maintain this list of requirements separately from those dependencies. 我想与这些依赖项分开维护此需求列表。 How can I do this? 我怎样才能做到这一点?
At the moment I have simply split my requirements into two files (see below, simplified for readability). 目前,我已将需求简单地分为两个文件(请参见下文,简化了可读性)。 But I am not sure how maintainable this will be (false retentions, handling dependency updates...). 但是我不确定这将是多么可维护(错误的保留,处理依赖项更新...)。
requirements.txt requirements.txt
# these are my actual requirements
-r dependencies.txt
Sphinx
dependencies.txt 依靠.txt
# these are the dependencies of my actual requirements
alabaster
Babel
certifi
chardet
docutils
idna
imagesize
Jinja2
MarkupSafe
Pygments
pytz
requests
six
snowballstemmer
sphinxcontrib-websupport
urllib3
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.