Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d03350

Browse files
committed
Add support for commit information in auto-generated archives.
This uses the tool to record the commit data from our previous commit, and ensures that auto-generated archives from Github, for example, always carry identifying information. Ideas and code taken from Matthew Brett's tools in nibabel.
1 parent 8ec0141 commit 7d03350

5 files changed

Lines changed: 24 additions & 7 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
IPython/.git_commit_info.ini export-subst

IPython/.git_commit_info.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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=

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ graft IPython/scripts
1818
graft IPython/testing
1919
graft IPython/utils
2020

21+
include IPython/.git_commit_info.ini
2122

2223
graft docs
2324
exclude docs/\#*

setup.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
Under Windows, the command sdist is not supported, since IPython
77
requires utilities which are not available under Windows."""
88

9-
#-------------------------------------------------------------------------------
10-
# Copyright (C) 2008 The IPython Development Team
9+
#-----------------------------------------------------------------------------
10+
# Copyright (c) 2008-2010, IPython Development Team.
11+
# Copyright (c) 2001-2007, Fernando Perez <[email protected]>
12+
# Copyright (c) 2001, Janko Hauser <[email protected]>
13+
# Copyright (c) 2001, Nathaniel Gray <[email protected]>
1114
#
12-
# Distributed under the terms of the BSD License. The full license is in
13-
# the file COPYING, distributed as part of this software.
14-
#-------------------------------------------------------------------------------
15+
# Distributed under the terms of the Modified BSD License.
16+
#
17+
# The full license is in the file COPYING.txt, distributed with this software.
18+
#-----------------------------------------------------------------------------
1519

1620
#-----------------------------------------------------------------------------
1721
# Minimal Python version sanity check
@@ -55,7 +59,8 @@
5559
find_package_data,
5660
find_scripts,
5761
find_data_files,
58-
check_for_dependencies
62+
check_for_dependencies,
63+
record_commit_info,
5964
)
6065

6166
isfile = os.path.isfile
@@ -239,6 +244,7 @@ def cleanup():
239244
# Do the actual setup now
240245
#---------------------------------------------------------------------------
241246

247+
setup_args['cmdclass'] = {'build_py': record_commit_info('IPython')}
242248
setup_args['packages'] = packages
243249
setup_args['package_data'] = package_data
244250
setup_args['scripts'] = scripts

tools/make_tarball.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from toollib import *
1111

12-
tag = commands.getoutput('git describe')
12+
tag = commands.getoutput('git describe --tags')
1313
base_name = 'ipython-%s' % tag
1414
tar_name = '%s.tgz' % base_name
1515

0 commit comments

Comments
 (0)