Git和共享python库(Git and shared python library)

编程入门 行业动态 更新时间:2024-10-23 12:29:52
Git和共享python库(Git and shared python library)

这可能是一个新手问题,所以请原谅。 我们有一个小的python开发团队,我们的repo组织如下所示。 我们有一个跨多个脚本(包装器)共享的自定义库,然后是特定于每个包装器的库。 以下结构在Git下维护。 到目前为止,这已经发挥了作用。 现在我们想要发布包装器,但是单独发布。 在中,我们需要发布wrapper1,针对不同的受众(不同的时间轴和需求)以及稍后的包装器2。 两者都需要包含shared_library,只包含其特定的库。 做这个的最好方式是什么?

repo/: wrapper1.py wrapper2.py shared_library/: module1.py module2.py wrapper1_specific_lib/: wrapper1_module1.py wrapper1_module2.py wrapper2_specific_lib/: wrapper2_module1.py wrapper2_module2.py

我们考虑了以下解决方案:

重新组织为三个单独的repos:wrapper1,wrapper2和shared_library并单独发布。

对wrapper1和wrapper2有两个单独的repos,并定期同步共享库(!!?!!)

保持这样,但探索是否可以以某种方式使用Git来释放所选文件,特定于每个包装器的文件夹。

求你帮助python代码组织,以便使用Git更好地进行发布管理。 提前致谢!!

This might be a novice question, so please excuse. We have a small python development team and our repo is organized as indicated below. We have a custom library that is shared across multiple scripts (wrappers) and then libraries specific to each wrapper. The below structure is maintained under Git. This has worked so far for development. Now we would like to release the wrappers, but individually. As in, we need to release wrapper1 targeting a separate audience (different timelines and needs) and at a later time wrapper2. Both need to contain the shared_library and only their specific library. What is the best way to do this?

repo/: wrapper1.py wrapper2.py shared_library/: module1.py module2.py wrapper1_specific_lib/: wrapper1_module1.py wrapper1_module2.py wrapper2_specific_lib/: wrapper2_module1.py wrapper2_module2.py

We have considered the following solutions:

Re-org as three separate repos: wrapper1, wrapper2 and shared_library and release separately.

Have two separate repos for wrapper1 and wrapper2 and periodically sync the shared library (!!?!!)

Leave it like this but explore if it is possible to use Git in some way to release selected files, folders specific to each wrapper.

Seeking you help on python code-organization for better release management using Git. Thanks in advance!!

最满意答案

您有3个产品,每个产品都有自己的发布时间表。 Wrapper1用户对看到wrapper2代码不感兴趣,反之亦然。 突破3回购将是最简单的方法。

请注意将自动化单元测试打包到shared_library仓库中。 两个依赖的应用程序都应该能够成功运行自己的测试和共享测试。 这将变得很重要,因为已发布的应用程序提交新的功能请求并尝试将shared_library拉向不同的方向。

You have 3 products, each with its own release timeline. Wrapper1 users are not interested in seeing wrapper2 code, and vice versa. Breaking out into 3 repos would be the simplest approach.

Do take care to package automated unit tests into the shared_library repo. Both of the dependent apps should be able to successfully run their own tests plus the shared tests. This will become important as the released apps submit new feature requests and try to pull the shared_library in different directions.

更多推荐

本文发布于:2023-08-07 21:15:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465599.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:python   Git   library   shared

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!