From: <ef...@us...> - 2008-04-25 16:45:36
|
Revision: 5075 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5075&view=rev Author: efiring Date: 2008-04-25 09:45:30 -0700 (Fri, 25 Apr 2008) Log Message: ----------- Enforce python 2.4 or later; some other version-related cleanup Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/__init__.py trunk/matplotlib/setup.py trunk/matplotlib/setupext.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-04-25 15:43:06 UTC (rev 5074) +++ trunk/matplotlib/CHANGELOG 2008-04-25 16:45:30 UTC (rev 5075) @@ -1,4 +1,7 @@ +2008-04-25 Enforce python >= 2.4; remove subprocess build - EF +2008-04-25 Enforce the numpy requirement at build time - JDH + 2008-04-24 Make numpy 1.1 and python 2.3 required when importing matplotlib - EF Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2008-04-25 15:43:06 UTC (rev 5074) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2008-04-25 16:45:30 UTC (rev 5075) @@ -95,10 +95,8 @@ from rcsetup import validate_cairo_format major, minor1, minor2, s, tmp = sys.version_info -_python23 = major>=2 and minor1>=3 +_python24 = major>=2 and minor1>=4 -_havemath = _python23 - try: import datetime import dateutil @@ -111,14 +109,14 @@ #except ImportError: _have_pkg_resources = False #else: _have_pkg_resources = True -if not _python23: - raise SystemExit('matplotlib requires Python 2.3 or later') +if not _python24: + raise SystemExit('matplotlib requires Python 2.4 or later') import numpy nn = numpy.__version__.split('.') if not (int(nn[0]) >= 1 and int(nn[1]) >= 1): raise SystemExit( - 'numpy >= 1.1 is required; you have %s' % numpy.__version__) + 'numpy 1.1 or later is required; you have %s' % numpy.__version__) def is_string_like(obj): if hasattr(obj, 'shape'): return 0 Modified: trunk/matplotlib/setup.py =================================================================== --- trunk/matplotlib/setup.py 2008-04-25 15:43:06 UTC (rev 5074) +++ trunk/matplotlib/setup.py 2008-04-25 16:45:30 UTC (rev 5075) @@ -20,28 +20,15 @@ import sys major, minor1, minor2, s, tmp = sys.version_info -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 with python-2.3. Visit: -http://cheeseshop.python.org/pypi/setuptools -for installation instructions for 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.""") +if major==2 and minor1<4 or major<2: + raise SystemExit("""matplotlib requires Python 2.4 or later.""") -if major==2 and minor1<3 or major<2: - raise SystemExit("""matplotlib requires Python 2.3 or later.""") - import glob from distutils.core import setup from setupext import build_agg, build_gtkagg, build_tkagg, build_wxagg,\ build_ft2font, build_image, build_windowing, build_path, \ build_contour, build_nxutils, build_traits, build_gdk, \ - build_subprocess, build_ttconv, print_line, print_status, print_message, \ + build_ttconv, print_line, print_status, print_message, \ print_raw, check_for_freetype, check_for_libpng, check_for_gtk, \ check_for_tk, check_for_wx, check_for_numpy, check_for_qt, check_for_qt4, \ check_for_cairo, check_provide_traits, check_provide_pytz, \ @@ -100,25 +87,8 @@ ]} if not check_for_numpy(): - sys.exit() + sys.exit(1) -try: import subprocess -except ImportError: havesubprocess = False -else: havesubprocess = True - -if havesubprocess and sys.version < '2.4': - # Python didn't come with subprocess, so let's make sure it's - # not in some Python egg (e.g. an older version of matplotlib) - # that may get removed. - subprocess_dir = os.path.dirname(subprocess.__file__) - if subprocess_dir.endswith('.egg/subprocess'): - havesubprocess = False - -if not havesubprocess: - packages.append('subprocess') - if sys.platform == 'win32': - build_subprocess(ext_modules, packages) - if not check_for_freetype(): sys.exit(1) Modified: trunk/matplotlib/setupext.py =================================================================== --- trunk/matplotlib/setupext.py 2008-04-25 15:43:06 UTC (rev 5074) +++ trunk/matplotlib/setupext.py 2008-04-25 16:45:30 UTC (rev 5075) @@ -532,21 +532,17 @@ return False def check_for_numpy(): - gotit = False try: import numpy except ImportError: print_status("numpy", "no") - print_message("You must install numpy to build matplotlib.") - return False - - major, minor1, minor2 = map(int, numpy.__version__.split('.')[:3]) - if major<1 or (major==1 and minor1<1): - print_status("numpy version", "no") print_message("You must install numpy 1.1 or later to build matplotlib.") - return False - + nn = numpy.__version__.split('.') + if not (int(nn[0]) >= 1 and int(nn[1]) >= 1): + print_message( + 'numpy 1.1 or later is required; you have %s' % numpy.__version__) + return False module = Extension('test', []) add_numpy_flags(module) add_base_flags(module) @@ -554,16 +550,13 @@ print_status("numpy", numpy.__version__) if not find_include_file(module.include_dirs, os.path.join("numpy", "arrayobject.h")): print_message("Could not find the headers for numpy. You may need to install the development package.") + return False return True def add_numpy_flags(module): "Add the modules flags to build extensions which use numpy" import numpy - # TODO: Remove this try statement when it is no longer needed - try: - module.include_dirs.append(numpy.get_include()) - except AttributeError: - module.include_dirs.append(numpy.get_numpy_include()) + module.include_dirs.append(numpy.get_include()) def add_agg_flags(module): 'Add the module flags to build extensions which use agg' @@ -1267,10 +1260,3 @@ BUILT_GDK = True -def build_subprocess(ext_modules, packages): - module = Extension( - 'subprocess._subprocess', - ['src/_subprocess.c', ], - ) - add_base_flags(module) - ext_modules.append(module) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |