Skip to content
Newer
Older
100755 173 lines (146 sloc) 5.46 KB
36d3c16 @fperez Remove MANIFEST file at startup time, since distutils fails to proper…
fperez authored Jul 12, 2006
1 #!/usr/bin/env python
c8b5a7e Fixed error in setflags and added a few unit tests for test_multiarray
Travis Oliphant authored Jan 6, 2006
2 """NumPy: array processing for numbers, strings, records, and objects.
da9c6da Fix-up setup.py
Travis Oliphant authored Jan 4, 2006
3
c8b5a7e Fixed error in setflags and added a few unit tests for test_multiarray
Travis Oliphant authored Jan 6, 2006
4 NumPy is a general-purpose array-processing package designed to
da9c6da Fix-up setup.py
Travis Oliphant authored Jan 4, 2006
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 Jan 6, 2006
7 arrays. NumPy is built on the Numeric code base and adds features
da9c6da Fix-up setup.py
Travis Oliphant authored Jan 4, 2006
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 May 31, 2007
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 Jan 4, 2006
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 Nov 18, 2002
17
083ca64 @fperez Modify the setup routine to indicate that it is being run via a system
fperez authored Dec 30, 2007
18 import __builtin__
e8fa013 @pearu scipy_core package is now functional. Usage:
pearu authored Mar 7, 2003
19 import os
20 import sys
5864bd2 @cournape ... and re
cournape authored Mar 27, 2009
21 import re
5623a7c @cournape Revert using setuptools svn revision, it is broken.
cournape authored Apr 2, 2009
22 import subprocess
c415fd1 @pearu Bundle scipy_test,scipy_distutils to scipy_core. See the header of se…
pearu authored Nov 18, 2002
23
da9c6da Fix-up setup.py
Travis Oliphant authored Jan 4, 2006
24 CLASSIFIERS = """\
19da971 @rkern PyPI metadata fixes.
rkern authored Jun 18, 2008
25 Development Status :: 5 - Production/Stable
da9c6da Fix-up setup.py
Travis Oliphant authored Jan 4, 2006
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 Mar 27, 2009
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 Mar 27, 2009
51 MAJOR = 1
52 MINOR = 4
53 MICRO = 0
a2ac985 @cournape Generate the version.py file, to help keeping the version synchronize…
cournape authored Mar 27, 2009
54 ISRELEASED = False
5e041cb @cournape Add svn parse for the full version.
cournape authored Mar 27, 2009
55 VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
56
5623a7c @cournape Revert using setuptools svn revision, it is broken.
cournape authored Apr 2, 2009
57 # Return the svn version as a string, raise a ValueError otherwise
58 def svn_version():
59 try:
60 out = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE).communicate()[0]
61 except OSError:
62 print " --- Could not run svn info --- "
63 return ""
5bb1aa5 @cournape Fix svn version detection.
cournape authored Mar 27, 2009
64
5623a7c @cournape Revert using setuptools svn revision, it is broken.
cournape authored Apr 2, 2009
65 r = re.compile('Revision: ([0-9]+)')
66 svnver = None
67 for line in out.split('\n'):
68 m = r.match(line)
69 if m:
70 svnver = m.group(1)
52fb78d @cournape Use setuptools svn rev parsing, should be more reliable ?
cournape authored Mar 27, 2009
71
5623a7c @cournape Revert using setuptools svn revision, it is broken.
cournape authored Apr 2, 2009
72 if not svnver:
73 raise ValueError("Error while parsing svn version ?")
74 return svnver
5bb1aa5 @cournape Fix svn version detection.
cournape authored Mar 27, 2009
75
36d3c16 @fperez Remove MANIFEST file at startup time, since distutils fails to proper…
fperez authored Jul 12, 2006
76 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
77 # update it when the contents of directories change.
78 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
79
083ca64 @fperez Modify the setup routine to indicate that it is being run via a system
fperez authored Dec 30, 2007
80 # This is a bit hackish: we are setting a global variable so that the main
81 # numpy __init__ can detect if it is being loaded by the setup routine, to
82 # avoid attempting to load components that aren't built yet. While ugly, it's
83 # a lot more robust than what was previously being used.
84 __builtin__.__NUMPY_SETUP__ = True
85
d8fc4ad @cournape Fix missing distutils log import .
cournape authored Apr 1, 2009
86 FULLVERSION = VERSION
87 if not ISRELEASED:
88 FULLVERSION += '.dev'
89 # If in git or something, bypass the svn rev
90 if os.path.exists('.svn'):
5623a7c @cournape Revert using setuptools svn revision, it is broken.
cournape authored Apr 2, 2009
91 FULLVERSION += svn_version()
d8fc4ad @cournape Fix missing distutils log import .
cournape authored Apr 1, 2009
92
a2ac985 @cournape Generate the version.py file, to help keeping the version synchronize…
cournape authored Mar 27, 2009
93 def write_version_py(filename='numpy/version.py'):
94 cnt = """
914bb15 @cournape Mention that version.py file is now generated.
cournape authored Mar 27, 2009
95 # THIS FILE IS GENERATED FROM NUMPY SETUP.PY
a70c483 @cournape Fix spelling mistake in version module gen.
cournape authored Mar 27, 2009
96 short_version='%(version)s'
a2ac985 @cournape Generate the version.py file, to help keeping the version synchronize…
cournape authored Mar 27, 2009
97 version='%(version)s'
98 release=%(isrelease)s
99
100 if not release:
101 version += '.dev'
102 import os
103 svn_version_file = os.path.join(os.path.dirname(__file__),
104 'core','__svn_version__.py')
105 if os.path.isfile(svn_version_file):
106 import imp
107 svn = imp.load_module('numpy.core.__svn_version__',
108 open(svn_version_file),
109 svn_version_file,
110 ('.py','U',1))
111 version += svn.version
112 """
113 a = open(filename, 'w')
114 try:
115 a.write(cnt % {'version': VERSION, 'isrelease': str(ISRELEASED)})
116 finally:
117 a.close()
118
471196b @pearu Introduced configuration kw argument to setup. This fixes long lasted…
pearu authored Mar 31, 2006
119 def configuration(parent_package='',top_path=None):
120 from numpy.distutils.misc_util import Configuration
121
17d7cfe @pearu Fix version machinery and pkg information requests.
pearu authored Apr 4, 2006
122 config = Configuration(None, parent_package, top_path)
471196b @pearu Introduced configuration kw argument to setup. This fixes long lasted…
pearu authored Mar 31, 2006
123 config.set_options(ignore_setup_xxx_py=True,
124 assume_default_configuration=True,
125 delegate_options_to_subpackages=True,
126 quiet=True)
0b77f0e @jarrodmillman ran reindent.py to clean up whitespace
jarrodmillman authored Oct 29, 2007
127
471196b @pearu Introduced configuration kw argument to setup. This fixes long lasted…
pearu authored Mar 31, 2006
128 config.add_subpackage('numpy')
0b77f0e @jarrodmillman ran reindent.py to clean up whitespace
jarrodmillman authored Oct 29, 2007
129
7b76ca7 @pearu Fix ticket 535.
pearu authored Jun 5, 2007
130 config.add_data_files(('numpy','*.txt'),
131 ('numpy','COMPATIBILITY'),
132 ('numpy','site.cfg.example'))
17d7cfe @pearu Fix version machinery and pkg information requests.
pearu authored Apr 4, 2006
133
134 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 May 31, 2007
135
471196b @pearu Introduced configuration kw argument to setup. This fixes long lasted…
pearu authored Mar 31, 2006
136 return config
137
14db419 Fixing for new distutils
Travis Oliphant authored Sep 14, 2005
138 def setup_package():
c415fd1 @pearu Bundle scipy_test,scipy_distutils to scipy_core. See the header of se…
pearu authored Nov 18, 2002
139
da9c6da Fix-up setup.py
Travis Oliphant authored Jan 4, 2006
140 from numpy.distutils.core import setup
e8fa013 @pearu scipy_core package is now functional. Usage:
pearu authored Mar 7, 2003
141
142 old_path = os.getcwd()
d190674 @pearu Now one can run 'python /full/path/to/scipy_core/setup.py'
pearu authored Nov 24, 2003
143 local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
144 os.chdir(local_path)
14db419 Fixing for new distutils
Travis Oliphant authored Sep 14, 2005
145 sys.path.insert(0,local_path)
e8fa013 @pearu scipy_core package is now functional. Usage:
pearu authored Mar 7, 2003
146
a2ac985 @cournape Generate the version.py file, to help keeping the version synchronize…
cournape authored Mar 27, 2009
147 # Rewrite the version file everytime
148 if os.path.exists('numpy/version.py'): os.remove('numpy/version.py')
149 write_version_py()
150
e8fa013 @pearu scipy_core package is now functional. Usage:
pearu authored Mar 7, 2003
151 try:
17d7cfe @pearu Fix version machinery and pkg information requests.
pearu authored Apr 4, 2006
152 setup(
c253b72 @cournape Use global for distutils metat-data, so that we can pull them from pa…
cournape authored Mar 27, 2009
153 name=NAME,
154 maintainer=MAINTAINER,
155 maintainer_email=MAINTAINER_EMAIL,
156 description=DESCRIPTION,
157 long_description=LONG_DESCRIPTION,
158 url=URL,
159 download_url=DOWNLOAD_URL,
160 license=LICENSE,
161 classifiers=CLASSIFIERS,
162 author=AUTHOR,
163 author_email=AUTHOR_EMAIL,
164 platforms=PLATFORMS,
17d7cfe @pearu Fix version machinery and pkg information requests.
pearu authored Apr 4, 2006
165 configuration=configuration )
e8fa013 @pearu scipy_core package is now functional. Usage:
pearu authored Mar 7, 2003
166 finally:
167 del sys.path[0]
168 os.chdir(old_path)
14db419 Fixing for new distutils
Travis Oliphant authored Sep 14, 2005
169 return
c415fd1 @pearu Bundle scipy_test,scipy_distutils to scipy_core. See the header of se…
pearu authored Nov 18, 2002
170
14db419 Fixing for new distutils
Travis Oliphant authored Sep 14, 2005
171 if __name__ == '__main__':
e8fa013 @pearu scipy_core package is now functional. Usage:
pearu authored Mar 7, 2003
172 setup_package()
Something went wrong with that request. Please try again.