I have 3 python projects. Project A, project B and project C. Project C depends on Porject A and B
Project C --- depends ---> Project A
Project C --- depends ---> Project B
And project A and project B all depends on PyXB, they use some generated schema module. Unfortunately, project A uses PyXB 1.2.2, and project B uses PyXB 1.2.3
Project A --- depends ---> PyXB 1.2.2
Project B --- depends ---> PyXB 1.2.3
If you read these modules, you will see
# Version of PyXB used to generate the bindings
_PyXBVersion = '1.2.3'
# Generated bindings are not compatible across PyXB versions
if pyxb.__version__ != _PyXBVersion:
raise pyxb.PyXBVersionError(_PyXBVersion)
and
# Version of PyXB used to generate the bindings
_PyXBVersion = '1.2.2'
# Generated bindings are not compatible across PyXB versions
if pyxb.__version__ != _PyXBVersion:
raise pyxb.PyXBVersionError(_PyXBVersion)
So, for now, Project C has a version conflict issue
Project C --- depends ---> PyXB 1.2.2
^
|
X conflict
|
v
Project C --- depends ---> PyXB 1.2.3
And since these schema modules were manually modified. It's hard to regenerate them and apply the same modifications. So I am wondering is it possible to import the same module with different version in Python. For example, I envision that could be something like
with import_routing('pyxb', '..packages.pyxb1_2_3'):
import project_a
is there a tool like this? or is there other workaround I can use in this situation?