~jtaylor/ubuntu/precise/python-numpy/multiarch-fix-818867

« back to all changes in this revision

Viewing changes to setupscons.py

  • Committer: Bazaar Package Importer
  • Author(s): Ondrej Certik, Riku Voipio, Tiziano Zito, Carlos Galisteo, Ondrej Certik
  • Date: 2008-07-08 15:08:16 UTC
  • mfrom: (0.1.21 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080708150816-ekf992jcp2k1eua3
Tags: 1:1.1.0-3
[ Riku Voipio ]
* debian/control: atlas is not available on armel, and after a quick look
  neither on alpha. I'd also suggest dropping
  libatlas-sse-dev|libatlas-sse2-dev|libatlas-3dnow-dev alternative combo
  away, these are potentially dangerous on buildd's. Ondrej: dropped.
  (Closes: #489568)

[ Tiziano Zito ]
* patch: build _dotblas.c when ATLAS is not installed, build-conflict with
  atlas, build-depend on blas+lapack only, as it used to be (Closes: #489726)

[ Carlos Galisteo ]
* debian/control
  - Added Homepage field.

[ Ondrej Certik ]
* Checked the package on i386 and amd64, both with and without atlas, all
  tests run and the numpy package is faster if atlas is around. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
41
# This is a bit hackish: we are setting a global variable so that the main
 
42
# numpy __init__ can detect if it is being loaded by the setup routine, to
 
43
# avoid attempting to load components that aren't built yet.  While ugly, it's
 
44
# a lot more robust than what was previously being used.
 
45
__builtin__.__NUMPY_SETUP__ = True
 
46
 
 
47
# DO NOT REMOVE numpy.distutils IMPORT ! This is necessary for numpy.distutils'
 
48
# monkey patching to work.
 
49
import numpy.distutils
 
50
from distutils.errors import DistutilsError
 
51
try:
 
52
    import numscons
 
53
except ImportError, e:
 
54
    msg = ["You cannot build numpy with scons without the numscons package "]
 
55
    msg.append("(Failure was: %s)" % e)
 
56
    raise DistutilsError('\n'.join(msg))
 
57
 
 
58
def configuration(parent_package='',top_path=None):
 
59
    from numpy.distutils.misc_util import Configuration
 
60
 
 
61
    config = Configuration(None, parent_package, top_path, setup_name = 'setupscons.py')
 
62
    config.set_options(ignore_setup_xxx_py=True,
 
63
                       assume_default_configuration=True,
 
64
                       delegate_options_to_subpackages=True,
 
65
                       quiet=True)
 
66
 
 
67
    config.add_subpackage('numpy')
 
68
 
 
69
    config.add_data_files(('numpy','*.txt'),
 
70
                          ('numpy','COMPATIBILITY'),
 
71
                          ('numpy','site.cfg.example'),
 
72
                          ('numpy','setup.py'))
 
73
 
 
74
    config.get_version('numpy/version.py') # sets config.version
 
75
 
 
76
    return config
 
77
 
 
78
def setup_package():
 
79
 
 
80
    from numpy.distutils.core import setup
 
81
 
 
82
    old_path = os.getcwd()
 
83
    local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
 
84
    os.chdir(local_path)
 
85
    sys.path.insert(0,local_path)
 
86
 
 
87
    try:
 
88
        setup(
 
89
            name = 'numpy',
 
90
            maintainer = "NumPy Developers",
 
91
            maintainer_email = "numpy-discussion@lists.sourceforge.net",
 
92
            description = DOCLINES[0],
 
93
            long_description = "\n".join(DOCLINES[2:]),
 
94
            url = "http://numeric.scipy.org",
 
95
            download_url = "http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103",
 
96
            license = 'BSD',
 
97
            classifiers=filter(None, CLASSIFIERS.split('\n')),
 
98
            author = "Travis E. Oliphant, et.al.",
 
99
            author_email = "oliphant@ee.byu.edu",
 
100
            platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
 
101
            configuration=configuration )
 
102
    finally:
 
103
        del sys.path[0]
 
104
        os.chdir(old_path)
 
105
    return
 
106
 
 
107
if __name__ == '__main__':
 
108
    setup_package()