Show More
@@ -1,21 +1,22 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | """Simple upload script to push up into the testing directory a local build |
|
3 | 3 | """ |
|
4 | 4 | from __future__ import print_function |
|
5 | 5 | |
|
6 | 6 | from toollib import * |
|
7 | 7 | |
|
8 | 8 | # Get main ipython dir, this will raise if it doesn't pass some checks |
|
9 | 9 | ipdir = get_ipdir() |
|
10 | 10 | distdir = pjoin(ipdir, 'dist') |
|
11 | 11 | |
|
12 | 12 | # Load release info |
|
13 | 13 | execfile(pjoin(ipdir, 'IPython','core','release.py')) |
|
14 | 14 | |
|
15 | 15 | # Build site addresses for file uploads |
|
16 | 16 | testing_site = '%s/testing/%s' % (archive, version) |
|
17 | 17 | |
|
18 | 18 | cd(distdir) |
|
19 | 19 | |
|
20 | # FIXME: this assumes the path *with the version number* exists on the server | |
|
20 | # Create remote path if it doesn't exist. | |
|
21 | sh('ssh %s "mkdir -p %s/testing/%s" ' % (archive_user, archive_dir, version)) | |
|
21 | 22 | sh('scp * %s' % testing_site) |
@@ -1,55 +1,57 b'' | |||
|
1 | 1 | """Various utilities common to IPython release and maintenance tools. |
|
2 | 2 | """ |
|
3 | 3 | from __future__ import print_function |
|
4 | 4 | |
|
5 | 5 | # Library imports |
|
6 | 6 | import os |
|
7 | 7 | import sys |
|
8 | 8 | |
|
9 | 9 | from distutils.dir_util import remove_tree |
|
10 | 10 | |
|
11 | 11 | # Useful shorthands |
|
12 | 12 | pjoin = os.path.join |
|
13 | 13 | cd = os.chdir |
|
14 | 14 | |
|
15 | 15 | # Constants |
|
16 | 16 | |
|
17 | 17 | # SSH root address of the archive site |
|
18 |
archive = 'ipython@archive.ipython.org |
|
|
18 | archive_user = 'ipython@archive.ipython.org' | |
|
19 | archive_dir = 'archive.ipython.org' | |
|
20 | archive = '%s:%s' % (archive_user, archive_dir) | |
|
19 | 21 | |
|
20 | 22 | # Utility functions |
|
21 | 23 | def sh(cmd): |
|
22 | 24 | """Run system command in shell, raise SystemExit if it returns an error.""" |
|
23 | 25 | print("$", cmd) |
|
24 | 26 | stat = os.system(cmd) |
|
25 | 27 | #stat = 0 # Uncomment this and comment previous to run in debug mode |
|
26 | 28 | if stat: |
|
27 | 29 | raise SystemExit("Command %s failed with code: %s" % (cmd, stat)) |
|
28 | 30 | |
|
29 | 31 | # Backwards compatibility |
|
30 | 32 | c = sh |
|
31 | 33 | |
|
32 | 34 | def get_ipdir(): |
|
33 | 35 | """Get IPython directory from command line, or assume it's the one above.""" |
|
34 | 36 | |
|
35 | 37 | # Initialize arguments and check location |
|
36 | 38 | try: |
|
37 | 39 | ipdir = sys.argv[1] |
|
38 | 40 | except IndexError: |
|
39 | 41 | ipdir = '..' |
|
40 | 42 | |
|
41 | 43 | ipdir = os.path.abspath(ipdir) |
|
42 | 44 | |
|
43 | 45 | cd(ipdir) |
|
44 | 46 | if not os.path.isdir('IPython') and os.path.isfile('setup.py'): |
|
45 | 47 | raise SystemExit('Invalid ipython directory: %s' % ipdir) |
|
46 | 48 | return ipdir |
|
47 | 49 | |
|
48 | 50 | |
|
49 | 51 | def compile_tree(): |
|
50 | 52 | """Compile all Python files below current directory.""" |
|
51 | 53 | stat = os.system('python -m compileall .') |
|
52 | 54 | if stat: |
|
53 | 55 | msg = '*** ERROR: Some Python files in tree do NOT compile! ***\n' |
|
54 | 56 | msg += 'See messages above for the actual file that produced it.\n' |
|
55 | 57 | raise SystemExit(msg) |
General Comments 0
You need to be logged in to leave comments.
Login now