##// END OF EJS Templates
Merge pull request #10241 from takluyver/release-integrate-twine...
Merge pull request #10241 from takluyver/release-integrate-twine Upload to PyPI in release upload script

File last commit:

r23302:0a50b822
r23304:a1a338f2 merge
Show More
release
94 lines | 2.3 KiB | text/plain | TextLexer
Fernando Perez
Cleaned up release tools directory....
r2118 #!/usr/bin/env python
"""IPython release script.
Ville M. Vainio
crlf -> lf
r1032
Fernando Perez
Update release-related tools, make more py3k-friendly.
r4450 This should ONLY be run at real release time.
Fernando Perez
Cleaned up release tools directory....
r2118 """
Fernando Perez
Update release-related tools, make more py3k-friendly.
r4450 from __future__ import print_function
Ville M. Vainio
crlf -> lf
r1032
Matthias Bussonnier
add explicits imports on release tools
r22021 import os
Thomas Kluyver
Upload to PyPI in release upload script...
r23302 from subprocess import call
Matthias Bussonnier
add explicits imports on release tools
r22021 import sys
Matthias Bussonnier
Improve build script....
r22028 from toollib import (get_ipdir, pjoin, cd, execfile, sh, archive,
Matthias Bussonnier
Factor build logic into function
r22043 sdists, archive_user, archive_dir, buildwheels)
MinRK
add GitHub uploads to release script
r8598 from gh_api import post_download
Fernando Perez
Cleaned up release tools directory....
r2118
# Get main ipython dir, this will raise if it doesn't pass some checks
ipdir = get_ipdir()
Fernando Perez
Update release-related tools, make more py3k-friendly.
r4450 tooldir = pjoin(ipdir, 'tools')
distdir = pjoin(ipdir, 'dist')
Fernando Perez
Add 0.10.1 release notes to docs and minor tool updates....
r3135 # Where I keep static backups of each release
ipbackupdir = os.path.expanduser('~/ipython/backup')
MinRK
updates to release scripts...
r17581 if not os.path.exists(ipbackupdir):
os.makedirs(ipbackupdir)
Fernando Perez
Add 0.10.1 release notes to docs and minor tool updates....
r3135
# Start in main IPython dir
Fernando Perez
Cleaned up release tools directory....
r2118 cd(ipdir)
# Load release info
Matthias Bussonnier
Improve build script....
r22028 version = None
Min RK
remove strict requirement for less,invoke in wheel/sdist...
r19847 execfile(pjoin('IPython','core','release.py'), globals())
Fernando Perez
Cleaned up release tools directory....
r2118
Fernando Perez
Update release-related tools, make more py3k-friendly.
r4450 # Build site addresses for file uploads
release_site = '%s/release/%s' % (archive, version)
Fernando Perez
Fix backup URL. Final commit before 0.11 release.
r4457 backup_site = '%s/backup/' % archive
Fernando Perez
Update release-related tools, make more py3k-friendly.
r4450
# Start actual release process
print()
print('Releasing IPython')
print('=================')
print()
print('Version:', version)
print()
print('Source IPython directory:', ipdir)
print()
Ville M. Vainio
crlf -> lf
r1032
Fernando Perez
Add 0.10.1 release notes to docs and minor tool updates....
r3135 # Perform local backup, go to tools dir to run it.
cd(tooldir)
Ville M. Vainio
crlf -> lf
r1032
Matthias Bussonnier
Update release process instruction....
r22714 if 'upload' in sys.argv:
cd(distdir)
Thomas Kluyver
Upload to PyPI in release upload script...
r23302 #print( 'Uploading distribution files to GitHub...')
Ville M. Vainio
crlf -> lf
r1032
Matthias Bussonnier
Update release process instruction....
r22714 for fname in os.listdir('.'):
# TODO: update to GitHub releases API
continue
print('uploading %s to GitHub' % fname)
desc = "IPython %s source distribution" % version
post_download("ipython/ipython", fname, description=desc)
Ville M. Vainio
crlf -> lf
r1032
Matthias Bussonnier
Update release process instruction....
r22714 # Make target dir if it doesn't exist
Thomas Kluyver
Upload to PyPI in release upload script...
r23302 print('1. Uploading IPython to archive.ipython.org')
Matthias Bussonnier
Update release process instruction....
r22714 sh('ssh %s "mkdir -p %s/release/%s" ' % (archive_user, archive_dir, version))
sh('scp * %s' % release_site)
Matthias Bussonnier
Factor build logic into function
r22043
Thomas Kluyver
Upload to PyPI in release upload script...
r23302 print('2. Uploading backup files...')
Matthias Bussonnier
Update release process instruction....
r22714 cd(ipbackupdir)
sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site)
Matthias Bussonnier
Update release script not to upload insecurly
r22023
Thomas Kluyver
Upload to PyPI in release upload script...
r23302 print('3. Uploading to PyPI using twine')
cd(distdir)
call(['twine', 'upload'] + os.listdir('.'))
Matthias Bussonnier
Update release process instruction....
r22714 else:
Thomas Kluyver
Upload to PyPI in release upload script...
r23302 # Build, but don't upload
# Make backup tarball
Matthias Bussonnier
Update release process instruction....
r22714 sh('./make_tarball.py')
sh('mv ipython-*.tgz %s' % ipbackupdir)
Matthias Bussonnier
Improve build script....
r22028
Matthias Bussonnier
Update release process instruction....
r22714 # Build release files
sh('./build_release %s' % ipdir)
Matthias Bussonnier
Improve build script....
r22028
Matthias Bussonnier
Update release process instruction....
r22714 cd(ipdir)
MinRK
add wheels to release...
r16795
Matthias Bussonnier
Update release process instruction....
r22714 # Upload all files
sh(sdists)
Fernando Perez
Small fixes to release script to create remote paths.
r5791
Matthias Bussonnier
Update release process instruction....
r22714 buildwheels()
Thomas Kluyver
Upload to PyPI in release upload script...
r23302 print("`./release upload` to upload source distribution on PyPI and ipython archive")
Matthias Bussonnier
Update release process instruction....
r22714 sys.exit(0)
MinRK
add GitHub uploads to release script
r8598
Ville M. Vainio
crlf -> lf
r1032