release
64 lines
| 1.5 KiB
| text/plain
|
TextLexer
/ tools / release
Fernando Perez
|
r2118 | #!/usr/bin/env python | ||
"""IPython release script. | ||||
Ville M. Vainio
|
r1032 | |||
Fernando Perez
|
r4450 | This should ONLY be run at real release time. | ||
Fernando Perez
|
r2118 | """ | ||
Fernando Perez
|
r4450 | from __future__ import print_function | ||
Ville M. Vainio
|
r1032 | |||
Fernando Perez
|
r2118 | from toollib import * | ||
# Get main ipython dir, this will raise if it doesn't pass some checks | ||||
ipdir = get_ipdir() | ||||
Fernando Perez
|
r4450 | tooldir = pjoin(ipdir, 'tools') | ||
distdir = pjoin(ipdir, 'dist') | ||||
Fernando Perez
|
r3135 | # Where I keep static backups of each release | ||
ipbackupdir = os.path.expanduser('~/ipython/backup') | ||||
# Start in main IPython dir | ||||
Fernando Perez
|
r2118 | cd(ipdir) | ||
# Load release info | ||||
Brian Granger
|
r2146 | execfile(pjoin('IPython','core','release.py')) | ||
Fernando Perez
|
r2118 | |||
Fernando Perez
|
r4450 | # Build site addresses for file uploads | ||
release_site = '%s/release/%s' % (archive, version) | ||||
Fernando Perez
|
r4457 | backup_site = '%s/backup/' % archive | ||
Fernando Perez
|
r4450 | |||
# Start actual release process | ||||
print() | ||||
print('Releasing IPython') | ||||
print('=================') | ||||
print() | ||||
print('Version:', version) | ||||
print() | ||||
print('Source IPython directory:', ipdir) | ||||
print() | ||||
Ville M. Vainio
|
r1032 | |||
Fernando Perez
|
r3135 | # Perform local backup, go to tools dir to run it. | ||
cd(tooldir) | ||||
Fernando Perez
|
r4450 | sh('./make_tarball.py') | ||
sh('mv ipython-*.tgz %s' % ipbackupdir) | ||||
Ville M. Vainio
|
r1032 | |||
Fernando Perez
|
r2115 | # Build release files | ||
Fernando Perez
|
r4450 | sh('./build_release %s' % ipdir) | ||
Ville M. Vainio
|
r1032 | |||
# Register with the Python Package Index (PyPI) | ||||
Fernando Perez
|
r4450 | print( 'Registering with PyPI...') | ||
Fernando Perez
|
r3135 | cd(ipdir) | ||
Fernando Perez
|
r4450 | sh('./setup.py register') | ||
Ville M. Vainio
|
r1032 | |||
# Upload all files | ||||
Fernando Perez
|
r4450 | sh('./setup.py sdist --formats=gztar,zip upload') | ||
Fernando Perez
|
r3135 | cd(distdir) | ||
Fernando Perez
|
r4450 | print( 'Uploading distribution files...') | ||
Fernando Perez
|
r5791 | |||
# Make target dir if it doesn't exist | ||||
sh('ssh %s "mkdir -p %s/release/%s" ' % (archive_user, archive_dir, version)) | ||||
Fernando Perez
|
r4450 | sh('scp * %s' % release_site) | ||
Ville M. Vainio
|
r1032 | |||
Fernando Perez
|
r4450 | print( 'Uploading backup files...') | ||
Fernando Perez
|
r2118 | cd(ipbackupdir) | ||
Fernando Perez
|
r4450 | sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site) | ||
Ville M. Vainio
|
r1032 | |||
Fernando Perez
|
r4450 | print('Done!') | ||