Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 121 lines (99 sloc) 4.161 kB
e1eac74 @cournape Add root setupscons.py files, to start working on building numpy with…
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
653653a @cournape Fix setupscons.py so that the version.py is correctly generated.
cournape authored
41 sys.path.insert(0, os.path.dirname(__file__))
42 try:
43 setup_py = __import__("setup")
44 FULLVERSION = setup_py.FULLVERSION
45 write_version_py = setup_py.write_version_py
46 finally:
47 sys.path.pop(0)
48
e1eac74 @cournape Add root setupscons.py files, to start working on building numpy with…
cournape authored
49 # This is a bit hackish: we are setting a global variable so that the main
50 # numpy __init__ can detect if it is being loaded by the setup routine, to
51 # avoid attempting to load components that aren't built yet. While ugly, it's
52 # a lot more robust than what was previously being used.
53 __builtin__.__NUMPY_SETUP__ = True
54
2f3f1a8 @cournape Import numpy.distutils before distutils, to let numpy.distutils do it…
cournape authored
55 # DO NOT REMOVE numpy.distutils IMPORT ! This is necessary for numpy.distutils'
56 # monkey patching to work.
57 import numpy.distutils
ea5fb6f @cournape Detect if numscons is not available ASAP in top setupscons.py
cournape authored
58 from distutils.errors import DistutilsError
59 try:
60 import numscons
61 except ImportError, e:
62 msg = ["You cannot build numpy with scons without the numscons package "]
63 msg.append("(Failure was: %s)" % e)
64 raise DistutilsError('\n'.join(msg))
65
e1eac74 @cournape Add root setupscons.py files, to start working on building numpy with…
cournape authored
66 def configuration(parent_package='',top_path=None):
67 from numpy.distutils.misc_util import Configuration
68
69 config = Configuration(None, parent_package, top_path, setup_name = 'setupscons.py')
70 config.set_options(ignore_setup_xxx_py=True,
71 assume_default_configuration=True,
72 delegate_options_to_subpackages=True,
73 quiet=True)
74
75 config.add_subpackage('numpy')
76
77 config.add_data_files(('numpy','*.txt'),
78 ('numpy','COMPATIBILITY'),
79 ('numpy','site.cfg.example'),
80 ('numpy','setup.py'))
81
82 config.get_version('numpy/version.py') # sets config.version
83
84 return config
85
86 def setup_package():
87
88 from numpy.distutils.core import setup
89
90 old_path = os.getcwd()
91 local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
92 os.chdir(local_path)
93 sys.path.insert(0,local_path)
94
653653a @cournape Fix setupscons.py so that the version.py is correctly generated.
cournape authored
95 # Rewrite the version file everytime
96 if os.path.exists('numpy/version.py'): os.remove('numpy/version.py')
97 write_version_py()
98
e1eac74 @cournape Add root setupscons.py files, to start working on building numpy with…
cournape authored
99 try:
100 setup(
101 name = 'numpy',
102 maintainer = "NumPy Developers",
103 maintainer_email = "numpy-discussion@lists.sourceforge.net",
104 description = DOCLINES[0],
105 long_description = "\n".join(DOCLINES[2:]),
106 url = "http://numeric.scipy.org",
107 download_url = "http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103",
108 license = 'BSD',
109 classifiers=filter(None, CLASSIFIERS.split('\n')),
110 author = "Travis E. Oliphant, et.al.",
111 author_email = "oliphant@ee.byu.edu",
112 platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
113 configuration=configuration )
114 finally:
115 del sys.path[0]
116 os.chdir(old_path)
117 return
118
119 if __name__ == '__main__':
120 setup_package()
Something went wrong with that request. Please try again.