Better support for setuptools, WAS: building with python-2.3

Apparently, there's a better solution for the above code (source
http://peak.telecommunity.com/doc/ez_setup/index.html):

···

On 3/3/07, John Hunter <jdh2358@...149...> wrote:

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

===
This directory (svn://svn.eby-sarna.com/svnroot/ez_setup) exists so
that Subversion-based projects can share a single
copy of the ``ez_setup`` bootstrap module for ``setuptools``, and have it
automatically updated in their projects when ``setuptools`` is updated.

For your convenience, you may use the following svn:externals definition::

    ez_setup svn://svn.eby-sarna.com/svnroot/ez_setup

You can set this by executing this command in your project directory::

    svn propedit svn:externals .

And then adding the line shown above to the file that comes up for editing.
Then, whenever you update your project, ``ez_setup`` will be updated as well.

We should then add the following lines to our setup.py script

from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages

This would make installing setuptools even easier, since the newest
ez_setup/seuptools would be downloaded by the user/developer every
time a "svn update;python setup.py install" is issued.

Are the above changes OK?

I considered this when setuptools became a requirement for python-2.3
installs, but decided against it. My reasoning was that the unfamiliar user
would go to install matplotlib, and see setup.py and ez_setup and get
confused. Maybe it should go in a subdirectory in our tree?

···

On Thursday 05 April 2007 4:29:00 am Edin Salkovic wrote:

On 3/3/07, John Hunter <jdh2358@...149...> wrote:
> On 2/23/07, Andrew Straw <strawman@...36...> wrote:
> 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""")

Apparently, there's a better solution for the above code (source
http://peak.telecommunity.com/doc/ez_setup/index.html):

This directory (svn://svn.eby-sarna.com/svnroot/ez_setup) exists so
that Subversion-based projects can share a single
copy of the ``ez_setup`` bootstrap module for ``setuptools``, and have it
automatically updated in their projects when ``setuptools`` is updated.

For your convenience, you may use the following svn:externals definition::

    ez_setup svn://svn.eby-sarna.com/svnroot/ez_setup

You can set this by executing this command in your project directory::

    svn propedit svn:externals .

And then adding the line shown above to the file that comes up for editing.
Then, whenever you update your project, ``ez_setup`` will be updated as
well. ===

We should then add the following lines to our setup.py script

from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages

This would make installing setuptools even easier, since the newest
ez_setup/seuptools would be downloaded by the user/developer every
time a "svn update;python setup.py install" is issued.

Are the above changes OK?

Just to clear things up, in case there's some misunderstanding:
ez_setup would be a dir in both cases. You are suggesting that the
ez_setup dir should be put somewhere other than in the current
matplotlib toplevel dir (where 'setup.py' resides). Am I correct? If
so, I don't see why would anyone be confused by having an ez_setup dir
at the top level, but that's just my opinion. In fact, I think that
some of the current dirs at toplevel are more confusing ;). Anyway,
either way (toplevel or subdir) is fine for me.

ez_setup dir will be there only to aid a person that's *building from
source* (normaly a dev building from SVN), so he can allways have the
latest setuptools installed on *his* system.

A person (regular user) that doesn't have setuptools installed, and
just wants to do a "easy_install matplotlib" will still have to
download the ez_setup.py script from
http://peak.telecommunity.com/dist/ez_setup.py , and run it, before
installing matplotlib. Then, he'll soon get into the problem of not
having the appropriate backend installed, but that's another problem
:slight_smile:

Cheers,
Edin

···

On 4/5/07, Darren Dale <dd55@...143...> wrote:

I considered this when setuptools became a requirement for python-2.3
installs, but decided against it. My reasoning was that the unfamiliar user
would go to install matplotlib, and see setup.py and ez_setup and get
confused. Maybe it should go in a subdirectory in our tree?

Sorry, there is some confusion, probably on my part. I was thinking of the
ez_setup.py file, which suggests that you can run it to install it, or drop
it in your distribution next to setup.py, either way would be sufficient. I
though it would be a bad idea to have a setup.py and an ez_setup.py in the
same directory. We would get people running ez_setup.py and then writing the
lists asking why they cant import pylab.

Darren

···

On Thursday 05 April 2007 06:44:36 am Edin Salkovic wrote:

On 4/5/07, Darren Dale <dd55@...143...> wrote:
> I considered this when setuptools became a requirement for python-2.3
> installs, but decided against it. My reasoning was that the unfamiliar
> user would go to install matplotlib, and see setup.py and ez_setup and
> get confused. Maybe it should go in a subdirectory in our tree?

Just to clear things up, in case there's some misunderstanding:
ez_setup would be a dir in both cases. You are suggesting that the
ez_setup dir should be put somewhere other than in the current
matplotlib toplevel dir (where 'setup.py' resides). Am I correct?

I'm not sure I see the benefit here -- what does it buy us to insure
that we always have the latest ez_setup in our tree?

JDH

···

On 4/5/07, Edin Salkovic <edin.salkovic@...149...> wrote:

This would make installing setuptools even easier, since the newest
ez_setup/seuptools would be downloaded by the user/developer every
time a "svn update;python setup.py install" is issued.

Are the above changes OK?

John Hunter wrote:

···

On 4/5/07, Edin Salkovic <edin.salkovic@...149...> wrote:

This would make installing setuptools even easier, since the newest
ez_setup/seuptools would be downloaded by the user/developer every
time a "svn update;python setup.py install" is issued.

Are the above changes OK?

I'm not sure I see the benefit here -- what does it buy us to insure
that we always have the latest ez_setup in our tree?

The purpose of ez_setup.py was to give people a migration path such that they
could write project that used setuptools, but ensure that their users wouldn't
have to go install another package themselves.

It's deprecated now. Don't use it.

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

John Hunter wrote:
  

This would make installing setuptools even easier, since the newest
ez_setup/seuptools would be downloaded by the user/developer every
time a "svn update;python setup.py install" is issued.

Are the above changes OK?
      

I'm not sure I see the benefit here -- what does it buy us to insure
that we always have the latest ez_setup in our tree?
    
The purpose of ez_setup.py was to give people a migration path such that they
could write project that used setuptools, but ensure that their users wouldn't
have to go install another package themselves.

It's deprecated now. Don't use it.
  

Furthermore, even if it weren't deprecated, it seems to me a bad idea.
(Perhaps that's why it's deprecated.) If a user needs to install
setuptools, IMO, the user should know that. For example, on most linux
distributions, the right thing to do would be to install that
distribution's package of setuptools.

···

On 4/5/07, Edin Salkovic <edin.salkovic@...149...> wrote:

So from this I take that our current approach advising people to use
ez_setup.pu if setuptools are not available is also a bad idea.
Currently we

    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. If this is your first time upgrading
matplotlib with the new setuptools requirement, you must delete the
old matplotlib install directory.""")

