How to structure a python projects with shared sub apps using git and buidout without symbolic links

六眼飞鱼酱① 提交于 2019-12-18 17:05:27

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/7140321/how-to-structure-a-python-projects-with-shared-sub-apps-using-git-and-buidout-wi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!