如何使用 git 和 buidout 构建具有共享子应用程序的 python 项目,而无需符号链接
我有多个项目,它们与其他项目共享子应用。 在 project 目录中工作时,我希望能够对应用进行更改、更新它,并将这些更新拉入第二个project 。
要求:
- 不使用符号链接(我的 IDE 调试器不能很好地使用它们)
- 不编译/重新运行脚本。我想对应用程序进行更改,而无需重新运行脚本/构建。
- 应用程序必须位于项目文件夹内。
结构如下:
app_one (git repo)
|-- app_one (actual app uses by projects)
| +-- models.py
|-- README.md
+-- setup.py
project_one (git repo)
|-- project_one
| |-- apps
| | |-- app_one
| | | +-- models.py
| | | -- app_two
|-- setup.cfg
+-- setup.py
project_two (git repo)
|-- project_two
| |-- apps
| | |-- app_one (same app as project_one)
| | | +-- models.py
| | | -- app_two
|-- setup.cfg
+-- setup.py
目前我正在使用 git-submodules ;缺点是无法链接到存储库的子文件夹。我最近读到了有关子树的内容,这会更好吗?
理想情况下,我想使用buildout,但我还没有找到一种在不使用符号链接的情况下完成此任务的好方法。如果有办法做到这一点,请告诉我。
任何建议将不胜感激。
I have multiple projects that shares child apps with other projects.
When working within the project directory I want to be able to make changes to the app, update it, and pull those updates into the second project.
Requirement:
- No use of symbolic links (my IDE's debugger doesn't work well with them)
- No compiling/rerun a script. I would like to make changes to the app without having to rerun a script/buildout.
- Apps must be within the project folder.
Here's the structure:
app_one (git repo)
|-- app_one (actual app uses by projects)
| +-- models.py
|-- README.md
+-- setup.py
project_one (git repo)
|-- project_one
| |-- apps
| | |-- app_one
| | | +-- models.py
| | | -- app_two
|-- setup.cfg
+-- setup.py
project_two (git repo)
|-- project_two
| |-- apps
| | |-- app_one (same app as project_one)
| | | +-- models.py
| | | -- app_two
|-- setup.cfg
+-- setup.py
Currently I'm using git-submodules for this; the downside is there is no way to link to a subfolder of a repo. I recently read about subtree, would this work better?
Ideally I would like to use buildout, but I haven't found a good way to accomplish this without the use of symbolic links. If there's a way to to do this please let me know.
Any suggestions would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
开发者先生。当 mr.developer 源代码被检出并激活时,它会变成 setuptools/在构建中分发开发鸡蛋,因此签出将由构建中的任何脚本(例如 zc.recipe.egg 生成的 python 解释器)使用。
mr.developer. When a mr.developer source is checked out and activated, it becomes a setuptools/distribute develop egg in the buildout and so the checkout will be what is used by any scripts (such as a zc.recipe.egg generated python interpreter) in the buildout.