如何使用无符号链接的git和buidout构建共享子应用程序的python项目 [英] How to structure a python projects with shared sub apps using git and buidout without symbolic links

查看:199
本文介绍了如何使用无符号链接的git和buidout构建共享子应用程序的python项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个项目与其他项目共享子应用
项目目录中工作时,我希望能够对应用进行更改,对其进行更新并将这些更新拉入第二个项目

要求:


  • 没有使用 符号链接 (我的IDE调试器不适用于它们)

  • 不编译/重新运行脚本。我想对应用进行更改,而无需重新运行脚本/扩展。

  • 应用程序必须位于项目文件夹内。 结构如下:


  •   app_one(git repo)
    | - app_one(项目使用的实际应用程序)
    | + - 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(与project_one相同的应用程序)
    | | | + - models.py
    | | | - app_two
    | - setup.cfg
    + - setup.py



    <目前我使用的是git-submodules;缺点是没有办法链接到回购的子文件夹。我最近阅读了关于子树的信息,这会更好吗?



    理想情况下,我想使用构建,但我还没有找到一个好方法无需使用符号链接即可完成此操作。如果有办法做到这一点,请让我知道。



    任何建议都将不胜感激。

    解决方案

    mr.developer 。当mr.developer源被激活时,被激活,它将成为一个setuptools / 在开发版本中分发开发鸡蛋,所以checkout将是buildout中任何脚本(比如zc.recipe.egg生成的python解释器)使用的内容。


    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.

    解决方案

    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.

    这篇关于如何使用无符号链接的git和buidout构建共享子应用程序的python项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