using setuptools by default

Hi All,

I've added a hopefully innocuous few lines to matplotlib's setup.py:

···

+
+try:
+ from setuptools import setup # use setuptools if possible
+except ImportError:
+ pass
+

This will use setuptools.setup() to install matplotlib if you have
setuptools installed on your system. I assume that if you have
setuptools installed, you want to use it, hence the change. However, I
thought this may potentially cause issues for folks, so I wanted to
announce the change here.

This change should have no effect for those without setuptools. If you
do have setuptools, it also means that the matplotlib data files are now
placed in the resulting .egg. I've therefore also modified
_get_data_path() in lib/matplotlib/__init__.py to support this change.

For more information on setuptools, see
http://peak.telecommunity.com/DevCenter/setuptools

The way mpl uses the basemap toolkit will not work using
setuptools. This is also an issue that twisted runs into. Since
matplotlib will be put in one egg folder and basemap will be stuck in
another, trying to import matplotlib.toolkits.basemap will yield an
error. Just something to think about for down the road, but its
probably not a priority now.

- Charlie

···

On 12/11/05, Andrew Straw <strawman@...36...> wrote:

Hi All,

I've added a hopefully innocuous few lines to matplotlib's setup.py:

+
+try:
+ from setuptools import setup # use setuptools if possible
+except ImportError:
+ pass
+

This will use setuptools.setup() to install matplotlib if you have
setuptools installed on your system. I assume that if you have
setuptools installed, you want to use it, hence the change. However, I
thought this may potentially cause issues for folks, so I wanted to
announce the change here.

This change should have no effect for those without setuptools. If you
do have setuptools, it also means that the matplotlib data files are now
placed in the resulting .egg. I've therefore also modified
_get_data_path() in lib/matplotlib/__init__.py to support this change.

For more information on setuptools, see
setuptools - The PEAK Developers' Center

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
matplotlib-devel List Signup and Options

Charlie Moad wrote:

     The way mpl uses the basemap toolkit will not work using
setuptools. This is also an issue that twisted runs into. Since
matplotlib will be put in one egg folder and basemap will be stuck in
another, trying to import matplotlib.toolkits.basemap will yield an
error. Just something to think about for down the road, but its
probably not a priority now.

That's why setuptools/eggs have the concept of namespace packages. Both the
matplotlib egg and basemap egg provide the matplotlib.toolkits namespace package.

E.g.:

setup(#...
      namespace_packages=['matplotlib.toolkits'],
)

···

--
Robert Kern
robert.kern@...149...

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

That's great to hear! Thanks for the info. I am just surprised I
have not seen this response when it has came up on the twisted list.

- Charlie

···

On 12/12/05, Robert Kern <robert.kern@...149...> wrote:

Charlie Moad wrote:
> The way mpl uses the basemap toolkit will not work using
> setuptools. This is also an issue that twisted runs into. Since
> matplotlib will be put in one egg folder and basemap will be stuck in
> another, trying to import matplotlib.toolkits.basemap will yield an
> error. Just something to think about for down the road, but its
> probably not a priority now.

That's why setuptools/eggs have the concept of namespace packages. Both the
matplotlib egg and basemap egg provide the matplotlib.toolkits namespace package.

E.g.:

setup(#...
      namespace_packages=['matplotlib.toolkits'],
)

--
Robert Kern
robert.kern@...149...

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

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
matplotlib-devel List Signup and Options

Charlie Moad wrote:

That's great to hear! Thanks for the info. I am just surprised I
have not seen this response when it has came up on the twisted list.

I, too, find that bizarre since Twisted and Zope were *the* reasons for that
feature.

···

--
Robert Kern
robert.kern@...149...

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