Skip to content

Commit

Permalink
Add support for commit information in auto-generated archives.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fperez committed Oct 27, 2010
1 parent 8ec0141 commit 7d03350
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IPython/.git_commit_info.ini export-subst
9 changes: 9 additions & 0 deletions IPython/.git_commit_info.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This is an ini file that may contain information about the code state
[commit hash]

# The line below may contain a valid hash if it has been substituted during
# 'git archive'
archive_subst_hash=$Format:%h$

# This line may be modified by the install process
install_hash=
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ graft IPython/scripts
graft IPython/testing
graft IPython/utils

include IPython/.git_commit_info.ini

graft docs
exclude docs/\#*
Expand Down
18 changes: 12 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
Under Windows, the command sdist is not supported, since IPython
requires utilities which are not available under Windows."""

#-------------------------------------------------------------------------------
# Copyright (C) 2008 The IPython Development Team
#-----------------------------------------------------------------------------
# Copyright (c) 2008-2010, IPython Development Team.
# Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
# Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
# Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-------------------------------------------------------------------------------
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Minimal Python version sanity check
Expand Down Expand Up @@ -55,7 +59,8 @@
find_package_data,
find_scripts,
find_data_files,
check_for_dependencies
check_for_dependencies,
record_commit_info,
)

isfile = os.path.isfile
Expand Down Expand Up @@ -239,6 +244,7 @@ def cleanup():
# Do the actual setup now
#---------------------------------------------------------------------------

setup_args['cmdclass'] = {'build_py': record_commit_info('IPython')}
setup_args['packages'] = packages
setup_args['package_data'] = package_data
setup_args['scripts'] = scripts
Expand Down
2 changes: 1 addition & 1 deletion tools/make_tarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from toollib import *

tag = commands.getoutput('git describe')
tag = commands.getoutput('git describe --tags')
base_name = 'ipython-%s' % tag
tar_name = '%s.tgz' % base_name

Expand Down

0 comments on commit 7d03350

Please sign in to comment.