virtualenv和git repo开发与生产最佳实践

时间:2016-10-01 20:28:52

标签: python git pip virtualenv requirements.txt

pkg1 维护点 requirements.txt 的最佳做法是什么,git仓库包含以下内容

repo/pkg1 repo/pkg2 repo/pkg3 repo/pkg4

所有包都在一个仓库中检查, pkg1 依赖 pkg2

  • pkg1 requirements.txt 如何?
  • 是否需要多个版本的 requirements.txt 文件?共同与生产对发展? " -e可编辑模式"
  • 如果环境有可编辑的包安装示例,生成的URL锁定到特定的git commit,如何重新生成requirements.txt文件:

    -e git + ssh://git@github.com/username/repo.git@562ba58a6b98a29fe0914428c097f#egg=pkg1& subdirectory = pkg1

  • 显然相对路径在点子中被破坏,如何在 requirements.txt 中的编辑模式中指定 pkg1 pkg2

    • packageA = 1.0
    • packageB = 3.4
    • packageC = 3.5
    • -e。
    • -e ../ pkg2

生成示例requirements.txt文件:

colander==1.0
cryptography==1.4
docutils==0.12
-e git+ssh://git@github.com/username/project1.git@562ba58a6b98a29fe87877289d2abc24eb8c097f#egg=frontend&subdirectory=frontend
gunicorn==19.3.0
schedule==0.3.2
-e git+ssh://git@github.com/username/project1.git@562ba58a6b98a29fe87877289d2abc24eb8c097f#egg=shared&subdirectory=shared
shellescape==3.4.1
six==1.10.0
SQLAlchemy==1.0.11
transaction==1.4.4
translationstring==1.3
venusian==1.0
waitress==0.8.10

在此示例中 pkg1 前端 pkg2 共享

0 个答案:

没有答案
相关问题