[英]Is parsing the requirements.txt and install packages specified in requirements.txt same as pip install -r requirements.txt?
[英]pip group packages in requirements.txt
在本地machive(開發)和生產服務器上,我對requirements.txt進行了一些更改。
例如,我想忽略psycopg2進行開發,而將其用於生產。
我使用pip Frozen> requirements.txt,然后手動添加所需的,然后將其推送到服務器。 有沒有辦法像在gem bundle install中那樣? 我的意思是
bundle install --without production
或類似的操作,使pip不必每次都手動執行此操作。
您可能有兩個單獨的pip文件dev_req.txt和prod_req.txt
在prod_req.txt中,您可以添加“ -r dev_req.txt”,當您安裝生產需求時,它也會安裝開發需求,但是在安裝開發需求時,它不會安裝生產需求。
使用結構http://www.fabfile.org/可以執行部署任務,並且可以具有兩個配置文件(pre和prod),然后根據要部署的角色選擇一個或其他pip要求文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.