blob: e6238b2d1931b89d6c150d6d4e16a74d5ec3dcc7 [file] [log] [blame]
Fernando Perez36d3c162006-07-12 06:02:281#!/usr/bin/env python
Travis Oliphantc8b5a7e2006-01-06 02:12:502"""NumPy: array processing for numbers, strings, records, and objects.
Travis Oliphantda9c6da2006-01-04 17:31:073
Travis Oliphantc8b5a7e2006-01-06 02:12:504NumPy is a general-purpose array-processing package designed to
Travis Oliphantda9c6da2006-01-04 17:31:075efficiently manipulate large multi-dimensional arrays of arbitrary
6records without sacrificing too much speed for small multi-dimensional
Travis Oliphantc8b5a7e2006-01-06 02:12:507arrays. NumPy is built on the Numeric code base and adds features
Travis Oliphantda9c6da2006-01-04 17:31:078introduced by numarray as well as an extended C-API and the ability to
Travis Oliphant00a35872007-05-31 04:57:019create arrays of arbitrary type which also makes NumPy suitable for
10interfacing with general-purpose data-base applications.
Travis Oliphantda9c6da2006-01-04 17:31:0711
12There are also basic facilities for discrete fourier transform,
13basic linear algebra and random number generation.
14"""
15
16DOCLINES = __doc__.split("\n")
Pearu Petersonc415fd12002-11-18 22:39:3117
Fernando Perez083ca642007-12-30 03:04:1718import __builtin__
Pearu Petersone8fa0132003-03-07 18:08:2819import os
20import sys
Pearu Petersonc415fd12002-11-18 22:39:3121
Travis Oliphantda9c6da2006-01-04 17:31:0722CLASSIFIERS = """\
Robert Kern28042b42008-06-18 22:55:3023Development Status :: 5 - Production/Stable
Travis Oliphantda9c6da2006-01-04 17:31:0724Intended Audience :: Science/Research
25Intended Audience :: Developers
26License :: OSI Approved
27Programming Language :: C
28Programming Language :: Python
29Topic :: Software Development
30Topic :: Scientific/Engineering
31Operating System :: Microsoft :: Windows
32Operating System :: POSIX
33Operating System :: Unix
34Operating System :: MacOS
35"""
36
Fernando Perez36d3c162006-07-12 06:02:2837# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
38# update it when the contents of directories change.
39if os.path.exists('MANIFEST'): os.remove('MANIFEST')
40
Fernando Perez083ca642007-12-30 03:04:1741# This is a bit hackish: we are setting a global variable so that the main
42# numpy __init__ can detect if it is being loaded by the setup routine, to
43# avoid attempting to load components that aren't built yet. While ugly, it's
44# a lot more robust than what was previously being used.
45__builtin__.__NUMPY_SETUP__ = True
46
Pearu Peterson471196b2006-03-31 08:59:3647def configuration(parent_package='',top_path=None):
48 from numpy.distutils.misc_util import Configuration
49
Pearu Peterson17d7cfe2006-04-04 12:26:1450 config = Configuration(None, parent_package, top_path)
Pearu Peterson471196b2006-03-31 08:59:3651 config.set_options(ignore_setup_xxx_py=True,
52 assume_default_configuration=True,
53 delegate_options_to_subpackages=True,
54 quiet=True)
Jarrod Millman0b77f0e2007-10-29 14:58:1855
Pearu Peterson471196b2006-03-31 08:59:3656 config.add_subpackage('numpy')
Jarrod Millman0b77f0e2007-10-29 14:58:1857
Pearu Peterson7b76ca72007-06-05 18:54:2858 config.add_data_files(('numpy','*.txt'),
59 ('numpy','COMPATIBILITY'),
Pearu Peterson7b76ca72007-06-05 18:54:2860 ('numpy','site.cfg.example'))
Pearu Peterson17d7cfe2006-04-04 12:26:1461
62 config.get_version('numpy/version.py') # sets config.version
Travis Oliphant00a35872007-05-31 04:57:0163
Pearu Peterson471196b2006-03-31 08:59:3664 return config
65
Pearu Petersone8fa0132003-03-07 18:08:2866def setup_package():
Travis Oliphant14db4192005-09-14 22:08:4667
Travis Oliphantda9c6da2006-01-04 17:31:0768 from numpy.distutils.core import setup
Travis Oliphant14db4192005-09-14 22:08:4669
Pearu Petersone8fa0132003-03-07 18:08:2870 old_path = os.getcwd()
Pearu Petersond1906742003-11-24 22:50:4071 local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
72 os.chdir(local_path)
Travis Oliphant14db4192005-09-14 22:08:4673 sys.path.insert(0,local_path)
Pearu Petersone8fa0132003-03-07 18:08:2874
75 try:
Pearu Peterson17d7cfe2006-04-04 12:26:1476 setup(
77 name = 'numpy',
Pearu Peterson17d7cfe2006-04-04 12:26:1478 maintainer = "NumPy Developers",
79 maintainer_email = "numpy-discussion@lists.sourceforge.net",
80 description = DOCLINES[0],
81 long_description = "\n".join(DOCLINES[2:]),
Robert Kern28042b42008-06-18 22:55:3082 url = "http://numpy.scipy.org",
cookedm2276bf72006-04-21 16:15:1283 download_url = "http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103",
Pearu Peterson17d7cfe2006-04-04 12:26:1484 license = 'BSD',
85 classifiers=filter(None, CLASSIFIERS.split('\n')),
86 author = "Travis E. Oliphant, et.al.",
87 author_email = "oliphant@ee.byu.edu",
Jarrod Millman0b77f0e2007-10-29 14:58:1888 platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
Pearu Peterson17d7cfe2006-04-04 12:26:1489 configuration=configuration )
Pearu Petersone8fa0132003-03-07 18:08:2890 finally:
91 del sys.path[0]
92 os.chdir(old_path)
Travis Oliphant14db4192005-09-14 22:08:4693 return
Pearu Petersonc415fd12002-11-18 22:39:3194
Travis Oliphant14db4192005-09-14 22:08:4695if __name__ == '__main__':
Pearu Petersone8fa0132003-03-07 18:08:2896 setup_package()