轻松管理requirements.txt文件!
yippee的Python项目详细描述
伊佩
管理Requirements.txt文件
使用requirements.txt
文件很难区分顶级依赖项和临时依赖项。此外,为多个环境分离不同的依赖关系也是一项挑战。yippee试图通过指定生成requirements.txt
文件的dsl来减轻痛苦。
例如,使用以下yippee.py
文件:
fromyippeeimportgroup,pippip("django",">=2.1.0")withgroup("production"):pip("postgres","2.2.2")withgroup("development"):pip("black")
这将生成:
requirements.txt
Django==2.1.5
pytz==2018.7
requirements-production.txt
-r requirements.txt
postgres==2.2.2
psycopg2-binary==2.7.6.1
以及
requirements-development.txt
-r requirements.txt
appdirs==1.4.3
attrs==18.2.0
black==18.9b0
Click==7.0
toml==0.10.0
用法
通过pypi安装yippee。然后可以运行yippee
来生成requirements.txt
文件。