Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 166 lines (140 sloc) 5.462 kb
36d3c16 Fernando Perez Remove MANIFEST file at startup time, since distutils fails to properly ...
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 extra...
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 Peterson Bundle scipy_test,scipy_distutils to scipy_core. See the header of setup...
pearu authored
17
083ca64 Fernando Perez Modify the setup routine to indicate that it is being run via a system
fperez authored
18 import __builtin__
e8fa013 Pearu Peterson scipy_core package is now functional. Usage:
pearu authored
19 import os
20 import sys
c415fd1 Pearu Peterson Bundle scipy_test,scipy_distutils to scipy_core. See the header of setup...
pearu authored
21
da9c6da Fix-up setup.py
Travis Oliphant authored
22 CLASSIFIERS = """\
19da971 Robert Kern PyPI metadata fixes.
rkern authored
23 Development Status :: 5 - Production/Stable
da9c6da Fix-up setup.py
Travis Oliphant authored
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
cc9a446 David Cournapeau Fix metadata incorrectly defined as tuples.
cournape authored
37 NAME = 'numpy'
38 MAINTAINER = "NumPy Developers"
39 MAINTAINER_EMAIL = "numpy-discussion@scipy.org"
40 DESCRIPTION = DOCLINES[0]
41 LONG_DESCRIPTION = "\n".join(DOCLINES[2:])
42 URL = "http://numpy.scipy.org"
43 DOWNLOAD_URL = "http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103"
44 LICENSE = 'BSD'
45 CLASSIFIERS = filter(None, CLASSIFIERS.split('\n'))
46 AUTHOR = "Travis E. Oliphant, et.al."
47 AUTHOR_EMAIL = "oliphant@enthought.com"
48 PLATFORMS = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"]
5e041cb David Cournapeau Add svn parse for the full version.
cournape authored
49 MAJOR = 1
50 MINOR = 4
51 MICRO = 0
a2ac985 David Cournapeau Generate the version.py file, to help keeping the version synchronized e...
cournape authored
52 ISRELEASED = False
5e041cb David Cournapeau Add svn parse for the full version.
cournape authored
53 VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
54
5bb1aa5 David Cournapeau Fix svn version detection.
cournape authored
55 # Return the svn version as a string, raise a ValueError otherwise
56 def svn_version():
57 out = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE).communicate()[0]
58 r = re.compile('Revision: ([0-9]+)')
59 svnver = None
60 for line in out.split('\n'):
61 m = r.match(line)
62 if m:
63 svnver = m.group(1)
64
65 if not svnver:
66 raise ValueError("Error while parsing svn version ?")
67 return svnver
68
5e041cb David Cournapeau Add svn parse for the full version.
cournape authored
69 FULLVERSION = VERSION
70 if not ISRELEASED:
71 FULLVERSION += '.dev'
72 # If in git or something, bypass the svn rev
5bb1aa5 David Cournapeau Fix svn version detection.
cournape authored
73 if os.path.exists('.svn'):
5e041cb David Cournapeau Add svn parse for the full version.
cournape authored
74 FULLVERSION += svn_version()
c253b72 David Cournapeau Use global for distutils metat-data, so that we can pull them from paver...
cournape authored
75
36d3c16 Fernando Perez Remove MANIFEST file at startup time, since distutils fails to properly ...
fperez authored
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 Fernando Perez Modify the setup routine to indicate that it is being run via a system
fperez authored
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
a2ac985 David Cournapeau Generate the version.py file, to help keeping the version synchronized e...
cournape authored
86 def write_version_py(filename='numpy/version.py'):
87 cnt = """
914bb15 David Cournapeau Mention that version.py file is now generated.
cournape authored
88 # THIS FILE IS GENERATED FROM NUMPY SETUP.PY
a70c483 David Cournapeau Fix spelling mistake in version module gen.
cournape authored
89 short_version='%(version)s'
a2ac985 David Cournapeau Generate the version.py file, to help keeping the version synchronized e...
cournape authored
90 version='%(version)s'
91 release=%(isrelease)s
92
93 if not release:
94 version += '.dev'
95 import os
96 svn_version_file = os.path.join(os.path.dirname(__file__),
97 'core','__svn_version__.py')
98 if os.path.isfile(svn_version_file):
99 import imp
100 svn = imp.load_module('numpy.core.__svn_version__',
101 open(svn_version_file),
102 svn_version_file,
103 ('.py','U',1))
104 version += svn.version
105 """
106 a = open(filename, 'w')
107 try:
108 a.write(cnt % {'version': VERSION, 'isrelease': str(ISRELEASED)})
109 finally:
110 a.close()
111
471196b Pearu Peterson Introduced configuration kw argument to setup. This fixes long lasted lo...
pearu authored
112 def configuration(parent_package='',top_path=None):
113 from numpy.distutils.misc_util import Configuration
114
17d7cfe Pearu Peterson Fix version machinery and pkg information requests.
pearu authored
115 config = Configuration(None, parent_package, top_path)
471196b Pearu Peterson Introduced configuration kw argument to setup. This fixes long lasted lo...
pearu authored
116 config.set_options(ignore_setup_xxx_py=True,
117 assume_default_configuration=True,
118 delegate_options_to_subpackages=True,
119 quiet=True)
0b77f0e Jarrod Millman ran reindent.py to clean up whitespace
jarrodmillman authored
120
471196b Pearu Peterson Introduced configuration kw argument to setup. This fixes long lasted lo...
pearu authored
121 config.add_subpackage('numpy')
0b77f0e Jarrod Millman ran reindent.py to clean up whitespace
jarrodmillman authored
122
7b76ca7 Pearu Peterson Fix ticket 535.
pearu authored
123 config.add_data_files(('numpy','*.txt'),
124 ('numpy','COMPATIBILITY'),
125 ('numpy','site.cfg.example'))
17d7cfe Pearu Peterson Fix version machinery and pkg information requests.
pearu authored
126
127 config.get_version('numpy/version.py') # sets config.version
00a3587 Fix some problems with data-files not being added in top-level and extra...
Travis Oliphant authored
128
471196b Pearu Peterson Introduced configuration kw argument to setup. This fixes long lasted lo...
pearu authored
129 return config
130
14db419 Fixing for new distutils
Travis Oliphant authored
131 def setup_package():
c415fd1 Pearu Peterson Bundle scipy_test,scipy_distutils to scipy_core. See the header of setup...
pearu authored
132
da9c6da Fix-up setup.py
Travis Oliphant authored
133 from numpy.distutils.core import setup
e8fa013 Pearu Peterson scipy_core package is now functional. Usage:
pearu authored
134
135 old_path = os.getcwd()
d190674 Pearu Peterson Now one can run 'python /full/path/to/scipy_core/setup.py'
pearu authored
136 local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
137 os.chdir(local_path)
14db419 Fixing for new distutils
Travis Oliphant authored
138 sys.path.insert(0,local_path)
e8fa013 Pearu Peterson scipy_core package is now functional. Usage:
pearu authored
139
a2ac985 David Cournapeau Generate the version.py file, to help keeping the version synchronized e...
cournape authored
140 # Rewrite the version file everytime
141 if os.path.exists('numpy/version.py'): os.remove('numpy/version.py')
142 write_version_py()
143
e8fa013 Pearu Peterson scipy_core package is now functional. Usage:
pearu authored
144 try:
17d7cfe Pearu Peterson Fix version machinery and pkg information requests.
pearu authored
145 setup(
c253b72 David Cournapeau Use global for distutils metat-data, so that we can pull them from paver...
cournape authored
146 name=NAME,
147 maintainer=MAINTAINER,
148 maintainer_email=MAINTAINER_EMAIL,
149 description=DESCRIPTION,
150 long_description=LONG_DESCRIPTION,
151 url=URL,
152 download_url=DOWNLOAD_URL,
153 license=LICENSE,
154 classifiers=CLASSIFIERS,
155 author=AUTHOR,
156 author_email=AUTHOR_EMAIL,
157 platforms=PLATFORMS,
17d7cfe Pearu Peterson Fix version machinery and pkg information requests.
pearu authored
158 configuration=configuration )
e8fa013 Pearu Peterson scipy_core package is now functional. Usage:
pearu authored
159 finally:
160 del sys.path[0]
161 os.chdir(old_path)
14db419 Fixing for new distutils
Travis Oliphant authored
162 return
c415fd1 Pearu Peterson Bundle scipy_test,scipy_distutils to scipy_core. See the header of setup...
pearu authored
163
14db419 Fixing for new distutils
Travis Oliphant authored
164 if __name__ == '__main__':
e8fa013 Pearu Peterson scipy_core package is now functional. Usage:
pearu authored
165 setup_package()
Something went wrong with that request. Please try again.