python - How to maintain multiple versions of a library -
this question exact duplicate of:
are there practical solutions maintaining multiple versions of library in python environment?
for example, have 1 web framework using pluggable design. under framework, there can several applications registered (application , framework running in same python process).
each application have business logic code , common code, common_httplib
. problem how can ensure multiple versions of common_httplib
don't conflict each other?
each application expected use own copy of common_httplib
different versions. absolute import, import hook, imp etc. don't work because common_httplib
may import other third party libraries may have same version problems.
following code structure of applications.
under $framework_home/apps/
, there is:
/app1 /common_httplib (version 1) /third_party libs /app1 blo code /app2 /common_httplib (version 2) /third_party libs /app2 blo code
no, there no way in same application.
note example plone, large project deploys depend on hundreds of packages has adjusting of "known versions" of packages involved main thing defines version.
the "right thing do" file bug report products "a" depending on older versions of product "b" in conflict, work newer versions of "b", , prepare patches fixing those. (and while bug reports not accepted, run deploy fixes)
you consider splitting app in several processes using interprocess communication, such xmlrpc - depends on doing, , nature of conflicting packages.
Comments
Post a Comment