##// END OF EJS Templates
Merge branch 'version-info' into trunk
Fernando Perez -
r3216:133507fb merge
parent child Browse files
Show More
@@ -0,0 +1,1 b''
1 IPython/.git_commit_info.ini export-subst
@@ -0,0 +1,9 b''
1 # This is an ini file that may contain information about the code state
2 [commit hash]
3
4 # The line below may contain a valid hash if it has been substituted during
5 # 'git archive'
6 archive_subst_hash=$Format:%h$
7
8 # This line may be modified by the install process
9 install_hash=
@@ -1,8 +1,10 b''
1 build
2 ./dist
1 docs/dist
3 docs/dist
2 docs/build/*
4 docs/build/*
3 docs/source/api/generated
5 docs/source/api/generated
4 *.pyc
6 *.py[co]
5 build
7 build
6 *.egg-info
8 *.egg-info
7 *.py~
9 *~
8 *.bak
10 *.bak
@@ -1,77 +1,85 b''
1 IPython is licensed under the terms of the new or revised BSD license, as follows:
1 =============================
2 The IPython licensing terms
3 =============================
2
4
3 Copyright (c) 2008, IPython Development Team
5 IPython is licensed under the terms of the Modified BSD License (also known as
6 New or Revised BSD), as follows:
7
8 Copyright (c) 2008-2010, IPython Development Team
9 Copyright (c) 2001-2007, Fernando Perez. <fernando.perez@colorado.edu>
10 Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
11 Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
4
12
5 All rights reserved.
13 All rights reserved.
6
14
7 Redistribution and use in source and binary forms, with or without modification,
15 Redistribution and use in source and binary forms, with or without
8 are permitted provided that the following conditions are met:
16 modification, are permitted provided that the following conditions are met:
9
17
10 Redistributions of source code must retain the above copyright notice, this list of
18 Redistributions of source code must retain the above copyright notice, this
11 conditions and the following disclaimer.
19 list of conditions and the following disclaimer.
12
20
13 Redistributions in binary form must reproduce the above copyright notice, this list
21 Redistributions in binary form must reproduce the above copyright notice, this
14 of conditions and the following disclaimer in the documentation and/or other
22 list of conditions and the following disclaimer in the documentation and/or
15 materials provided with the distribution.
23 other materials provided with the distribution.
16
24
17 Neither the name of the IPython Development Team nor the names of its contributors
25 Neither the name of the IPython Development Team nor the names of its
18 may be used to endorse or promote products derived from this software without
26 contributors may be used to endorse or promote products derived from this
19 specific prior written permission.
27 software without specific prior written permission.
20
28
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
29 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
30 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
31 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
32 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
25 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
33 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
35 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 POSSIBILITY OF SUCH DAMAGE.
38 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
39
32 About the IPython Development Team
40 About the IPython Development Team
33 ----------------------------------
41 ----------------------------------
34
42
35 Fernando Perez began IPython in 2001 based on code from Janko Hauser <jhauser@zscout.de>
43 Fernando Perez began IPython in 2001 based on code from Janko Hauser
36 and Nathaniel Gray <n8gray@caltech.edu>. Fernando is still the project lead.
44 <jhauser@zscout.de> and Nathaniel Gray <n8gray@caltech.edu>. Fernando is still
45 the project lead.
46
47 The IPython Development Team is the set of all contributors to the IPython
48 project. This includes all of the IPython subprojects. A full list with
49 details is kept in the documentation directory, in the file
50 ``about/credits.txt``.
37
51
38 The IPython Development Team is the set of all contributors to the IPython project.
52 The core team that coordinates development on GitHub can be found here:
39 This includes all of the IPython subprojects. Here is a list of the currently active contributors:
53 http://github.com/ipython. As of late 2010, it consists of:
40
54
41 * Matthieu Brucher
55 * Brian E. Granger
42 * Ondrej Certik
56 * Jonathan March
43 * Laurent Dufrechou
57 * Evan Patterson
44 * Robert Kern
58 * Fernando Perez
45 * Brian E. Granger
59 * Min Ragan-Kelley
46 * Fernando Perez (project leader)
60 * Robert Kern
47 * Benjamin Ragan-Kelley
48 * Ville M. Vainio
49 * Gael Varoququx
50 * Stefan van der Walt
51 * Tech-X Corporation
52 * Barry Wark
53
61
54 If your name is missing, please add it.
55
62
56 Our Copyright Policy
63 Our Copyright Policy
57 --------------------
64 --------------------
58
65
59 IPython uses a shared copyright model. Each contributor maintains copyright over
66 IPython uses a shared copyright model. Each contributor maintains copyright
60 their contributions to IPython. But, it is important to note that these
67 over their contributions to IPython. But, it is important to note that these
61 contributions are typically only changes to the repositories. Thus, the IPython
68 contributions are typically only changes to the repositories. Thus, the IPython
62 source code, in its entirety is not the copyright of any single person or
69 source code, in its entirety is not the copyright of any single person or
63 institution. Instead, it is the collective copyright of the entire IPython
70 institution. Instead, it is the collective copyright of the entire IPython
64 Development Team. If individual contributors want to maintain a record of what
71 Development Team. If individual contributors want to maintain a record of what
65 changes/contributions they have specific copyright on, they should indicate their
72 changes/contributions they have specific copyright on, they should indicate
66 copyright in the commit message of the change, when they commit the change to
73 their copyright in the commit message of the change, when they commit the
67 one of the IPython repositories.
74 change to one of the IPython repositories.
68
75
69 With this in mind, the following banner should be used in any source code file to
76 With this in mind, the following banner should be used in any source code file
70 indicate the copyright and license terms:
77 to indicate the copyright and license terms:
71
78
72 #-------------------------------------------------------------------------------
79 #-----------------------------------------------------------------------------
73 # Copyright (C) 2008 The IPython Development Team
80 # Copyright (c) 2010, IPython Development Team.
81 #
82 # Distributed under the terms of the Modified BSD License.
74 #
83 #
75 # Distributed under the terms of the BSD License. The full license is in
84 # The full license is in the file COPYING.txt, distributed with this software.
76 # the file COPYING, distributed as part of this software.
85 #-----------------------------------------------------------------------------
77 #------------------------------------------------------------------------------- No newline at end of file
@@ -6,10 +6,14 b' IPython.'
6 IPython is a set of tools for interactive and exploratory computing in Python.
6 IPython is a set of tools for interactive and exploratory computing in Python.
7 """
7 """
8 #-----------------------------------------------------------------------------
8 #-----------------------------------------------------------------------------
9 # Copyright (C) 2008-2009 The IPython Development Team
9 # Copyright (c) 2008-2010, IPython Development Team.
10 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
11 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
12 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
10 #
13 #
11 # Distributed under the terms of the BSD License. The full license is in
14 # Distributed under the terms of the Modified BSD License.
12 # the file COPYING, distributed as part of this software.
15 #
16 # The full license is in the file COPYING.txt, distributed with this software.
13 #-----------------------------------------------------------------------------
17 #-----------------------------------------------------------------------------
14
18
15 #-----------------------------------------------------------------------------
19 #-----------------------------------------------------------------------------
@@ -45,6 +49,7 b' from .frontend.terminal.embed import embed'
45 from .core.error import TryNext
49 from .core.error import TryNext
46 from .core.interactiveshell import InteractiveShell
50 from .core.interactiveshell import InteractiveShell
47 from .testing import test
51 from .testing import test
52 from .utils.sysinfo import sys_info
48
53
49 # Release data
54 # Release data
50 __author__ = ''
55 __author__ = ''
@@ -52,4 +57,3 b' for author, email in release.authors.itervalues():'
52 __author__ += author + ' <' + email + '>\n'
57 __author__ += author + ' <' + email + '>\n'
53 __license__ = release.license
58 __license__ = release.license
54 __version__ = release.version
59 __version__ = release.version
55 __revision__ = release.revision
@@ -1,39 +1,40 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Release data for the IPython project."""
2 """Release data for the IPython project."""
3
3
4 #*****************************************************************************
4 #-----------------------------------------------------------------------------
5 # Copyright (C) 2008-2009 The IPython Development Team
5 # Copyright (c) 2008-2010, IPython Development Team.
6 # Copyright (C) 2001-2008 Fernando Perez <fperez@colorado.edu>
6 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
7 # Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and Nathaniel Gray
7 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
8 # <n8gray@caltech.edu>
8 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
9 #
9 #
10 # Distributed under the terms of the BSD License. The full license is in
10 # Distributed under the terms of the Modified BSD License.
11 # the file COPYING, distributed as part of this software.
11 #
12 #*****************************************************************************
12 # The full license is in the file COPYING.txt, distributed with this software.
13 #-----------------------------------------------------------------------------
13
14
14 # Name of the package for release purposes. This is the name which labels
15 # Name of the package for release purposes. This is the name which labels
15 # the tarballs and RPMs made by distutils, so it's best to lowercase it.
16 # the tarballs and RPMs made by distutils, so it's best to lowercase it.
16 name = 'ipython'
17 name = 'ipython'
17
18
18 # For versions with substrings (like 0.6.16.svn), use an extra . to separate
19 # IPython version information. An empty _version_extra corresponds to a full
19 # the new substring. We have to avoid using either dashes or underscores,
20 # release. 'dev' as a _version_extra string means this is a development
20 # because bdist_rpm does not accept dashes (an RPM) convention, and
21 # version
21 # bdist_deb does not accept underscores (a Debian convention).
22 _version_major = 0
23 _version_minor = 11
24 _version_micro = '' # use '' for first of series, number for 1 and above
25 _version_extra = 'dev'
26 #_version_extra = '' # Uncomment this for full releases
22
27
23 development = True # change this to False to do a release
28 # Construct full version string from these.
24 version_base = '0.11.alpha1'
29 _ver = [_version_major, _version_minor]
25 branch = 'ipython'
30 if _version_micro:
26 # This needs to be updated to something that is meaningful for git
31 _ver.append(_version_micro)
27 revision = '0'
32 if _version_extra:
33 _ver.append(_version_extra)
28
34
29 if development:
35 __version__ = '.'.join(map(str, _ver))
30 if branch == 'ipython':
31 version = '%s.git' % (version_base)
32 else:
33 version = '%s.git.%s' % (version_base, branch)
34 else:
35 version = version_base
36
36
37 version = __version__ # backwards compatibility name
37
38
38 description = "An interactive computing environment for Python"
39 description = "An interactive computing environment for Python"
39
40
@@ -95,8 +96,8 b' The parallel computing architecture has the following main features:'
95
96
96 * Robust error handling in parallel code.
97 * Robust error handling in parallel code.
97
98
98 The latest development version is always available from IPython's `Launchpad
99 The latest development version is always available from IPython's `GitHub
99 site <http://launchpad.net/ipython>`_.
100 site <http://github.com/ipython>`_.
100 """
101 """
101
102
102 license = 'BSD'
103 license = 'BSD'
@@ -322,7 +322,6 b' class IPAppConfigLoader(BaseAppConfigLoader):'
322 # Crash handler for this application
322 # Crash handler for this application
323 #-----------------------------------------------------------------------------
323 #-----------------------------------------------------------------------------
324
324
325
326 _message_template = """\
325 _message_template = """\
327 Oops, $self.app_name crashed. We do our best to make it stable, but...
326 Oops, $self.app_name crashed. We do our best to make it stable, but...
328
327
@@ -354,7 +353,7 b' class IPAppCrashHandler(CrashHandler):'
354 def __init__(self, app):
353 def __init__(self, app):
355 contact_name = release.authors['Fernando'][0]
354 contact_name = release.authors['Fernando'][0]
356 contact_email = release.authors['Fernando'][1]
355 contact_email = release.authors['Fernando'][1]
357 bug_tracker = 'https://bugs.launchpad.net/ipython/+filebug'
356 bug_tracker = 'http://github.com/ipython/ipython/issues'
358 super(IPAppCrashHandler,self).__init__(
357 super(IPAppCrashHandler,self).__init__(
359 app, contact_name, contact_email, bug_tracker
358 app, contact_name, contact_email, bug_tracker
360 )
359 )
@@ -325,7 +325,7 b' class ClusterDirCrashHandler(CrashHandler):'
325 def __init__(self, app):
325 def __init__(self, app):
326 contact_name = release.authors['Brian'][0]
326 contact_name = release.authors['Brian'][0]
327 contact_email = release.authors['Brian'][1]
327 contact_email = release.authors['Brian'][1]
328 bug_tracker = 'https://bugs.launchpad.net/ipython/+filebug'
328 bug_tracker = 'http://github.com/ipython/ipython/issues'
329 super(ClusterDirCrashHandler,self).__init__(
329 super(ClusterDirCrashHandler,self).__init__(
330 app, contact_name, contact_email, bug_tracker
330 app, contact_name, contact_email, bug_tracker
331 )
331 )
@@ -115,7 +115,7 b" have['gobject'] = test_for('gobject')"
115 def report():
115 def report():
116 """Return a string with a summary report of test-related variables."""
116 """Return a string with a summary report of test-related variables."""
117
117
118 out = [ sys_info() ]
118 out = [ sys_info(), '\n']
119
119
120 avail = []
120 avail = []
121 not_avail = []
121 not_avail = []
@@ -1,6 +1,6 b''
1 # encoding: utf-8
1 # encoding: utf-8
2 """
2 """
3 Utilities for getting information about a system.
3 Utilities for getting information about IPython and the system it's running in.
4 """
4 """
5
5
6 #-----------------------------------------------------------------------------
6 #-----------------------------------------------------------------------------
@@ -16,37 +16,122 b' Utilities for getting information about a system.'
16
16
17 import os
17 import os
18 import platform
18 import platform
19 import pprint
19 import sys
20 import sys
20 import subprocess
21 import subprocess
21
22
23 from ConfigParser import ConfigParser
24
22 from IPython.core import release
25 from IPython.core import release
23
26
24 #-----------------------------------------------------------------------------
27 #-----------------------------------------------------------------------------
28 # Globals
29 #-----------------------------------------------------------------------------
30 COMMIT_INFO_FNAME = '.git_commit_info.ini'
31
32 #-----------------------------------------------------------------------------
25 # Code
33 # Code
26 #-----------------------------------------------------------------------------
34 #-----------------------------------------------------------------------------
27
35
36 def pkg_commit_hash(pkg_path):
37 """Get short form of commit hash given directory `pkg_path`
38
39 There should be a file called 'COMMIT_INFO.txt' in `pkg_path`. This is a
40 file in INI file format, with at least one section: ``commit hash``, and two
41 variables ``archive_subst_hash`` and ``install_hash``. The first has a
42 substitution pattern in it which may have been filled by the execution of
43 ``git archive`` if this is an archive generated that way. The second is
44 filled in by the installation, if the installation is from a git archive.
45
46 We get the commit hash from (in order of preference):
47
48 * A substituted value in ``archive_subst_hash``
49 * A written commit hash value in ``install_hash`
50 * git output, if we are in a git repository
51
52 If all these fail, we return a not-found placeholder tuple
53
54 Parameters
55 ----------
56 pkg_path : str
57 directory containing package
58
59 Returns
60 -------
61 hash_from : str
62 Where we got the hash from - description
63 hash_str : str
64 short form of hash
65 """
66 # Try and get commit from written commit text file
67 pth = os.path.join(pkg_path, COMMIT_INFO_FNAME)
68 if not os.path.isfile(pth):
69 raise IOError('Missing commit info file %s' % pth)
70 cfg_parser = ConfigParser()
71 cfg_parser.read(pth)
72 archive_subst = cfg_parser.get('commit hash', 'archive_subst_hash')
73 if not archive_subst.startswith('$Format'): # it has been substituted
74 return 'archive substitution', archive_subst
75 install_subst = cfg_parser.get('commit hash', 'install_hash')
76 if install_subst != '':
77 return 'installation', install_subst
78 # maybe we are in a repository
79 proc = subprocess.Popen('git rev-parse --short HEAD',
80 stdout=subprocess.PIPE,
81 stderr=subprocess.PIPE,
82 cwd=pkg_path, shell=True)
83 repo_commit, _ = proc.communicate()
84 if repo_commit:
85 return 'repository', repo_commit.strip()
86 return '(none found)', '<not found>'
87
88
89 def pkg_info(pkg_path):
90 """Return dict describing the context of this package
91
92 Parameters
93 ----------
94 pkg_path : str
95 path containing __init__.py for package
96
97 Returns
98 -------
99 context : dict
100 with named parameters of interest
101 """
102 src, hsh = pkg_commit_hash(pkg_path)
103 return dict(
104 ipython_version=release.version,
105 ipython_path=pkg_path,
106 commit_source=src,
107 commit_hash=hsh,
108 sys_version=sys.version,
109 sys_executable=sys.executable,
110 sys_platform=sys.platform,
111 platform=platform.platform(),
112 os_name=os.name,
113 )
114
115
28 def sys_info():
116 def sys_info():
29 """Return useful information about IPython and the system, as a string.
117 """Return useful information about IPython and the system, as a string.
30
118
31 Examples
119 Example
32 --------
120 -------
33 In [1]: print(sys_info())
121 In [2]: print sys_info()
34 IPython version: 0.11.bzr.r1340 # random
122 {'commit_hash': '144fdae', # random
35 BZR revision : 1340
123 'commit_source': 'repository',
36 Platform info : os.name -> posix, sys.platform -> linux2
124 'ipython_path': '/home/fperez/usr/lib/python2.6/site-packages/IPython',
37 : Linux-2.6.31-17-generic-i686-with-Ubuntu-9.10-karmic
125 'ipython_version': '0.11.dev',
38 Python info : 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
126 'os_name': 'posix',
39 [GCC 4.4.1]
127 'platform': 'Linux-2.6.35-22-generic-i686-with-Ubuntu-10.10-maverick',
40 """
128 'sys_executable': '/usr/bin/python',
41 out = []
129 'sys_platform': 'linux2',
42 out.append('IPython version: %s' % release.version)
130 'sys_version': '2.6.6 (r266:84292, Sep 15 2010, 15:52:39) \\n[GCC 4.4.5]'}
43 out.append('BZR revision : %s' % release.revision)
131 """
44 out.append('Platform info : os.name -> %s, sys.platform -> %s' %
132 p = os.path
45 (os.name,sys.platform) )
133 path = p.dirname(p.abspath(p.join(__file__, '..')))
46 out.append(' : %s' % platform.platform())
134 return pprint.pformat(pkg_info(path))
47 out.append('Python info : %s' % sys.version)
48 out.append('') # ensure closing newline
49 return '\n'.join(out)
50
135
51
136
52 def _num_cpus_unix():
137 def _num_cpus_unix():
@@ -18,6 +18,7 b' graft IPython/scripts'
18 graft IPython/testing
18 graft IPython/testing
19 graft IPython/utils
19 graft IPython/utils
20
20
21 include IPython/.git_commit_info.ini
21
22
22 graft docs
23 graft docs
23 exclude docs/\#*
24 exclude docs/\#*
@@ -18,14 +18,9 b' For full details, see the installation section of the manual. The basic parts'
18 of IPython only need the Python standard library, but much of its more advanced
18 of IPython only need the Python standard library, but much of its more advanced
19 functionality requires extra packages.
19 functionality requires extra packages.
20
20
21 Officially, IPython requires Python version 2.5 or 2.6. We have *not* yet
21 Officially, IPython requires Python version 2.6 or 2.7. An experimental port
22 started to port IPython to Python 3.0.
22 of IPython to Python 3.x has been sarted, and is available at
23
23 http://github.com/takowl/ipython/tree/ipython-py3k.
24 .. warning::
25
26 IPython 0.10 has only been well tested with Python 2.5 and 2.6. Parts of
27 it may work with Python 2.4, but we do not officially support Python 2.4
28 anymore. If you need to use 2.4, you can still run IPython 0.9.
29
24
30
25
31 Instant running
26 Instant running
@@ -49,28 +49,22 b' it system-wide or having configure anything, by typing at the terminal:'
49
49
50 python ipython.py
50 python ipython.py
51
51
52 and similarly, you can execute the built-in test suite with:
52 In order to run the test suite, you must at least be able to import IPython,
53
53 even if you haven't fully installed the user-facing scripts yet (common in a
54 .. code-block:: bash
54 development environment). You can then run the tests with:
55
56 python iptest.py
57
55
56 .. code-block:: bash
58
57
59 This script manages intelligently both nose and trial, choosing the correct
58 python -c "import IPython; IPython.test()"
60 test system for each of IPython's components.
61
59
62 Once you have either installed it or at least configured your system to be
60 Once you have installed IPython either via a full install or using:
63 able to import IPython, you can run the tests with:
64
61
65 .. code-block:: bash
62 .. code-block:: bash
66
63
67 python -c "import IPython; IPython.test()"
64 python setup.py develop
68
65
69 This should work as long as IPython can be imported, even if you haven't fully
66 you will have available a system-wide script called :file:`iptest` that runs
70 installed the user-facing scripts yet (common in a development environment).
67 the full test suite. You can then run the suite with:
71 Once you have installed IPython, you will have available system-wide a script
72 called :file:`iptest` that does the exact same as the :file:`iptest.py` script
73 in the source directory, so you can then test simply with:
74
68
75 .. code-block:: bash
69 .. code-block:: bash
76
70
@@ -83,26 +77,25 b' Regardless of how you run things, you should eventually see something like:'
83
77
84 **********************************************************************
78 **********************************************************************
85 Test suite completed for system with the following information:
79 Test suite completed for system with the following information:
86 IPython version: 0.11.bzr.r1340
80 {'commit_hash': '144fdae',
87 BZR revision : 1340
81 'commit_source': 'repository',
88 Platform info : os.name -> posix, sys.platform -> linux2
82 'ipython_path': '/home/fperez/usr/lib/python2.6/site-packages/IPython',
89 : Linux-2.6.31-17-generic-i686-with-Ubuntu-9.10-karmic
83 'ipython_version': '0.11.dev',
90 Python info : 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
84 'os_name': 'posix',
91 [GCC 4.4.1]
85 'platform': 'Linux-2.6.35-22-generic-i686-with-Ubuntu-10.10-maverick',
92
86 'sys_executable': '/usr/bin/python',
93 Running from an installed IPython: True
87 'sys_platform': 'linux2',
88 'sys_version': '2.6.6 (r266:84292, Sep 15 2010, 15:52:39) \n[GCC 4.4.5]'}
94
89
95 Tools and libraries available at test time:
90 Tools and libraries available at test time:
96 curses foolscap gobject gtk pexpect twisted wx wx.aui zope.interface
91 curses foolscap gobject gtk pexpect twisted wx wx.aui zope.interface
97
92
98 Tools and libraries NOT available at test time:
93 Ran 9 test groups in 67.213s
99 objc
100
101 Ran 11 test groups in 36.244s
102
94
103 Status:
95 Status:
104 OK
96 OK
105
97
98
106 If not, there will be a message indicating which test group failed and how to
99 If not, there will be a message indicating which test group failed and how to
107 rerun that group individually. For example, this tests the
100 rerun that group individually. For example, this tests the
108 :mod:`IPython.utils` subpackage, the :option:`-v` option shows progress
101 :mod:`IPython.utils` subpackage, the :option:`-v` option shows progress
@@ -110,7 +103,7 b' indicators:'
110
103
111 .. code-block:: bash
104 .. code-block:: bash
112
105
113 $ python iptest.py -v IPython.utils
106 $ iptest -v IPython.utils
114 ..........................SS..SSS............................S.S...
107 ..........................SS..SSS............................S.S...
115 .........................................................
108 .........................................................
116 ----------------------------------------------------------------------
109 ----------------------------------------------------------------------
@@ -126,7 +119,7 b' example, this lets you run the specific test :func:`test_rehashx` inside the'
126
119
127 .. code-block:: bash
120 .. code-block:: bash
128
121
129 $ python iptest.py -vv IPython.core.tests.test_magic:test_rehashx
122 $ iptest -vv IPython.core.tests.test_magic:test_rehashx
130 IPython.core.tests.test_magic.test_rehashx(True,) ... ok
123 IPython.core.tests.test_magic.test_rehashx(True,) ... ok
131 IPython.core.tests.test_magic.test_rehashx(True,) ... ok
124 IPython.core.tests.test_magic.test_rehashx(True,) ... ok
132
125
@@ -146,6 +139,16 b' package basis:'
146
139
147 trial IPython.kernel
140 trial IPython.kernel
148
141
142 .. note::
143
144 The system information summary printed above is accessible from the top
145 level package. If you encounter a problem with IPython, it's useful to
146 include this information when reporting on the mailing list; use::
147
148 from IPython import sys_info
149 print sys_info()
150
151 and include the resulting information in your query.
149
152
150 For developers: writing tests
153 For developers: writing tests
151 =============================
154 =============================
@@ -6,12 +6,16 b' Under Posix environments it works like a typical setup.py script.'
6 Under Windows, the command sdist is not supported, since IPython
6 Under Windows, the command sdist is not supported, since IPython
7 requires utilities which are not available under Windows."""
7 requires utilities which are not available under Windows."""
8
8
9 #-------------------------------------------------------------------------------
9 #-----------------------------------------------------------------------------
10 # Copyright (C) 2008 The IPython Development Team
10 # Copyright (c) 2008-2010, IPython Development Team.
11 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
12 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
13 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
11 #
14 #
12 # Distributed under the terms of the BSD License. The full license is in
15 # Distributed under the terms of the Modified BSD License.
13 # the file COPYING, distributed as part of this software.
16 #
14 #-------------------------------------------------------------------------------
17 # The full license is in the file COPYING.txt, distributed with this software.
18 #-----------------------------------------------------------------------------
15
19
16 #-----------------------------------------------------------------------------
20 #-----------------------------------------------------------------------------
17 # Minimal Python version sanity check
21 # Minimal Python version sanity check
@@ -55,7 +59,8 b' from setupbase import ('
55 find_package_data,
59 find_package_data,
56 find_scripts,
60 find_scripts,
57 find_data_files,
61 find_data_files,
58 check_for_dependencies
62 check_for_dependencies,
63 record_commit_info,
59 )
64 )
60
65
61 isfile = os.path.isfile
66 isfile = os.path.isfile
@@ -239,6 +244,7 b' else:'
239 # Do the actual setup now
244 # Do the actual setup now
240 #---------------------------------------------------------------------------
245 #---------------------------------------------------------------------------
241
246
247 setup_args['cmdclass'] = {'build_py': record_commit_info('IPython')}
242 setup_args['packages'] = packages
248 setup_args['packages'] = packages
243 setup_args['package_data'] = package_data
249 setup_args['package_data'] = package_data
244 setup_args['scripts'] = scripts
250 setup_args['scripts'] = scripts
@@ -1,5 +1,4 b''
1 # encoding: utf-8
1 # encoding: utf-8
2
3 """
2 """
4 This module defines the things that are used in setup.py for building IPython
3 This module defines the things that are used in setup.py for building IPython
5
4
@@ -9,8 +8,7 b' This includes:'
9 * Functions for finding things like packages, package data, etc.
8 * Functions for finding things like packages, package data, etc.
10 * A function for checking dependencies.
9 * A function for checking dependencies.
11 """
10 """
12
11 from __future__ import print_function
13 __docformat__ = "restructuredtext en"
14
12
15 #-------------------------------------------------------------------------------
13 #-------------------------------------------------------------------------------
16 # Copyright (C) 2008 The IPython Development Team
14 # Copyright (C) 2008 The IPython Development Team
@@ -22,9 +20,11 b' __docformat__ = "restructuredtext en"'
22 #-------------------------------------------------------------------------------
20 #-------------------------------------------------------------------------------
23 # Imports
21 # Imports
24 #-------------------------------------------------------------------------------
22 #-------------------------------------------------------------------------------
23 import os
24 import sys
25
25
26 import os, sys
26 from ConfigParser import ConfigParser
27
27 from distutils.command.build_py import build_py
28 from glob import glob
28 from glob import glob
29
29
30 from setupext import install_data_ext
30 from setupext import install_data_ext
@@ -38,7 +38,7 b' isfile = os.path.isfile'
38 pjoin = os.path.join
38 pjoin = os.path.join
39
39
40 def oscmd(s):
40 def oscmd(s):
41 print ">", s
41 print(">", s)
42 os.system(s)
42 os.system(s)
43
43
44 # A little utility we'll need below, since glob() does NOT allow you to do
44 # A little utility we'll need below, since glob() does NOT allow you to do
@@ -175,9 +175,9 b' def make_dir_struct(tag,base,out_base):'
175 # filenames, we must join back with the dirpath to get full valid file
175 # filenames, we must join back with the dirpath to get full valid file
176 # paths:
176 # paths:
177 pfiles = [pjoin(dirpath,f) for f in filenames]
177 pfiles = [pjoin(dirpath,f) for f in filenames]
178 # Finally, generate the entry we need, which is a triple of (tag,output
178 # Finally, generate the entry we need, which is a pari of (output
179 # path, files) for use as a data_files parameter in install_data.
179 # path, files) for use as a data_files parameter in install_data.
180 out.append((tag,out_path,pfiles))
180 out.append((out_path, pfiles))
181
181
182 return out
182 return out
183
183
@@ -194,7 +194,8 b' def find_data_files():'
194
194
195 # Simple file lists can be made by hand
195 # Simple file lists can be made by hand
196 manpages = filter(isfile, glob(pjoin('docs','man','*.1.gz')))
196 manpages = filter(isfile, glob(pjoin('docs','man','*.1.gz')))
197 igridhelpfiles = filter(isfile, glob(pjoin('IPython','extensions','igrid_help.*')))
197 igridhelpfiles = filter(isfile,
198 glob(pjoin('IPython','extensions','igrid_help.*')))
198
199
199 # For nested structures, use the utility above
200 # For nested structures, use the utility above
200 example_files = make_dir_struct(
201 example_files = make_dir_struct(
@@ -209,15 +210,15 b' def find_data_files():'
209 )
210 )
210
211
211 # And assemble the entire output list
212 # And assemble the entire output list
212 data_files = [ ('data',manpagebase, manpages),
213 data_files = [ (manpagebase, manpages),
213 ('data',pjoin(docdirbase,'extensions'),igridhelpfiles),
214 (pjoin(docdirbase, 'extensions'), igridhelpfiles),
214 ] + manual_files + example_files
215 ] + manual_files + example_files
215
216
216 ## import pprint # dbg
217 ## import pprint # dbg
217 ## print '*'*80
218 ## print('*'*80)
218 ## print 'data files'
219 ## print('data files')
219 ## pprint.pprint(data_files)
220 ## pprint.pprint(data_files)
220 ## print '*'*80
221 ## print('*'*80)
221
222
222 return data_files
223 return data_files
223
224
@@ -271,8 +272,10 b' def find_scripts():'
271 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
272 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
272 # doesn't find them.
273 # doesn't find them.
273 if 'bdist_wininst' in sys.argv:
274 if 'bdist_wininst' in sys.argv:
274 if len(sys.argv) > 2 and ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
275 if len(sys.argv) > 2 and \
275 print >> sys.stderr,"ERROR: bdist_wininst must be run alone. Exiting."
276 ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
277 print("ERROR: bdist_wininst must be run alone. Exiting.",
278 file=sys.stderr)
276 sys.exit(1)
279 sys.exit(1)
277 scripts.append(pjoin('scripts','ipython_win_post_install.py'))
280 scripts.append(pjoin('scripts','ipython_win_post_install.py'))
278
281
@@ -288,7 +291,7 b' def check_for_dependencies():'
288 This function should NOT be called if running under setuptools!
291 This function should NOT be called if running under setuptools!
289 """
292 """
290 from setupext.setupext import (
293 from setupext.setupext import (
291 print_line, print_raw, print_status, print_message,
294 print_line, print_raw, print_status,
292 check_for_zopeinterface, check_for_twisted,
295 check_for_zopeinterface, check_for_twisted,
293 check_for_foolscap, check_for_pyopenssl,
296 check_for_foolscap, check_for_pyopenssl,
294 check_for_sphinx, check_for_pygments,
297 check_for_sphinx, check_for_pygments,
@@ -312,3 +315,61 b' def check_for_dependencies():'
312 check_for_pygments()
315 check_for_pygments()
313 check_for_nose()
316 check_for_nose()
314 check_for_pexpect()
317 check_for_pexpect()
318
319
320 def record_commit_info(pkg_dir, build_cmd=build_py):
321 """ Return extended build command class for recording commit
322
323 The extended command tries to run git to find the current commit, getting
324 the empty string if it fails. It then writes the commit hash into a file
325 in the `pkg_dir` path, named ``.git_commit_info.ini``.
326
327 In due course this information can be used by the package after it is
328 installed, to tell you what commit it was installed from if known.
329
330 To make use of this system, you need a package with a .git_commit_info.ini
331 file - e.g. ``myproject/.git_commit_info.ini`` - that might well look like
332 this::
333
334 # This is an ini file that may contain information about the code state
335 [commit hash]
336 # The line below may contain a valid hash if it has been substituted
337 # during 'git archive'
338 archive_subst_hash=$Format:%h$
339 # This line may be modified by the install process
340 install_hash=
341
342 The .git_commit_info file above is also designed to be used with git
343 substitution - so you probably also want a ``.gitattributes`` file in the
344 root directory of your working tree that contains something like this::
345
346 myproject/.git_commit_info.ini export-subst
347
348 That will cause the ``.git_commit_info.ini`` file to get filled in by ``git
349 archive`` - useful in case someone makes such an archive - for example with
350 via the github 'download source' button.
351
352 Although all the above will work as is, you might consider having something
353 like a ``get_info()`` function in your package to display the commit
354 information at the terminal. See the ``pkg_info.py`` module in the nipy
355 package for an example.
356 """
357 class MyBuildPy(build_cmd):
358 ''' Subclass to write commit data into installation tree '''
359 def run(self):
360 build_py.run(self)
361 import subprocess
362 proc = subprocess.Popen('git rev-parse --short HEAD',
363 stdout=subprocess.PIPE,
364 stderr=subprocess.PIPE,
365 shell=True)
366 repo_commit, _ = proc.communicate()
367 # We write the installation commit even if it's empty
368 cfg_parser = ConfigParser()
369 cfg_parser.read(pjoin(pkg_dir, '.git_commit_info.ini'))
370 cfg_parser.set('commit hash', 'install_hash', repo_commit)
371 out_pth = pjoin(self.build_lib, pkg_dir, '.git_commit_info.ini')
372 out_file = open(out_pth, 'wt')
373 cfg_parser.write(out_file)
374 out_file.close()
375 return MyBuildPy
@@ -20,16 +20,16 b" for d in ['build','dist',pjoin('docs','build'),pjoin('docs','dist'),"
20 remove_tree(d)
20 remove_tree(d)
21
21
22 # Build source and binary distros
22 # Build source and binary distros
23 c('./setup.py sdist --formats=gztar,zip')
23 sh('./setup.py sdist --formats=gztar,zip')
24
24
25 # Build eggs
25 # Build eggs
26 c('python2.6 ./setupegg.py bdist_egg')
26 sh('python2.6 ./setupegg.py bdist_egg')
27
27
28 # Call the windows build separately, so that the extra Windows scripts don't
28 # Call the windows build separately, so that the extra Windows scripts don't
29 # get pulled into Unix builds (setup.py has code which checks for
29 # get pulled into Unix builds (setup.py has code which checks for
30 # bdist_wininst)
30 # bdist_wininst)
31 c("python setup.py bdist_wininst --install-script=ipython_win_post_install.py")
31 sh("python setup.py bdist_wininst --install-script=ipython_win_post_install.py")
32
32
33 # Change name so retarded Vista runs the installer correctly
33 # Change name so retarded Vista runs the installer correctly
34 c("rename 's/linux-i686/win32-setup/' dist/*.exe")
34 sh("rename 's/linux-i686/win32-setup/' dist/*.exe")
35 c("rename 's/linux-x86_64/win32-setup/' dist/*.exe")
35 sh("rename 's/linux-x86_64/win32-setup/' dist/*.exe")
@@ -9,7 +9,7 b' import shutil'
9
9
10 from toollib import *
10 from toollib import *
11
11
12 tag = commands.getoutput('git describe')
12 tag = commands.getoutput('git describe --tags')
13 base_name = 'ipython-%s' % tag
13 base_name = 'ipython-%s' % tag
14 tar_name = '%s.tgz' % base_name
14 tar_name = '%s.tgz' % base_name
15
15
@@ -21,5 +21,5 b" tar_name = '%s.tgz' % base_name"
21 start_dir = os.getcwd()
21 start_dir = os.getcwd()
22 cd('..')
22 cd('..')
23 git_tpl = 'git archive --format=tar --prefix={0}/ HEAD | gzip > {1}'
23 git_tpl = 'git archive --format=tar --prefix={0}/ HEAD | gzip > {1}'
24 c(git_tpl.format(base_name, tar_name))
24 sh(git_tpl.format(base_name, tar_name))
25 c('mv {0} tools/'.format(tar_name))
25 sh('mv {0} tools/'.format(tar_name))
@@ -11,14 +11,16 b' pjoin = os.path.join'
11 cd = os.chdir
11 cd = os.chdir
12
12
13 # Utility functions
13 # Utility functions
14 def c(cmd):
14 def sh(cmd):
15 """Run system command, raise SystemExit if it returns an error."""
15 """Run system command in shell, raise SystemExit if it returns an error."""
16 print "$",cmd
16 print "$",cmd
17 stat = os.system(cmd)
17 stat = os.system(cmd)
18 #stat = 0 # Uncomment this and comment previous to run in debug mode
18 #stat = 0 # Uncomment this and comment previous to run in debug mode
19 if stat:
19 if stat:
20 raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
20 raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
21
21
22 # Backwards compatibility
23 c = sh
22
24
23 def get_ipdir():
25 def get_ipdir():
24 """Get IPython directory from command line, or assume it's the one above."""
26 """Get IPython directory from command line, or assume it's the one above."""
@@ -39,17 +41,8 b' def get_ipdir():'
39
41
40 def compile_tree():
42 def compile_tree():
41 """Compile all Python files below current directory."""
43 """Compile all Python files below current directory."""
42 vstr = '.'.join(map(str,sys.version_info[:2]))
44 stat = os.system('python -m compileall .')
43 stat = os.system('python %s/lib/python%s/compileall.py .' %
44 (sys.prefix,vstr))
45 if stat:
45 if stat:
46 msg = '*** ERROR: Some Python files in tree do NOT compile! ***\n'
46 msg = '*** ERROR: Some Python files in tree do NOT compile! ***\n'
47 msg += 'See messages above for the actual file that produced it.\n'
47 msg += 'See messages above for the actual file that produced it.\n'
48 raise SystemExit(msg)
48 raise SystemExit(msg)
49
50
51 def version_info():
52 """Return bzr version info as a dict."""
53 out = os.popen('bzr version-info')
54 pairs = (l.split(':',1) for l in out)
55 return dict(((k,v.strip()) for (k,v) in pairs))
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now