Skip to content
Newer
Older
100755 168 lines (142 sloc) 5.36 KB
36d3c16 @fperez Remove MANIFEST file at startup time, since distutils fails to proper…
fperez authored
1 #!/usr/bin/env python
c8b5a7e Fixed error in setflags and added a few unit tests for test_multiarray
Travis Oliphant authored
2 """NumPy: array processing for numbers, strings, records, and objects.
da9c6da Fix-up setup.py
Travis Oliphant authored
3
c8b5a7e Fixed error in setflags and added a few unit tests for test_multiarray
Travis Oliphant authored
4 NumPy is a general-purpose array-processing package designed to
da9c6da Fix-up setup.py
Travis Oliphant authored
5 efficiently manipulate large multi-dimensional arrays of arbitrary
6 records without sacrificing too much speed for small multi-dimensional
c8b5a7e Fixed error in setflags and added a few unit tests for test_multiarray
Travis Oliphant authored
7 arrays. NumPy is built on the Numeric code base and adds features
da9c6da Fix-up setup.py
Travis Oliphant authored
8 introduced by numarray as well as an extended C-API and the ability to
00a3587 Fix some problems with data-files not being added in top-level and ex…
Travis Oliphant authored
9 create arrays of arbitrary type which also makes NumPy suitable for
10 interfacing with general-purpose data-base applications.
da9c6da Fix-up setup.py
Travis Oliphant authored
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")
c415fd1 @pearu Bundle scipy_test,scipy_distutils to scipy_core. See the header of se…
pearu authored
17
083ca64 @fperez Modify the setup routine to indicate that it is being run via a system
fperez authored
18 import __builtin__
b60cd14 @cournape Forgot to import subprocess.
cournape authored
19 import subprocess
e8fa013 @pearu scipy_core package is now functional. Usage:
pearu authored
20 import os
21 import sys
5864bd2 @cournape ... and re
cournape authored
22 import re
c415fd1 @pearu Bundle scipy_test,scipy_distutils to scipy_core. See the header of se…
pearu authored
23
da9c6da Fix-up setup.py
Travis Oliphant authored
24 CLASSIFIERS = """\
19da971 @rkern PyPI metadata fixes.
rkern authored
25 Development Status :: 5 - Production/Stable
da9c6da Fix-up setup.py
Travis Oliphant authored
26 Intended Audience :: Science/Research
27 Intended Audience :: Developers
28 License :: OSI Approved
29 Programming Language :: C
30 Programming Language :: Python
31 Topic :: Software Development
32 Topic :: Scientific/Engineering
33 Operating System :: Microsoft :: Windows
34 Operating System :: POSIX
35 Operating System :: Unix
36 Operating System :: MacOS
37 """
38
cc9a446 @cournape Fix metadata incorrectly defined as tuples.
cournape authored
39 NAME = 'numpy'
40 MAINTAINER = "NumPy Developers"
41 MAINTAINER_EMAIL = "numpy-discussion@scipy.org"
42 DESCRIPTION = DOCLINES[0]
43 LONG_DESCRIPTION = "\n".join(DOCLINES[2:])
44 URL = "http://numpy.scipy.org"
45 DOWNLOAD_URL = "http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103"
46 LICENSE = 'BSD'
47 CLASSIFIERS = filter(None, CLASSIFIERS.split('\n'))
48 AUTHOR = "Travis E. Oliphant, et.al."
49 AUTHOR_EMAIL = "oliphant@enthought.com"
50 PLATFORMS = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"]
5e041cb @cournape Add svn parse for the full version.
cournape authored
51 MAJOR = 1
52 MINOR = 4
53 MICRO = 0
a2ac985 @cournape Generate the version.py file, to help keeping the version synchronize…
cournape authored
54 ISRELEASED = False
5e041cb @cournape Add svn parse for the full version.
cournape authored
55 VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
56
5bb1aa5 @cournape Fix svn version detection.
cournape authored
57 # Return the svn version as a string, raise a ValueError otherwise
58 def svn_version():
59 out = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE).communicate()[0]
60 r = re.compile('Revision: ([0-9]+)')
61 svnver = None
62 for line in out.split('\n'):
63 m = r.match(line)
64 if m:
65 svnver = m.group(1)
66
67 if not svnver:
68 raise ValueError("Error while parsing svn version ?")
69 return svnver
70
5e041cb @cournape Add svn parse for the full version.
cournape authored
71 FULLVERSION = VERSION
72 if not ISRELEASED:
73 FULLVERSION += '.dev'
74 # If in git or something, bypass the svn rev
5bb1aa5 @cournape Fix svn version detection.
cournape authored
75 if os.path.exists('.svn'):
5e041cb @cournape Add svn parse for the full version.
cournape authored
76 FULLVERSION += svn_version()
c253b72 @cournape Use global for distutils metat-data, so that we can pull them from pa…
cournape authored
77
36d3c16 @fperez Remove MANIFEST file at startup time, since distutils fails to proper…
fperez authored
78 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
79 # update it when the contents of directories change.
80 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
81
083ca64 @fperez Modify the setup routine to indicate that it is being run via a system
fperez authored
82 # This is a bit hackish: we are setting a global variable so that the main
83 # numpy __init__ can detect if it is being loaded by the setup routine, to
84 # avoid attempting to load components that aren't built yet. While ugly, it's
85 # a lot more robust than what was previously being used.
86 __builtin__.__NUMPY_SETUP__ = True
87
a2ac985 @cournape Generate the version.py file, to help keeping the version synchronize…
cournape authored
88 def write_version_py(filename='numpy/version.py'):
89 cnt = """
914bb15 @cournape Mention that version.py file is now generated.
cournape authored
90 # THIS FILE IS GENERATED FROM NUMPY SETUP.PY
a70c483 @cournape Fix spelling mistake in version module gen.
cournape authored
91 short_version='%(version)s'
a2ac985 @cournape Generate the version.py file, to help keeping the version synchronize…
cournape authored
92 version='%(version)s'
93 release=%(isrelease)s
94
95 if not release:
96 version += '.dev'
97 import os
98 svn_version_file = os.path.join(os.path.dirname(__file__),
99 'core','__svn_version__.py')
100 if os.path.isfile(svn_version_file):
101 import imp
102 svn = imp.load_module('numpy.core.__svn_version__',
103 open(svn_version_file),
104 svn_version_file,
105 ('.py','U',1))
106 version += svn.version
107 """
108 a = open(filename, 'w')
109 try:
110 a.write(cnt % {'version': VERSION, 'isrelease': str(ISRELEASED)})
111 finally:
112 a.close()
113
471196b @pearu Introduced configuration kw argument to setup. This fixes long lasted…
pearu authored
114 def configuration(parent_package='',top_path=None):
115 from numpy.distutils.misc_util import Configuration
116
17d7cfe @pearu Fix version machinery and pkg information requests.
pearu authored
117 config = Configuration(None, parent_package, top_path)
471196b @pearu Introduced configuration kw argument to setup. This fixes long lasted…
pearu authored
118 config.set_options(ignore_setup_xxx_py=True,
119 assume_default_configuration=True,
120 delegate_options_to_subpackages=True,
121 quiet=True)
0b77f0e @jarrodmillman ran reindent.py to clean up whitespace
jarrodmillman authored
122
471196b @pearu Introduced configuration kw argument to setup. This fixes long lasted…
pearu authored
123 config.add_subpackage('numpy')
0b77f0e @jarrodmillman ran reindent.py to clean up whitespace
jarrodmillman authored
124
7b76ca7 @pearu Fix ticket 535.
pearu authored
125 config.add_data_files(('numpy','*.txt'),
126 ('numpy','COMPATIBILITY'),
127 ('numpy','site.cfg.example'))
17d7cfe @pearu Fix version machinery and pkg information requests.
pearu authored
128
129 config.get_version('numpy/version.py') # sets config.version
00a3587 Fix some problems with data-files not being added in top-level and ex…
Travis Oliphant authored
130
471196b @pearu Introduced configuration kw argument to setup. This fixes long lasted…
pearu authored
131 return config
132
14db419 Fixing for new distutils
Travis Oliphant authored
133 def setup_package():
c415fd1 @pearu Bundle scipy_test,scipy_distutils to scipy_core. See the header of se…
pearu authored
134
da9c6da Fix-up setup.py
Travis Oliphant authored
135 from numpy.distutils.core import setup
e8fa013 @pearu scipy_core package is now functional. Usage:
pearu authored
136
137 old_path = os.getcwd()
d190674 @pearu Now one can run 'python /full/path/to/scipy_core/setup.py'
pearu authored
138 local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
139 os.chdir(local_path)
14db419 Fixing for new distutils
Travis Oliphant authored
140 sys.path.insert(0,local_path)
e8fa013 @pearu scipy_core package is now functional. Usage:
pearu authored
141
a2ac985 @cournape Generate the version.py file, to help keeping the version synchronize…
cournape authored
142 # Rewrite the version file everytime
143 if os.path.exists('numpy/version.py'): os.remove('numpy/version.py')
144 write_version_py()
145
e8fa013 @pearu scipy_core package is now functional. Usage:
pearu authored
146 try:
17d7cfe @pearu Fix version machinery and pkg information requests.
pearu authored
147 setup(
c253b72 @cournape Use global for distutils metat-data, so that we can pull them from pa…
cournape authored
148 name=NAME,
149 maintainer=MAINTAINER,
150 maintainer_email=MAINTAINER_EMAIL,
151 description=DESCRIPTION,
152 long_description=LONG_DESCRIPTION,
153 url=URL,
154 download_url=DOWNLOAD_URL,
155 license=LICENSE,
156 classifiers=CLASSIFIERS,
157 author=AUTHOR,
158 author_email=AUTHOR_EMAIL,
159 platforms=PLATFORMS,
17d7cfe @pearu Fix version machinery and pkg information requests.
pearu authored
160 configuration=configuration )
e8fa013 @pearu scipy_core package is now functional. Usage:
pearu authored
161 finally:
162 del sys.path[0]
163 os.chdir(old_path)
14db419 Fixing for new distutils
Travis Oliphant authored
164 return
c415fd1 @pearu Bundle scipy_test,scipy_distutils to scipy_core. See the header of se…
pearu authored
165
14db419 Fixing for new distutils
Travis Oliphant authored
166 if __name__ == '__main__':
e8fa013 @pearu scipy_core package is now functional. Usage:
pearu authored
167 setup_package()
Something went wrong with that request. Please try again.