···

On 4/5/07, Robert Kern <robert.kern@...149...> wrote:

The purpose of ez_setup.py was to give people a migration path such that they
could write project that used setuptools, but ensure that their users wouldn't
have to go install another package themselves.

It's deprecated now. Don't use it.

John Hunter wrote:

···

On 4/5/07, Robert Kern <robert.kern@...149...> wrote:

The purpose of ez_setup.py was to give people a migration path such that they
could write project that used setuptools, but ensure that their users wouldn't
have to go install another package themselves.

It's deprecated now. Don't use it.

So from this I take that our current approach advising people to use
ez_setup.pu if setuptools are not available is also a bad idea.
Currently we

    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. If this is your first time upgrading
matplotlib with the new setuptools requirement, you must delete the
old matplotlib install directory.""")

Oh, you're requiring setuptools now? I didn't notice that. Cool.

I'd point them here for up-to-date instructions and downloads:

  http://cheeseshop.python.org/pypi/setuptools

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

Oh, you're requiring setuptools now? I didn't notice that. Cool.
  

Just for Python 2.3 so that we could sanitize the setup.py a little.
(Namely for the backport of the package_data field to setup().) It's not
required for Python >= 2.4 since package_data is already in stock
distutils there.

Thanks Robert for the insight! I updated the installation
instructions for setuptools in setup.py to point to the link you
mentioned.

Unfortunately, the official docs for setuptools
(http://peak.telecommunity.com/DevCenter/setuptools) point to
downloading ez_setup.py --- nowhere near mentioning it's deprecated.

Still, being able to point users to download one file (ez_setup.py),
and run it to install setuptools on *every* system is very tempting.
Especially, when you can point them to just run:
python ez_setup.py matplotlib
to install the latest version of matplotlib.

Edin

···

On 4/5/07, Robert Kern <robert.kern@...149...> wrote:

Oh, you're requiring setuptools now? I didn't notice that. Cool.

I'd point them here for up-to-date instructions and downloads:

  http://cheeseshop.python.org/pypi/setuptools