Re: [matplotlib-devel] building with python-2.3

2007-02-24 Thread Andrew Straw
Robert Kern wrote:
> Andrew Straw wrote:
>
>> 1) revert to the old way. The primary issues with this are a) 
>> "package_data" is supported as standard Python from 2.4 on, and the old 
>> way required carrying our own distutils command and b) we switched the 
>> data directory to have a nested structure, which required code changes 
>> and repository layout changes that would have to be undone.
>> 2) make our own distutils monkeypatch a la setuptools. Looking at 
>> setuptools/dist.py, this doesn't look trivial -- certainly beyond my 
>> free bandwidth capacity.
>> 
>
> Actually, it ought to be pretty trivial without setuptools (but compatible 
> with
> setuptools, AFAICT). Here is a Cookbook recipe that ought to work:
>
>   http://wiki.python.org/moin/DistutilsInstallDataScattered
>
>   
That's exactly "the old way", referred to in point #1.
> IPython does something similar and possibly better.
>
>   
> http://ipython.scipy.org/svn/ipython/ipython/trunk/setupext/install_data_ext.py
>   
 From a quick look at the code, it's hard to determine whether this new 
distutils command (install_data_ext) can handle installation to a nested 
directory structure. Can it? If it can, there's still the question of 
whether we want to continue rolling our own solution or simply using 
Python >= 2.4's standard "package_data".

AFAICT, the monkeypatching setuptools does for 2.3 to support 
"package_data" goes beyond adding a new distutils command. (I don't 
consider adding a distutils command to be monkeypatching -- that's just 
extending distutils is a pre-designed way.) Instead, setuptools actually 
replaces the distutils.dist.Distribution class with 
setuptools.dist.Distribution.

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] building with python-2.3

2007-02-24 Thread Fernando Perez
On 2/24/07, Andrew Straw <[EMAIL PROTECTED]> wrote:
> Robert Kern wrote:

> > IPython does something similar and possibly better.
> >
> >   
> > http://ipython.scipy.org/svn/ipython/ipython/trunk/setupext/install_data_ext.py
> >
>  From a quick look at the code, it's hard to determine whether this new
> distutils command (install_data_ext) can handle installation to a nested
> directory structure. Can it? If it can, there's still the question of
> whether we want to continue rolling our own solution or simply using
> Python >= 2.4's standard "package_data".

I think it does, but you should actually ask someone who knows about ipython :)

I say 'I think' from reading setup.py, where this code is invoked:

datafiles = [('data', docdirbase, docfiles),
  ('data', os.path.join(docdirbase, 'examples'),
   examfiles),
  ('data', os.path.join(docdirbase, 'manual'),
   manfiles),
  ('data', manpagebase, manpages),
  ('lib', 'IPython/UserConfig', cfgfiles)]

[...]

and then the setup() call contains:

  cmdclass = {'install_data': install_data_ext},
  data_files   = datafiles,

So it certainly looks like it works fine for copying things like the
example files and the html manual (which is nested, below doc/manual).

This code was actually given to me years ago, by some kind soul who
cringed at the horrid hacks I had in place to achieve the goal.  It
has never been modified and has served us well for years, so feel free
to grab it if it happens to be useful to mpl.  It's a tiny bit of
code, so if it gets you out of a bind, I'd say just use it.

It does work fine with python 2.3, if that's one of your goals.

Cheers,

f

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] building with python-2.3

2007-02-24 Thread Ken McIvor
On Feb 23, 2007, at 8:00 PM, Andrew Straw wrote:
>
> 2) make our own distutils monkeypatch a la setuptools. Looking at
> setuptools/dist.py, this doesn't look trivial -- certainly beyond my
> free bandwidth capacity.

I've written a script that attempts to simplify writing setup.py's  
that includes automagic support for package_data in Python 2.3:

http://agni.phys.iit.edu/~kmcivor/downloads/metasetup.py

You can see a simple example of it in the WxMpl source:

http://svn.csrri.iit.edu/mr-software/wxmpl/trunk/setup.py

Ken

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel