static matplotlib

Hello everyone,

I have written an application that depends on matplotlib. My application has several dependencies and I feel like this is a problem. Since matplotlib only depends on Numeric, I would like to have matplotlib linked statically.

I guess I wouldn't have to change much about my program. I would simply replace calls like this

from matplotlib import *

by calls like this

from myapp.matplotlib import *

My problem is on the setup side. I have only started to use the distutils and I found they are not-so-well documented. Can anyone provide me with an example or some hints on how to include matplotlib statically?

My second question is the license question :slight_smile: I read through the matplotlib license and there seems to be no problem with including matplotlib. Is that also valid if my program is GPL-licensed?

With best regards,

Niklas Volbers.

N. Volbers wrote:

Hello everyone,

I have written an application that depends on matplotlib. My application has several dependencies and I feel like this is a problem. Since matplotlib only depends on Numeric, I would like to have matplotlib linked statically.

There is no such thing as "linking a Python package statically." At least, we do not use such terminology.

I guess I wouldn't have to change much about my program. I would simply replace calls like this

from matplotlib import *

by calls like this

from myapp.matplotlib import *

You *could* put matplotlib wholesale into your package hierarchy (indeed, matplotlib does this for at least one of its dependencies), but it seems to me better to just package up matplotlib for the platforms that you support and distribute that package alongside your own.

There has been some recent work that should make this kind of thing very, very easy.

http://peak.telecommunity.com/DevCenter/EasyInstall

Numeric, at least, builds into an egg just fine. matplotlib might take a little more work, but John has started to look into it.

My problem is on the setup side. I have only started to use the distutils and I found they are not-so-well documented. Can anyone provide me with an example or some hints on how to include matplotlib statically?

My second question is the license question :slight_smile: I read through the matplotlib license and there seems to be no problem with including matplotlib. Is that also valid if my program is GPL-licensed?

Yes. The licenses of matplotlib's code are all GPL-compatible as far as I can tell.

ยทยทยท

--
Robert Kern
rkern@...376...

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter

Robert Kern schrieb:

N. Volbers wrote:

Hello everyone,

I have written an application that depends on matplotlib. My application has several dependencies and I feel like this is a problem. Since matplotlib only depends on Numeric, I would like to have matplotlib linked statically.

There is no such thing as "linking a Python package statically." At least, we do not use such terminology.

Yes, you are right, of course. What terminology should I use? Maybe: Distributing a python package as subpackage to my own?

You *could* put matplotlib wholesale into your package hierarchy (indeed, matplotlib does this for at least one of its dependencies), but it seems to me better to just package up matplotlib for the platforms that you support and distribute that package alongside your own.

There has been some recent work that should make this kind of thing very, very easy.

EasyInstall - The PEAK Developers' Center

Numeric, at least, builds into an egg just fine. matplotlib might take a little more work, but John has started to look into it.

Great link! This looks very promising and would be the perfect solution to my problem. This allows me to request a specific matplotlib version to be used with my application.

My second question is the license question :slight_smile: I read through the matplotlib license and there seems to be no problem with including matplotlib. Is that also valid if my program is GPL-licensed?

Yes. The licenses of matplotlib's code are all GPL-compatible as far as I can tell.

Thanks very much for your answer,

Niklas.