Show More
@@ -1,85 +1,85 b'' | |||
|
1 | 1 | #!/usr/bin/env python3 |
|
2 | 2 | """IPython release script. |
|
3 | 3 | |
|
4 | 4 | This should ONLY be run at real release time. |
|
5 | 5 | """ |
|
6 | 6 | from __future__ import print_function |
|
7 | 7 | |
|
8 | 8 | import os |
|
9 | 9 | from glob import glob |
|
10 | 10 | from subprocess import call |
|
11 | 11 | import sys |
|
12 | 12 | |
|
13 | 13 | from toollib import (get_ipdir, pjoin, cd, execfile, sh, archive, |
|
14 | 14 | archive_user, archive_dir) |
|
15 | 15 | |
|
16 | 16 | # Get main ipython dir, this will raise if it doesn't pass some checks |
|
17 | 17 | ipdir = get_ipdir() |
|
18 | 18 | tooldir = pjoin(ipdir, 'tools') |
|
19 | 19 | distdir = pjoin(ipdir, 'dist') |
|
20 | 20 | |
|
21 | 21 | # Where I keep static backups of each release |
|
22 | 22 | ipbackupdir = os.path.expanduser('~/ipython/backup') |
|
23 | 23 | if not os.path.exists(ipbackupdir): |
|
24 | 24 | os.makedirs(ipbackupdir) |
|
25 | 25 | |
|
26 | 26 | # Start in main IPython dir |
|
27 | 27 | cd(ipdir) |
|
28 | 28 | |
|
29 | 29 | # Load release info |
|
30 | 30 | version = None |
|
31 | 31 | execfile(pjoin('IPython','core','release.py'), globals()) |
|
32 | 32 | |
|
33 | 33 | # Build site addresses for file uploads |
|
34 | 34 | release_site = '%s/release/%s' % (archive, version) |
|
35 | 35 | backup_site = '%s/backup/' % archive |
|
36 | 36 | |
|
37 | 37 | # Start actual release process |
|
38 | 38 | print() |
|
39 | 39 | print('Releasing IPython') |
|
40 | 40 | print('=================') |
|
41 | 41 | print() |
|
42 | 42 | print('Version:', version) |
|
43 | 43 | print() |
|
44 | 44 | print('Source IPython directory:', ipdir) |
|
45 | 45 | print() |
|
46 | 46 | |
|
47 | 47 | # Perform local backup, go to tools dir to run it. |
|
48 | 48 | cd(tooldir) |
|
49 | 49 | |
|
50 | 50 | if 'upload' in sys.argv: |
|
51 | 51 | cd(distdir) |
|
52 | 52 | |
|
53 | 53 | # do not upload OS specific files like .DS_Store |
|
54 | 54 | to_upload = glob('*.whl')+glob('*.tar.gz') |
|
55 | 55 | |
|
56 | 56 | # Make target dir if it doesn't exist |
|
57 | 57 | print('1. Uploading IPython to archive.ipython.org') |
|
58 | 58 | sh('ssh %s "mkdir -p %s/release/%s" ' % (archive_user, archive_dir, version)) |
|
59 |
sh('scp *.tar.gz *. |
|
|
59 | sh('scp *.tar.gz *.whl %s' % release_site) | |
|
60 | 60 | |
|
61 | 61 | print('2. Uploading backup files...') |
|
62 | 62 | cd(ipbackupdir) |
|
63 | 63 | sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site) |
|
64 | 64 | |
|
65 | 65 | print('3. Uploading to PyPI using twine') |
|
66 | 66 | cd(distdir) |
|
67 | 67 | call(['twine', 'upload', '--verbose'] + to_upload) |
|
68 | 68 | |
|
69 | 69 | else: |
|
70 | 70 | # Build, but don't upload |
|
71 | 71 | |
|
72 | 72 | # Make backup tarball |
|
73 | 73 | sh('python make_tarball.py') |
|
74 | 74 | sh('mv ipython-*.tgz %s' % ipbackupdir) |
|
75 | 75 | |
|
76 | 76 | # Build release files |
|
77 | 77 | sh('./build_release') |
|
78 | 78 | |
|
79 | 79 | cd(ipdir) |
|
80 | 80 | |
|
81 | 81 | print("`./release upload` to upload source distribution on PyPI and ipython archive") |
|
82 | 82 | sys.exit(0) |
|
83 | 83 | |
|
84 | 84 | |
|
85 | 85 |
General Comments 0
You need to be logged in to leave comments.
Login now