building with python-2.3

I noticed today that setup.py is using package_data. Is this absolutely
necessary? The most recent version of Red Hat Enterprise Linux includes
python-2.3, which does not support package_data. We are still supporting
python-2.3, aren't we?

Darren

Darren Dale wrote:

I noticed today that setup.py is using package_data. Is this absolutely necessary? The most recent version of Red Hat Enterprise Linux includes python-2.3, which does not support package_data. We are still supporting python-2.3, aren't we?

Yes, I am sure that is the intention. The change to setup.py occurred in revision 3011 as part of the reorganization to support running from a working directory and making eggs, or something like that.

Eric

I'm learning a bit about setuptools and distutils, so sorry if this is
a no brainer: Are we using only distutils for matplotlib? I.e. - no
setuptools?

This is because I stumbled across this at the setuptools page:
http://peak.telecommunity.com/DevCenter/setuptools

···

====
Feature Highlights:

....
    * Include data files inside your package directories, where your
code can actually use them. (Python 2.4 distutils also supports this
feature, but setuptools provides the feature for Python 2.3 packages
also, and supports accessing data files in zipped packages too.)
....

Cheers,
Edin

On 2/22/07, Darren Dale <dd55@...143...> wrote:

I noticed today that setup.py is using package_data. Is this absolutely
necessary? The most recent version of Red Hat Enterprise Linux includes
python-2.3, which does not support package_data. We are still supporting
python-2.3, aren't we?

Darren

-------------------------------------------------------------------------
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
matplotlib-devel List Signup and Options

We support setuptools, but we do not require it.

···

On Friday 23 February 2007 5:46:58 am Edin Salkovic wrote:

I'm learning a bit about setuptools and distutils, so sorry if this is
a no brainer: Are we using only distutils for matplotlib? I.e. - no
setuptools?

This is because I stumbled across this at the setuptools page:
setuptools - The PEAK Developers' Center

Feature Highlights:

....
    * Include data files inside your package directories, where your
code can actually use them. (Python 2.4 distutils also supports this
feature, but setuptools provides the feature for Python 2.3 packages
also, and supports accessing data files in zipped packages too.)
....

Cheers,
Edin

On 2/22/07, Darren Dale <dd55@...143...> wrote:
> I noticed today that setup.py is using package_data. Is this absolutely
> necessary? The most recent version of Red Hat Enterprise Linux includes
> python-2.3, which does not support package_data. We are still supporting
> python-2.3, aren't we?
>
> Darren
>
>
> -------------------------------------------------------------------------
> 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
> matplotlib-devel List Signup and Options

-------------------------------------------------------------------------
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
matplotlib-devel List Signup and Options

--
Darren S. Dale, Ph.D.
dd55@...143...

Darren Dale wrote:

We support setuptools, but we do not require it.

So, it sounds like setuptools is required now if one has Python 2.3. If so, is that acceptable--is the gain worth the pain? Is there any significant pain associated with requiring setuptools, at least for people with Python 2.3?

Eric

···

On Friday 23 February 2007 5:46:58 am Edin Salkovic wrote:

I'm learning a bit about setuptools and distutils, so sorry if this is
a no brainer: Are we using only distutils for matplotlib? I.e. - no
setuptools?

This is because I stumbled across this at the setuptools page:
setuptools - The PEAK Developers' Center

Feature Highlights:

....
    * Include data files inside your package directories, where your
code can actually use them. (Python 2.4 distutils also supports this
feature, but setuptools provides the feature for Python 2.3 packages
also, and supports accessing data files in zipped packages too.)
....

Cheers,
Edin

On 2/22/07, Darren Dale <dd55@...143...> wrote:

I noticed today that setup.py is using package_data. Is this absolutely
necessary? The most recent version of Red Hat Enterprise Linux includes
python-2.3, which does not support package_data. We are still supporting
python-2.3, aren't we?

Darren

-------------------------------------------------------------------------
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
matplotlib-devel List Signup and Options

-------------------------------------------------------------------------
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
matplotlib-devel List Signup and Options

(Picking up this thread a bit late... And I just wrote a longer email which got munched due to email configuration issues...)

I'm responsible for the "package_data" keyword being added to setup.py. The bottom line is Python 2.3 is still supported. I simply didn't realize that it would screw things up. I propose that setuptools be a requirement for matplotlib with Python 2.3 and have committed a change that does this. So the issue is now closed unless we want to implement an alternative solution. These, as I see them, are:

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.

-Andrew

Eric Firing wrote:

···

Darren Dale wrote:
  

We support setuptools, but we do not require it.
    
So, it sounds like setuptools is required now if one has Python 2.3. If so, is that acceptable--is the gain worth the pain? Is there any significant pain associated with requiring setuptools, at least for people with Python 2.3?

Eric

On Friday 23 February 2007 5:46:58 am Edin Salkovic wrote:
    

I'm learning a bit about setuptools and distutils, so sorry if this is
a no brainer: Are we using only distutils for matplotlib? I.e. - no
setuptools?

This is because I stumbled across this at the setuptools page:
setuptools - The PEAK Developers' Center

Feature Highlights:

....
    * Include data files inside your package directories, where your
code can actually use them. (Python 2.4 distutils also supports this
feature, but setuptools provides the feature for Python 2.3 packages
also, and supports accessing data files in zipped packages too.)
....

