简体   繁体   中英

Git and shared python library

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:

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

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

  3. 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!!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM