Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 109 lines (89 sloc) 3.819 kb
e1eac74 @cournape Add root setupscons.py files, to start working on building numpy with nu...
cournape authored
1 #!/usr/bin/env python
2 """NumPy: array processing for numbers, strings, records, and objects.
3
4 NumPy is a general-purpose array-processing package designed to
5 efficiently manipulate large multi-dimensional arrays of arbitrary
6 records without sacrificing too much speed for small multi-dimensional
7 arrays. NumPy is built on the Numeric code base and adds features
8 introduced by numarray as well as an extended C-API and the ability to
9 create arrays of arbitrary type which also makes NumPy suitable for
10 interfacing with general-purpose data-base applications.
11
12 There are also basic facilities for discrete fourier transform,
13 basic linear algebra and random number generation.
14 """
15
16 DOCLINES = __doc__.split("\n")
17
18 import __builtin__
19 import os
20 import sys
21
22 CLASSIFIERS = """\
23 Development Status :: 4 - Beta
24 Intended Audience :: Science/Research
25 Intended Audience :: Developers
26 License :: OSI Approved
27 Programming Language :: C
28 Programming Language :: Python
29 Topic :: Software Development
30 Topic :: Scientific/Engineering
31 Operating System :: Microsoft :: Windows
32 Operating System :: POSIX
33 Operating System :: Unix
34 Operating System :: MacOS
35 """
36
37 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
38 # update it when the contents of directories change.
39 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
40
41 # 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
2f3f1a8 @cournape Import numpy.distutils before distutils, to let numpy.distutils do its m...
cournape authored
47 # DO NOT REMOVE numpy.distutils IMPORT ! This is necessary for numpy.distutils'
48 # monkey patching to work.
49 import numpy.distutils
ea5fb6f @cournape Detect if numscons is not available ASAP in top setupscons.py
cournape authored
50 from distutils.errors import DistutilsError
51 try:
52 import numscons
53 except ImportError, e:
54 msg = ["You cannot build numpy with scons without the numscons package "]
55 msg.append("(Failure was: %s)" % e)
56 raise DistutilsError('\n'.join(msg))
57
e1eac74 @cournape Add root setupscons.py files, to start working on building numpy with nu...
cournape authored
58 def configuration(parent_package='',top_path=None):
59 from numpy.distutils.misc_util import Configuration
60
61 config = Configuration(None, parent_package, top_path, setup_name = 'setupscons.py')
62 config.set_options(ignore_setup_xxx_py=True,
63 assume_default_configuration=True,
64 delegate_options_to_subpackages=True,
65 quiet=True)
66
67 config.add_subpackage('numpy')
68
69 config.add_data_files(('numpy','*.txt'),
70 ('numpy','COMPATIBILITY'),
71 ('numpy','site.cfg.example'),
72 ('numpy','setup.py'))
73
74 config.get_version('numpy/version.py') # sets config.version
75
76 return config
77
78 def setup_package():
79
80 from numpy.distutils.core import setup
81
82 old_path = os.getcwd()
83 local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
84 os.chdir(local_path)
85 sys.path.insert(0,local_path)
86
87 try:
88 setup(
89 name = 'numpy',
90 maintainer = "NumPy Developers",
91 maintainer_email = "numpy-discussion@lists.sourceforge.net",
92 description = DOCLINES[0],
93 long_description = "\n".join(DOCLINES[2:]),
94 url = "http://numeric.scipy.org",
95 download_url = "http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103",
96 license = 'BSD',
97 classifiers=filter(None, CLASSIFIERS.split('\n')),
98 author = "Travis E. Oliphant, et.al.",
99 author_email = "oliphant@ee.byu.edu",
100 platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
101 configuration=configuration )
102 finally:
103 del sys.path[0]
104 os.chdir(old_path)
105 return
106
107 if __name__ == '__main__':
108 setup_package()
Something went wrong with that request. Please try again.