##// END OF EJS Templates
Finish doc/build tools cleanup....
Fernando Perez -
Show More
@@ -3140,7 +3140,7 b' Defaulting color scheme to \'NoColor\'"""'
3140 screen_lines=self.shell.rc.screen_length)
3140 screen_lines=self.shell.rc.screen_length)
3141
3141
3142 def magic_cpaste(self, parameter_s=''):
3142 def magic_cpaste(self, parameter_s=''):
3143 """Allows you to paste & execute a pre-formatted code block from clipboard
3143 """Allows you to paste & execute a pre-formatted code block from clipboard.
3144
3144
3145 You must terminate the block with '--' (two minus-signs) alone on the
3145 You must terminate the block with '--' (two minus-signs) alone on the
3146 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
3146 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
@@ -3148,8 +3148,9 b' Defaulting color scheme to \'NoColor\'"""'
3148
3148
3149 The block is dedented prior to execution to enable execution of method
3149 The block is dedented prior to execution to enable execution of method
3150 definitions. '>' and '+' characters at the beginning of a line are
3150 definitions. '>' and '+' characters at the beginning of a line are
3151 ignored, to allow pasting directly from e-mails, diff files and doctests.
3151 ignored, to allow pasting directly from e-mails, diff files and
3152 The executed block is also assigned to variable named 'pasted_block' for
3152 doctests (the '...' continuation prompt is also stripped). The
3153 executed block is also assigned to variable named 'pasted_block' for
3153 later editing with '%edit pasted_block'.
3154 later editing with '%edit pasted_block'.
3154
3155
3155 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
3156 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
@@ -3166,8 +3167,15 b' Defaulting color scheme to \'NoColor\'"""'
3166 par = args.strip()
3167 par = args.strip()
3167 sentinel = opts.get('s','--')
3168 sentinel = opts.get('s','--')
3168
3169
3169 strip_from_start = [re.compile(e) for e in
3170 # Regular expressions that declare text we strip from the input:
3170 [r'^\s*(\s?>)+',r'^\s*In \[\d+\]:',r'^\++']]
3171 strip_re = [r'^\s*In \[\d+\]:', # IPython input prompt
3172 r'^\s*(\s?>)+', # Python input prompt
3173 r'^\s*\.{3,}', # Continuation prompts
3174 r'^\++',
3175 ]
3176
3177 strip_from_start = map(re.compile,strip_re)
3178
3171 from IPython import iplib
3179 from IPython import iplib
3172 lines = []
3180 lines = []
3173 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
3181 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
@@ -22,7 +22,7 b" name = 'ipython'"
22 # because bdist_rpm does not accept dashes (an RPM) convention, and
22 # because bdist_rpm does not accept dashes (an RPM) convention, and
23 # bdist_deb does not accept underscores (a Debian convention).
23 # bdist_deb does not accept underscores (a Debian convention).
24
24
25 revision = '83'
25 revision = '84'
26 branch = 'ipython'
26 branch = 'ipython'
27
27
28 if branch == 'ipython':
28 if branch == 'ipython':
@@ -377,8 +377,8 b' class ListTB(TBTools):'
377
377
378 def __call__(self, etype, value, elist):
378 def __call__(self, etype, value, elist):
379 Term.cout.flush()
379 Term.cout.flush()
380 Term.cerr.flush()
381 print >> Term.cerr, self.text(etype,value,elist)
380 print >> Term.cerr, self.text(etype,value,elist)
381 Term.cerr.flush()
382
382
383 def text(self,etype, value, elist,context=5):
383 def text(self,etype, value, elist,context=5):
384 """Return a color formatted string with the traceback info."""
384 """Return a color formatted string with the traceback info."""
@@ -855,8 +855,8 b' class VerboseTB(TBTools):'
855 (etype, evalue, etb) = info or sys.exc_info()
855 (etype, evalue, etb) = info or sys.exc_info()
856 self.tb = etb
856 self.tb = etb
857 Term.cout.flush()
857 Term.cout.flush()
858 Term.cerr.flush()
859 print >> Term.cerr, self.text(etype, evalue, etb)
858 print >> Term.cerr, self.text(etype, evalue, etb)
859 Term.cerr.flush()
860
860
861 # Changed so an instance can just be called as VerboseTB_inst() and print
861 # Changed so an instance can just be called as VerboseTB_inst() and print
862 # out the right info on its own.
862 # out the right info on its own.
@@ -977,13 +977,13 b' class AutoFormattedTB(FormattedTB):'
977 if out is None:
977 if out is None:
978 out = Term.cerr
978 out = Term.cerr
979 Term.cout.flush()
979 Term.cout.flush()
980 out.flush()
981 if tb_offset is not None:
980 if tb_offset is not None:
982 tb_offset, self.tb_offset = self.tb_offset, tb_offset
981 tb_offset, self.tb_offset = self.tb_offset, tb_offset
983 print >> out, self.text(etype, evalue, etb)
982 print >> out, self.text(etype, evalue, etb)
984 self.tb_offset = tb_offset
983 self.tb_offset = tb_offset
985 else:
984 else:
986 print >> out, self.text(etype, evalue, etb)
985 print >> out, self.text(etype, evalue, etb)
986 out.flush()
987 try:
987 try:
988 self.debugger()
988 self.debugger()
989 except KeyboardInterrupt:
989 except KeyboardInterrupt:
@@ -9,24 +9,19 b' graft setupext'
9 graft IPython/UserConfig
9 graft IPython/UserConfig
10
10
11 graft doc
11 graft doc
12 exclude doc/\#*
12 exclude doc/*.1
13 exclude doc/*.1
13 exclude doc/manual_base*
14 exclude doc/ChangeLog.*
14 exclude doc/ChangeLog.*
15 exclude doc/\#*
16 exclude doc/update_magic.sh
17 exclude doc/update_version.sh
15 exclude doc/update_version.sh
18 exclude doc/manual_base*
19 exclude doc/manual/WARNINGS
20 exclude doc/manual/*.aux
21 exclude doc/manual/*.log
22 exclude doc/manual/*.out
23 exclude doc/manual/*.pl
24 exclude doc/manual/*.tex
25 exclude doc/build
26 exclude doc/attic
27
28
29
16
17 # There seems to be no way of excluding whole subdirectories, other than
18 # manually excluding all their subdirs. distutils really is horrible...
19 exclude doc/attic/*
20 exclude doc/build/doctrees/*
21 exclude doc/build/html/_sources/*
22 exclude doc/build/html/_static/*
23 exclude doc/build/html/*
24 exclude doc/build/latex/*
30
25
31 global-exclude *~
26 global-exclude *~
32 global-exclude *.flc
27 global-exclude *.flc
@@ -1,3 +1,18 b''
1 2008-05-28 Fernando Perez <Fernando.Perez@berkeley.edu>
2
3 * ../win32_manual_post_install.py (run): Fix the windows installer
4 so the links to the docs are correct.
5
6 * IPython/ultraTB.py: flush stderr after writing to it to fix
7 problems with exception traceback ordering in some platforms.
8 Thanks to a report/fix by Jie Tang <jietang86-AT-gmail.com>.
9
10 * IPython/Magic.py (magic_cpaste): add stripping of continuation
11 prompts, feature requested by Stefan vdW.
12
13 * ../setup.py: updates to build and release tools in preparation
14 for 0.8.3 release.
15
1 2008-05-27 Ville Vainio <vivainio@gmail.com>
16 2008-05-27 Ville Vainio <vivainio@gmail.com>
2
17
3 * iplib.py, ipmaker.py: survive lack of doctest and site._Helper
18 * iplib.py, ipmaker.py: survive lack of doctest and site._Helper
@@ -4,7 +4,7 b''
4
4
5 Under Posix environments it works like a typical setup.py script.
5 Under Posix environments it works like a typical setup.py script.
6 Under Windows, the command sdist is not supported, since IPython
6 Under Windows, the command sdist is not supported, since IPython
7 requires utilities, which are not available under Windows."""
7 requires utilities which are not available under Windows."""
8
8
9 #*****************************************************************************
9 #*****************************************************************************
10 # Copyright (C) 2001-2005 Fernando Perez <fperez@colorado.edu>
10 # Copyright (C) 2001-2005 Fernando Perez <fperez@colorado.edu>
@@ -18,15 +18,41 b' import os'
18 import sys
18 import sys
19
19
20 from glob import glob
20 from glob import glob
21
22 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
23 # update it when the contents of directories change.
24 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
25
26 from distutils.core import setup
21 from setupext import install_data_ext
27 from setupext import install_data_ext
22
28
29 # Local imports
30 from IPython.genutils import target_update
31
23 # A few handy globals
32 # A few handy globals
24 isfile = os.path.isfile
33 isfile = os.path.isfile
25 pjoin = os.path.join
34 pjoin = os.path.join
26
35
27 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
36 ##############################################################################
28 # update it when the contents of directories change.
37 # Utility functions
29 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
38 def oscmd(s):
39 print ">", s
40 os.system(s)
41
42 # A little utility we'll need below, since glob() does NOT allow you to do
43 # exclusion on multiple endings!
44 def file_doesnt_endwith(test,endings):
45 """Return true if test is a file and its name does NOT end with any
46 of the strings listed in endings."""
47 if not isfile(test):
48 return False
49 for e in endings:
50 if test.endswith(e):
51 return False
52 return True
53
54 ###############################################################################
55 # Main code begins
30
56
31 if os.name == 'posix':
57 if os.name == 'posix':
32 os_name = 'posix'
58 os_name = 'posix'
@@ -36,45 +62,45 b' else:'
36 print 'Unsupported operating system:',os.name
62 print 'Unsupported operating system:',os.name
37 sys.exit(1)
63 sys.exit(1)
38
64
39 # Under Windows, 'sdist' is not supported, since it requires lyxport (and
65 # Under Windows, 'sdist' has not been supported. Now that the docs build with
40 # hence lyx,perl,latex,pdflatex,latex2html,sh,...)
66 # Sphinx it might work, but let's not turn it on until someone confirms that it
67 # actually works.
41 if os_name == 'windows' and 'sdist' in sys.argv:
68 if os_name == 'windows' and 'sdist' in sys.argv:
42 print 'The sdist command is not available under Windows. Exiting.'
69 print 'The sdist command is not available under Windows. Exiting.'
43 sys.exit(1)
70 sys.exit(1)
44
71
45 from distutils.core import setup
46
47 # update the manuals when building a source dist
72 # update the manuals when building a source dist
48 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
73 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
49 import textwrap
74 import textwrap
50 from IPython.genutils import target_update
75
51 # list of things to be updated. Each entry is a triplet of args for
76 # List of things to be updated. Each entry is a triplet of args for
52 # target_update()
77 # target_update()
53
78 to_update = [ # The do_sphinx scripts builds html and pdf, so just one
54 def oscmd(s):
79 # target is enough to cover all manual generation
55 print ">", s
80 ('doc/manual/ipython.pdf',
56 os.system(s)
81 ['IPython/Release.py','doc/source/ipython.rst'],
57
82 "cd doc && python do_sphinx.py" ),
58 oscmd("cd doc && python do_sphinx.py")
83
59
84 # FIXME - Disabled for now: we need to redo an automatic way
60 oscmd("cd doc && gzip -9c ipython.1 > ipython.1.gz")
85 # of generating the magic info inside the rst.
61 oscmd("cd doc && gzip -9c pycolor.1 > pycolor.1.gz")
86 #('doc/magic.tex',
87 #['IPython/Magic.py'],
88 #"cd doc && ./update_magic.sh" ),
89
90 ('doc/ipython.1.gz',
91 ['doc/ipython.1'],
92 "cd doc && gzip -9c ipython.1 > ipython.1.gz"),
93
94 ('doc/pycolor.1.gz',
95 ['doc/pycolor.1'],
96 "cd doc && gzip -9c pycolor.1 > pycolor.1.gz"),
97 ]
98
99 [ target_update(*t) for t in to_update ]
62
100
63 # Release.py contains version, authors, license, url, keywords, etc.
101 # Release.py contains version, authors, license, url, keywords, etc.
64 execfile(pjoin('IPython','Release.py'))
102 execfile(pjoin('IPython','Release.py'))
65
103
66 # A little utility we'll need below, since glob() does NOT allow you to do
67 # exclusion on multiple endings!
68 def file_doesnt_endwith(test,endings):
69 """Return true if test is a file and its name does NOT end with any
70 of the strings listed in endings."""
71 if not isfile(test):
72 return False
73 for e in endings:
74 if test.endswith(e):
75 return False
76 return True
77
78 # I can't find how to make distutils create a nested dir. structure, so
104 # I can't find how to make distutils create a nested dir. structure, so
79 # in the meantime do it manually. Butt ugly.
105 # in the meantime do it manually. Butt ugly.
80 # Note that http://www.redbrick.dcu.ie/~noel/distutils.html, ex. 2/3, contain
106 # Note that http://www.redbrick.dcu.ie/~noel/distutils.html, ex. 2/3, contain
@@ -87,18 +113,15 b" manpagebase = 'share/man/man1'"
87 # MANIFEST.in file.
113 # MANIFEST.in file.
88 exclude = ('.sh','.1.gz')
114 exclude = ('.sh','.1.gz')
89 docfiles = filter(lambda f:file_doesnt_endwith(f,exclude),glob('doc/*'))
115 docfiles = filter(lambda f:file_doesnt_endwith(f,exclude),glob('doc/*'))
90
91 examfiles = filter(isfile, glob('doc/examples/*.py'))
116 examfiles = filter(isfile, glob('doc/examples/*.py'))
92 manfiles = filter(isfile, glob('doc/build/html/*'))
117 manfiles = filter(isfile, glob('doc/manual/*'))
93 manstatic = filter(isfile, glob('doc/build/html/_static/*'))
118 manstatic = filter(isfile, glob('doc/manual/_static/*'))
94
95 # filter(isfile, glob('doc/manual/*.css')) + \
96 # filter(isfile, glob('doc/manual/*.png'))
97
98 manpages = filter(isfile, glob('doc/*.1.gz'))
119 manpages = filter(isfile, glob('doc/*.1.gz'))
120
99 cfgfiles = filter(isfile, glob('IPython/UserConfig/*'))
121 cfgfiles = filter(isfile, glob('IPython/UserConfig/*'))
100 scriptfiles = filter(isfile, ['scripts/ipython','scripts/pycolor',
122 scriptfiles = filter(isfile, ['scripts/ipython','scripts/pycolor',
101 'scripts/irunner'])
123 'scripts/irunner'])
124
102 igridhelpfiles = filter(isfile, glob('IPython/Extensions/igrid_help.*'))
125 igridhelpfiles = filter(isfile, glob('IPython/Extensions/igrid_help.*'))
103
126
104 # Script to be run by the windows binary installer after the default setup
127 # Script to be run by the windows binary installer after the default setup
@@ -129,19 +152,15 b" if 'setuptools' in sys.modules:"
129 ]}
152 ]}
130 }
153 }
131 scriptfiles = []
154 scriptfiles = []
132 # eggs will lack docs, eaxmples
155 # eggs will lack docs, examples
133 datafiles = []
156 datafiles = []
134
135 #datafiles = [('lib', 'IPython/UserConfig', cfgfiles)]
136 else:
157 else:
158 # Normal, non-setuptools install
137 egg_extra_kwds = {}
159 egg_extra_kwds = {}
138 # package_data of setuptools was introduced to distutils in 2.4
160 # package_data of setuptools was introduced to distutils in 2.4
139 if sys.version_info < (2,4):
161 if sys.version_info < (2,4):
140 datafiles.append(('lib', 'IPython/UserConfig', cfgfiles))
162 datafiles.append(('lib', 'IPython/UserConfig', cfgfiles))
141
163
142
143
144
145 # Call the setup() routine which does most of the work
164 # Call the setup() routine which does most of the work
146 setup(name = name,
165 setup(name = name,
147 version = version,
166 version = version,
@@ -154,7 +173,9 b' setup(name = name,'
154 license = license,
173 license = license,
155 platforms = platforms,
174 platforms = platforms,
156 keywords = keywords,
175 keywords = keywords,
157 packages = ['IPython', 'IPython.Extensions', 'IPython.external', 'IPython.gui', 'IPython.gui.wx', 'IPython.UserConfig'],
176 packages = ['IPython', 'IPython.Extensions', 'IPython.external',
177 'IPython.gui', 'IPython.gui.wx',
178 'IPython.UserConfig'],
158 scripts = scriptfiles,
179 scripts = scriptfiles,
159 package_data = {'IPython.UserConfig' : ['*'] },
180 package_data = {'IPython.UserConfig' : ['*'] },
160
181
@@ -2,13 +2,22 b''
2
2
3 # release test
3 # release test
4
4
5 cd ~/ipython/ipython
5 ipdir=~/ipython/ipython
6 ipbackupdir=~/ipython/backup
6
7
7 # clean up build/dist directories
8 cd $ipdir
8 rm -rf build/*
9
9 rm -rf dist/*
10 # Clean up build/dist directories
11 rm -rf $ipdir/build/*
12 rm -rf $ipdir/dist/*
13
14 # Perform local backup
15 cd $ipdir/tools
16 ./make_tarball.py
17 mv ipython-*.tgz $ipbackupdir
10
18
11 # build source distros
19 # build source distros
20 cd $ipdir
12 ./setup.py sdist --formats=gztar
21 ./setup.py sdist --formats=gztar
13
22
14 # Build rpms
23 # Build rpms
@@ -25,4 +34,4 b' python2.5 ./setup_bdist_egg.py'
25 ./setup.py bdist_wininst --install-script=ipython_win_post_install.py
34 ./setup.py bdist_wininst --install-script=ipython_win_post_install.py
26
35
27 # Change name so retarded Vista runs the installer correctly
36 # Change name so retarded Vista runs the installer correctly
28 rename 's/win32/win32-setup/' dist/*.exe
37 rename 's/win32/win32-setup/' $ipdir/dist/*.exe
@@ -104,8 +104,8 b' def run(wait=0):'
104 os.mkdir(ip_prog_dir)
104 os.mkdir(ip_prog_dir)
105 os.chdir(ip_prog_dir)
105 os.chdir(ip_prog_dir)
106
106
107 man_pdf = doc_dir + r'\manual.pdf'
107 man_pdf = doc_dir + r'\manual\ipython.pdf'
108 man_htm = doc_dir + r'\manual\manual.html'
108 man_htm = doc_dir + r'\manual\ipython.html'
109
109
110 make_shortcut('IPython.lnk',sys.executable, '"%s"' % ip_filename,
110 make_shortcut('IPython.lnk',sys.executable, '"%s"' % ip_filename,
111 my_documents_dir,
111 my_documents_dir,
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (1049 lines changed) Show them Hide them
General Comments 0
You need to be logged in to leave comments. Login now