Cheers,
Edin

On 2/22/07, Darren Dale <dd55@...143...> wrote:
      

I noticed today that setup.py is using package_data. Is this absolutely
necessary? The most recent version of Red Hat Enterprise Linux includes
python-2.3, which does not support package_data. We are still supporting
python-2.3, aren't we?

Darren

Andrew,

I agree with your proposal; I think it makes more sense than either alternative. Let's see what John says when he gets back from his vacation.

Eric

Andrew Straw wrote:

···

(Picking up this thread a bit late... And I just wrote a longer email which got munched due to email configuration issues...)

I'm responsible for the "package_data" keyword being added to setup.py. The bottom line is Python 2.3 is still supported. I simply didn't realize that it would screw things up. I propose that setuptools be a requirement for matplotlib with Python 2.3 and have committed a change that does this. So the issue is now closed unless we want to implement an alternative solution. These, as I see them, are:

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.

-Andrew

Eric Firing wrote:

Darren Dale wrote:

We support setuptools, but we do not require it.
    
So, it sounds like setuptools is required now if one has Python 2.3. If so, is that acceptable--is the gain worth the pain? Is there any significant pain associated with requiring setuptools, at least for people with Python 2.3?

Eric

On Friday 23 February 2007 5:46:58 am Edin Salkovic wrote:
   

I'm learning a bit about setuptools and distutils, so sorry if this is
a no brainer: Are we using only distutils for matplotlib? I.e. - no
setuptools?

This is because I stumbled across this at the setuptools page:
setuptools - The PEAK Developers' Center

Feature Highlights:

....
    * Include data files inside your package directories, where your
code can actually use them. (Python 2.4 distutils also supports this
feature, but setuptools provides the feature for Python 2.3 packages
also, and supports accessing data files in zipped packages too.)
....

Cheers,
Edin

On 2/22/07, Darren Dale <dd55@...143...> wrote:
     

I noticed today that setup.py is using package_data. Is this absolutely
necessary? The most recent version of Red Hat Enterprise Linux includes
python-2.3, which does not support package_data. We are still supporting
python-2.3, aren't we?

Darren
        

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.

Actually, it ought to be pretty trivial without setuptools (but compatible with
setuptools, AFAICT). Here is a Cookbook recipe that ought to work:

  Distutils/Cookbook/InstallDataScattered - Python Wiki

IPython does something similar and possibly better.

  http://ipython.scipy.org/svn/ipython/ipython/trunk/setupext/install_data_ext.py

···

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
  -- Umberto Eco

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:

  Distutils/Cookbook/InstallDataScattered - Python Wiki

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.

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

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

···

On 2/24/07, Andrew Straw <strawman@...36...> 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'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

···

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.

This is fine by me -- I actually was forced to think about this this
morning as I tried to upgrade my powerbook to the latest svn. I'm
still on python2.3, and when I tried to install I hit the setuptools
import. I figured I would be a good crash test dummy to see how easy
it was to install setuptools, so I poked around and found the ez_setup
and am off to the races. I added a friendly exception to setup.py to
make it easier for the next guy

if major==2 and minor1<=3:
    # setuptools monkeypatches distutils.core.Distribution to support
    # package_data
    try: import setuptools
    except ImportError:
        raise SystemExit("""\
matplotlib requires setuptools for installation. Please download
http://peak.telecommunity.com/dist/ez_setup.py and run it (as su if
you are doing a system wide install) to install the proper version of
setuptools for your system""")

Darren, do you still have the html docs building on your system? If
so, perhaps you could update the installing page to mention the
requirement (an perhaps the user's guide). I updated the README in
the src distro. I still haven't got my build pipeline for the htdocs
and user's guide going on my laptop after my old build computer died,
a good indication that both are too complicated....

JDH

···

On 2/23/07, Andrew Straw <strawman@...36...> 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.

> 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.

This is fine by me -- I actually was forced to think about this this
morning as I tried to upgrade my powerbook to the latest svn. I'm
still on python2.3, and when I tried to install I hit the setuptools
import. I figured I would be a good crash test dummy to see how easy
it was to install setuptools, so I poked around and found the ez_setup
and am off to the races. I added a friendly exception to setup.py to
make it easier for the next guy

if major==2 and minor1<=3:
# setuptools monkeypatches distutils.core.Distribution to support
# package_data
try: import setuptools
except ImportError:
raise SystemExit("""\
matplotlib requires setuptools for installation. Please download
http://peak.telecommunity.com/dist/ez_setup.py and run it (as su if
you are doing a system wide install) to install the proper version of
setuptools for your system""")

Excellent, I was going to add a warning like this myself if the setuptools
approach was accepted.

Darren, do you still have the html docs building on your system? If
so, perhaps you could update the installing page to mention the
requirement (an perhaps the user's guide). I updated the README in
the src distro. I still haven't got my build pipeline for the htdocs
and user's guide going on my laptop after my old build computer died,
a good indication that both are too complicated....

Yes, I am set up to build the html docs (in fact, I have been working a bit on
the users guide this morning.) I'll update the webpage this afternoon.

Darren

···

On Saturday 03 March 2007 12:43:53 pm you wrote:

On 2/23/07, Andrew Straw <strawman@...36...> wrote: