mitsuhiko / multiversion

A hack that allows you to use different versions of the same library in the same Python process without clashes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Versioned Per Package

tonybarbieri opened this issue · comments

Hello,

I know you created this to be something that shouldn't be done in Python but it looks like it could be very useful!

I have been dealing with trying to figure out how how to version dependencies in situations where virtualenv is not an option. A lot of the Python code we use in production are used directly as imports in other applications and we have many packages that may have varying versioned dependencies. virtualenv can not be used in these situations.

I was wondering if this could be expanded to allow a version to be set within a package and have that propagate to all modules in that package.

For example in the root init.py if I set multiversion(tornado, 2.2.1) then all modules in that package will use tornado 2.2.1 when I import tornado.

I have been struggling recently will how do something like this per package. I had hoped that each package could have their own module search path that could be used before falling back to the global sys.path. This looks like it could be an alternative.

Thanks for posting this!

-tony

I think this will make install external packages in python distribution comes with many software,
such as the finite element software Abaqus and MSC Marc. Many packages (such as matplotlib, numpy)
have varying versioned dependencies, which makes it is a pain to get all these dependencies met in
those close source python distributions.
I have sent a feature request to
python-dev@python.org

Maybe someone can create an advice function for import just like the advice function in emacs.