Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 125 lines (102 sloc) 4.261 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
322c67e @cournape MISC: warn about numscons scripts being deprecated.
cournape authored
21 import warnings
22
23 warnings.warn("""\
24 Numscons scripts are being deprecated - most of numscons features should now be
25 supported by bento""")
e1eac74 @cournape Add root setupscons.py files, to start working on building numpy with nu...
cournape authored
26
27 CLASSIFIERS = """\
28 Development Status :: 4 - Beta
29 Intended Audience :: Science/Research
30 Intended Audience :: Developers
31 License :: OSI Approved
32 Programming Language :: C
33 Programming Language :: Python
34 Topic :: Software Development
35 Topic :: Scientific/Engineering
36 Operating System :: Microsoft :: Windows
37 Operating System :: POSIX
38 Operating System :: Unix
39 Operating System :: MacOS
40 """
41
42 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
43 # update it when the contents of directories change.
44 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
45
653653a @cournape Fix setupscons.py so that the version.py is correctly generated.
cournape authored
46 sys.path.insert(0, os.path.dirname(__file__))
47 try:
48 setup_py = __import__("setup")
49 write_version_py = setup_py.write_version_py
50 finally:
51 sys.path.pop(0)
52
e1eac74 @cournape Add root setupscons.py files, to start working on building numpy with nu...
cournape authored
53 # This is a bit hackish: we are setting a global variable so that the main
54 # numpy __init__ can detect if it is being loaded by the setup routine, to
55 # avoid attempting to load components that aren't built yet. While ugly, it's
56 # a lot more robust than what was previously being used.
57 __builtin__.__NUMPY_SETUP__ = True
58
2f3f1a8 @cournape Import numpy.distutils before distutils, to let numpy.distutils do its m...
cournape authored
59 # DO NOT REMOVE numpy.distutils IMPORT ! This is necessary for numpy.distutils'
60 # monkey patching to work.
61 import numpy.distutils
ea5fb6f @cournape Detect if numscons is not available ASAP in top setupscons.py
cournape authored
62 from distutils.errors import DistutilsError
63 try:
64 import numscons
65 except ImportError, e:
66 msg = ["You cannot build numpy with scons without the numscons package "]
67 msg.append("(Failure was: %s)" % e)
68 raise DistutilsError('\n'.join(msg))
69
e1eac74 @cournape Add root setupscons.py files, to start working on building numpy with nu...
cournape authored
70 def configuration(parent_package='',top_path=None):
71 from numpy.distutils.misc_util import Configuration
72
73 config = Configuration(None, parent_package, top_path, setup_name = 'setupscons.py')
74 config.set_options(ignore_setup_xxx_py=True,
75 assume_default_configuration=True,
76 delegate_options_to_subpackages=True,
77 quiet=True)
78
79 config.add_subpackage('numpy')
80
81 config.add_data_files(('numpy','*.txt'),
82 ('numpy','COMPATIBILITY'),
83 ('numpy','site.cfg.example'),
84 ('numpy','setup.py'))
85
86 config.get_version('numpy/version.py') # sets config.version
87
88 return config
89
90 def setup_package():
91
92 from numpy.distutils.core import setup
93
94 old_path = os.getcwd()
95 local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
96 os.chdir(local_path)
97 sys.path.insert(0,local_path)
98
653653a @cournape Fix setupscons.py so that the version.py is correctly generated.
cournape authored
99 # Rewrite the version file everytime
100 if os.path.exists('numpy/version.py'): os.remove('numpy/version.py')
101 write_version_py()
102
e1eac74 @cournape Add root setupscons.py files, to start working on building numpy with nu...
cournape authored
103 try:
104 setup(
105 name = 'numpy',
106 maintainer = "NumPy Developers",
107 maintainer_email = "numpy-discussion@lists.sourceforge.net",
108 description = DOCLINES[0],
109 long_description = "\n".join(DOCLINES[2:]),
110 url = "http://numeric.scipy.org",
111 download_url = "http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103",
112 license = 'BSD',
113 classifiers=filter(None, CLASSIFIERS.split('\n')),
114 author = "Travis E. Oliphant, et.al.",
115 author_email = "oliphant@ee.byu.edu",
116 platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
117 configuration=configuration )
118 finally:
119 del sys.path[0]
120 os.chdir(old_path)
121 return
122
123 if __name__ == '__main__':
124 setup_package()
Something went wrong with that request. Please try again.