We are creating new branches at work that all will use the same libraries.
The problem is that if we update one library, you can break all applications that are not updated.
Therefore, we would like to update our libraries.
The way I planned to do this also looks like
loader.load(name='mylib', version='1.0')
or maybe like this:
import mylib mylib.load(version='1.0')
The question is how this bootloader will work.
The naive approach is for each version to be in their own folder, the problem with this, however, is that if there is a common error in all versions, each version must be fixed separately.
A slightly better approach (for ease of maintenance) is to have all versions of the library in one file and call some loading function that creates function references. I donβt know how good it will be (we could get a monster file from several thousand lines, we could, of course, delete old unused versions).
To help maintain the number of versions, I plan to only increase the number of versions when I break compatibility, and not when fixing bugs or adding new things.
Is there something like built-in in python or any other approach that would work?
Does anyone have experience with this kind of thing?
I can add that things using libraries are test cases, we just want the tester to be cd in the branch and run. /testit.py, nothing more.
Decision
The decision is based on the assumption of Gringo Suawa.
class MyClass_1_0: def func1(self): return 'Baz' def func2(self): return 'Bar' class MyClass_1_1(MyClass_1_0):
Usage example:
>>> from my.module import MyClass_1_1 as MyClass >>> m = MyClass() >>> m.func3() Foo Bar