##// END OF EJS Templates
Fixing a few bugs to get the win32 installer working again.
Brian Granger -
Show More
@@ -1,36 +1,37 b''
1 include ipython.py
1 include ipython.py
2 include setupbase.py
2 include setupbase.py
3 include setupegg.py
3 include setupegg.py
4
4
5 graft setupext
5 graft setupext
6
6
7 graft scripts
7 graft IPython/kernel
8 graft IPython/kernel
8 graft IPython/config
9 graft IPython/config
9 graft IPython/core
10 graft IPython/core
10 graft IPython/deathrow
11 graft IPython/deathrow
11 graft IPython/external
12 graft IPython/external
12 graft IPython/frontend
13 graft IPython/frontend
13 graft IPython/gui
14 graft IPython/gui
14 graft IPython/lib
15 graft IPython/lib
15 graft IPython/quarantine
16 graft IPython/quarantine
16 graft IPython/scripts
17 graft IPython/scripts
17 graft IPython/testing
18 graft IPython/testing
18 graft IPython/utils
19 graft IPython/utils
19
20
20 recursive-include IPython/Extensions igrid_help*
21 recursive-include IPython/Extensions igrid_help*
21
22
22 graft docs
23 graft docs
23 exclude docs/\#*
24 exclude docs/\#*
24 exclude docs/man/*.1
25 exclude docs/man/*.1
25
26
26 # docs subdirs we want to skip
27 # docs subdirs we want to skip
27 prune docs/attic
28 prune docs/attic
28 prune docs/build
29 prune docs/build
29
30
30 global-exclude *~
31 global-exclude *~
31 global-exclude *.flc
32 global-exclude *.flc
32 global-exclude *.pyc
33 global-exclude *.pyc
33 global-exclude .dircopy.log
34 global-exclude .dircopy.log
34 global-exclude .svn
35 global-exclude .svn
35 global-exclude .bzr
36 global-exclude .bzr
36 global-exclude .hgignore
37 global-exclude .hgignore
@@ -1,106 +1,106 b''
1 #!python
1 #!python
2 """Windows-specific part of the installation"""
2 """Windows-specific part of the installation"""
3
3
4 import os, sys, shutil
4 import os, sys, shutil
5 pjoin = os.path.join
5 pjoin = os.path.join
6
6
7 def mkshortcut(target,description,link_file,*args,**kw):
7 def mkshortcut(target,description,link_file,*args,**kw):
8 """make a shortcut if it doesn't exist, and register its creation"""
8 """make a shortcut if it doesn't exist, and register its creation"""
9
9
10 create_shortcut(target, description, link_file,*args,**kw)
10 create_shortcut(target, description, link_file,*args,**kw)
11 file_created(link_file)
11 file_created(link_file)
12
12
13 def install():
13 def install():
14 """Routine to be run by the win32 installer with the -install switch."""
14 """Routine to be run by the win32 installer with the -install switch."""
15
15
16 from IPython.Release import version
16 from IPython.core.release import version
17
17
18 # Get some system constants
18 # Get some system constants
19 prefix = sys.prefix
19 prefix = sys.prefix
20 python = pjoin(prefix, 'python.exe')
20 python = pjoin(prefix, 'python.exe')
21
21
22 # Lookup path to common startmenu ...
22 # Lookup path to common startmenu ...
23 ip_start_menu = pjoin(get_special_folder_path('CSIDL_COMMON_PROGRAMS'), 'IPython')
23 ip_start_menu = pjoin(get_special_folder_path('CSIDL_COMMON_PROGRAMS'), 'IPython')
24 # Create IPython entry ...
24 # Create IPython entry ...
25 if not os.path.isdir(ip_start_menu):
25 if not os.path.isdir(ip_start_menu):
26 os.mkdir(ip_start_menu)
26 os.mkdir(ip_start_menu)
27 directory_created(ip_start_menu)
27 directory_created(ip_start_menu)
28
28
29 # Create .py and .bat files to make things available from
29 # Create .py and .bat files to make things available from
30 # the Windows command line. Thanks to the Twisted project
30 # the Windows command line. Thanks to the Twisted project
31 # for this logic!
31 # for this logic!
32 programs = [
32 programs = [
33 'ipython',
33 'ipython',
34 'iptest',
34 'iptest',
35 'ipcontroller',
35 'ipcontroller',
36 'ipengine',
36 'ipengine',
37 'ipcluster',
37 'ipcluster',
38 'ipythonx',
38 'ipythonx',
39 'ipython-wx',
39 'ipython-wx',
40 'irunner'
40 'irunner'
41 ]
41 ]
42 scripts = pjoin(prefix,'scripts')
42 scripts = pjoin(prefix,'scripts')
43 for program in programs:
43 for program in programs:
44 raw = pjoin(scripts, program)
44 raw = pjoin(scripts, program)
45 bat = raw + '.bat'
45 bat = raw + '.bat'
46 py = raw + '.py'
46 py = raw + '.py'
47 # Create .py versions of the scripts
47 # Create .py versions of the scripts
48 shutil.copy(raw, py)
48 shutil.copy(raw, py)
49 # Create .bat files for each of the scripts
49 # Create .bat files for each of the scripts
50 bat_file = file(bat,'w')
50 bat_file = file(bat,'w')
51 bat_file.write("@%s %s %%*" % (python, py))
51 bat_file.write("@%s %s %%*" % (python, py))
52 bat_file.close()
52 bat_file.close()
53
53
54 # Now move onto setting the Start Menu up
54 # Now move onto setting the Start Menu up
55 ipybase = pjoin(scripts, 'ipython')
55 ipybase = pjoin(scripts, 'ipython')
56
56
57 link = pjoin(ip_start_menu, 'IPython.lnk')
57 link = pjoin(ip_start_menu, 'IPython.lnk')
58 cmd = '"%s"' % ipybase
58 cmd = '"%s"' % ipybase
59 mkshortcut(python,'IPython',link,cmd)
59 mkshortcut(python,'IPython',link,cmd)
60
60
61 link = pjoin(ip_start_menu, 'pysh.lnk')
61 link = pjoin(ip_start_menu, 'pysh.lnk')
62 cmd = '"%s" -p sh' % ipybase
62 cmd = '"%s" -p sh' % ipybase
63 mkshortcut(python,'IPython (command prompt mode)',link,cmd)
63 mkshortcut(python,'IPython (command prompt mode)',link,cmd)
64
64
65 link = pjoin(ip_start_menu, 'pylab.lnk')
65 link = pjoin(ip_start_menu, 'pylab.lnk')
66 cmd = '"%s" -pylab' % ipybase
66 cmd = '"%s" -pylab' % ipybase
67 mkshortcut(python,'IPython (PyLab mode)',link,cmd)
67 mkshortcut(python,'IPython (PyLab mode)',link,cmd)
68
68
69 link = pjoin(ip_start_menu, 'scipy.lnk')
69 link = pjoin(ip_start_menu, 'scipy.lnk')
70 cmd = '"%s" -pylab -p scipy' % ipybase
70 cmd = '"%s" -pylab -p scipy' % ipybase
71 mkshortcut(python,'IPython (scipy profile)',link,cmd)
71 mkshortcut(python,'IPython (scipy profile)',link,cmd)
72
72
73 link = pjoin(ip_start_menu, 'IPython test suite.lnk')
73 link = pjoin(ip_start_menu, 'IPython test suite.lnk')
74 cmd = '"%s" -vv' % pjoin(scripts, 'iptest')
74 cmd = '"%s" -vv' % pjoin(scripts, 'iptest')
75 mkshortcut(python,'Run the IPython test suite',link,cmd)
75 mkshortcut(python,'Run the IPython test suite',link,cmd)
76
76
77 link = pjoin(ip_start_menu, 'ipcontroller.lnk')
77 link = pjoin(ip_start_menu, 'ipcontroller.lnk')
78 cmd = '"%s" -xy' % pjoin(scripts, 'ipcontroller')
78 cmd = '"%s" -xy' % pjoin(scripts, 'ipcontroller')
79 mkshortcut(python,'IPython controller',link,cmd)
79 mkshortcut(python,'IPython controller',link,cmd)
80
80
81 link = pjoin(ip_start_menu, 'ipengine.lnk')
81 link = pjoin(ip_start_menu, 'ipengine.lnk')
82 cmd = '"%s"' % pjoin(scripts, 'ipengine')
82 cmd = '"%s"' % pjoin(scripts, 'ipengine')
83 mkshortcut(python,'IPython engine',link,cmd)
83 mkshortcut(python,'IPython engine',link,cmd)
84
84
85 # Create documentation shortcuts ...
85 # Create documentation shortcuts ...
86 t = prefix + r'\share\doc\ipython\manual\ipython.pdf'
86 t = prefix + r'\share\doc\ipython\manual\ipython.pdf'
87 f = ip_start_menu + r'\Manual in PDF.lnk'
87 f = ip_start_menu + r'\Manual in PDF.lnk'
88 mkshortcut(t,r'IPython Manual - PDF-Format',f)
88 mkshortcut(t,r'IPython Manual - PDF-Format',f)
89
89
90 t = prefix + r'\share\doc\ipython\manual\html\index.html'
90 t = prefix + r'\share\doc\ipython\manual\html\index.html'
91 f = ip_start_menu + r'\Manual in HTML.lnk'
91 f = ip_start_menu + r'\Manual in HTML.lnk'
92 mkshortcut(t,'IPython Manual - HTML-Format',f)
92 mkshortcut(t,'IPython Manual - HTML-Format',f)
93
93
94
94
95 def remove():
95 def remove():
96 """Routine to be run by the win32 installer with the -remove switch."""
96 """Routine to be run by the win32 installer with the -remove switch."""
97 pass
97 pass
98
98
99 # main()
99 # main()
100 if len(sys.argv) > 1:
100 if len(sys.argv) > 1:
101 if sys.argv[1] == '-install':
101 if sys.argv[1] == '-install':
102 install()
102 install()
103 elif sys.argv[1] == '-remove':
103 elif sys.argv[1] == '-remove':
104 remove()
104 remove()
105 else:
105 else:
106 print "Script was called with option %s" % sys.argv[1]
106 print "Script was called with option %s" % sys.argv[1]
@@ -1,296 +1,296 b''
1 # encoding: utf-8
1 # encoding: utf-8
2
2
3 """
3 """
4 This module defines the things that are used in setup.py for building IPython
4 This module defines the things that are used in setup.py for building IPython
5
5
6 This includes:
6 This includes:
7
7
8 * The basic arguments to setup
8 * The basic arguments to setup
9 * Functions for finding things like packages, package data, etc.
9 * Functions for finding things like packages, package data, etc.
10 * A function for checking dependencies.
10 * A function for checking dependencies.
11 """
11 """
12
12
13 __docformat__ = "restructuredtext en"
13 __docformat__ = "restructuredtext en"
14
14
15 #-------------------------------------------------------------------------------
15 #-------------------------------------------------------------------------------
16 # Copyright (C) 2008 The IPython Development Team
16 # Copyright (C) 2008 The IPython Development Team
17 #
17 #
18 # Distributed under the terms of the BSD License. The full license is in
18 # Distributed under the terms of the BSD License. The full license is in
19 # the file COPYING, distributed as part of this software.
19 # the file COPYING, distributed as part of this software.
20 #-------------------------------------------------------------------------------
20 #-------------------------------------------------------------------------------
21
21
22 #-------------------------------------------------------------------------------
22 #-------------------------------------------------------------------------------
23 # Imports
23 # Imports
24 #-------------------------------------------------------------------------------
24 #-------------------------------------------------------------------------------
25
25
26 import os, sys
26 import os, sys
27
27
28 from glob import glob
28 from glob import glob
29
29
30 from setupext import install_data_ext
30 from setupext import install_data_ext
31
31
32 #-------------------------------------------------------------------------------
32 #-------------------------------------------------------------------------------
33 # Useful globals and utility functions
33 # Useful globals and utility functions
34 #-------------------------------------------------------------------------------
34 #-------------------------------------------------------------------------------
35
35
36 # A few handy globals
36 # A few handy globals
37 isfile = os.path.isfile
37 isfile = os.path.isfile
38 pjoin = os.path.join
38 pjoin = os.path.join
39
39
40 def oscmd(s):
40 def oscmd(s):
41 print ">", s
41 print ">", s
42 os.system(s)
42 os.system(s)
43
43
44 # A little utility we'll need below, since glob() does NOT allow you to do
44 # A little utility we'll need below, since glob() does NOT allow you to do
45 # exclusion on multiple endings!
45 # exclusion on multiple endings!
46 def file_doesnt_endwith(test,endings):
46 def file_doesnt_endwith(test,endings):
47 """Return true if test is a file and its name does NOT end with any
47 """Return true if test is a file and its name does NOT end with any
48 of the strings listed in endings."""
48 of the strings listed in endings."""
49 if not isfile(test):
49 if not isfile(test):
50 return False
50 return False
51 for e in endings:
51 for e in endings:
52 if test.endswith(e):
52 if test.endswith(e):
53 return False
53 return False
54 return True
54 return True
55
55
56 #---------------------------------------------------------------------------
56 #---------------------------------------------------------------------------
57 # Basic project information
57 # Basic project information
58 #---------------------------------------------------------------------------
58 #---------------------------------------------------------------------------
59
59
60 # Release.py contains version, authors, license, url, keywords, etc.
60 # Release.py contains version, authors, license, url, keywords, etc.
61 execfile(pjoin('IPython','core','release.py'))
61 execfile(pjoin('IPython','core','release.py'))
62
62
63 # Create a dict with the basic information
63 # Create a dict with the basic information
64 # This dict is eventually passed to setup after additional keys are added.
64 # This dict is eventually passed to setup after additional keys are added.
65 setup_args = dict(
65 setup_args = dict(
66 name = name,
66 name = name,
67 version = version,
67 version = version,
68 description = description,
68 description = description,
69 long_description = long_description,
69 long_description = long_description,
70 author = author,
70 author = author,
71 author_email = author_email,
71 author_email = author_email,
72 url = url,
72 url = url,
73 download_url = download_url,
73 download_url = download_url,
74 license = license,
74 license = license,
75 platforms = platforms,
75 platforms = platforms,
76 keywords = keywords,
76 keywords = keywords,
77 cmdclass = {'install_data': install_data_ext},
77 cmdclass = {'install_data': install_data_ext},
78 )
78 )
79
79
80
80
81 #---------------------------------------------------------------------------
81 #---------------------------------------------------------------------------
82 # Find packages
82 # Find packages
83 #---------------------------------------------------------------------------
83 #---------------------------------------------------------------------------
84
84
85 def add_package(packages,pname,config=False,tests=False,scripts=False,
85 def add_package(packages,pname,config=False,tests=False,scripts=False,
86 others=None):
86 others=None):
87 """
87 """
88 Add a package to the list of packages, including certain subpackages.
88 Add a package to the list of packages, including certain subpackages.
89 """
89 """
90 packages.append('.'.join(['IPython',pname]))
90 packages.append('.'.join(['IPython',pname]))
91 if config:
91 if config:
92 packages.append('.'.join(['IPython',pname,'config']))
92 packages.append('.'.join(['IPython',pname,'config']))
93 if tests:
93 if tests:
94 packages.append('.'.join(['IPython',pname,'tests']))
94 packages.append('.'.join(['IPython',pname,'tests']))
95 if scripts:
95 if scripts:
96 packages.append('.'.join(['IPython',pname,'scripts']))
96 packages.append('.'.join(['IPython',pname,'scripts']))
97 if others is not None:
97 if others is not None:
98 for o in others:
98 for o in others:
99 packages.append('.'.join(['IPython',pname,o]))
99 packages.append('.'.join(['IPython',pname,o]))
100
100
101 def find_packages():
101 def find_packages():
102 """
102 """
103 Find all of IPython's packages.
103 Find all of IPython's packages.
104 """
104 """
105 packages = ['IPython']
105 packages = ['IPython']
106 add_package(packages, 'config', tests=True)
106 add_package(packages, 'config', tests=True)
107 add_package(packages, 'config.userconfig')
107 add_package(packages, 'config.userconfig')
108 add_package(packages, 'core', tests=True)
108 add_package(packages, 'core', tests=True)
109 add_package(packages, 'deathrow', tests=True)
109 add_package(packages, 'deathrow', tests=True)
110 add_package(packages , 'Extensions')
110 add_package(packages , 'Extensions')
111 add_package(packages, 'external')
111 add_package(packages, 'external')
112 add_package(packages, 'frontend', tests=True)
112 add_package(packages, 'frontend', tests=True)
113 # Don't include the cocoa frontend for now as it is not stable
113 # Don't include the cocoa frontend for now as it is not stable
114 if sys.platform == 'darwin' and False:
114 if sys.platform == 'darwin' and False:
115 add_package(packages, 'frontend.cocoa', tests=True, others=['plugin'])
115 add_package(packages, 'frontend.cocoa', tests=True, others=['plugin'])
116 add_package(packages, 'frontend.cocoa.examples')
116 add_package(packages, 'frontend.cocoa.examples')
117 add_package(packages, 'frontend.cocoa.examples.IPython1Sandbox')
117 add_package(packages, 'frontend.cocoa.examples.IPython1Sandbox')
118 add_package(packages, 'frontend.cocoa.examples.IPython1Sandbox.English.lproj')
118 add_package(packages, 'frontend.cocoa.examples.IPython1Sandbox.English.lproj')
119 add_package(packages, 'frontend.process')
119 add_package(packages, 'frontend.process')
120 add_package(packages, 'frontend.wx')
120 add_package(packages, 'frontend.wx')
121 add_package(packages, 'gui')
121 add_package(packages, 'gui')
122 add_package(packages, 'gui.wx')
122 add_package(packages, 'gui.wx')
123 add_package(packages, 'kernel', config=True, tests=True, scripts=True)
123 add_package(packages, 'kernel', config=True, tests=True, scripts=True)
124 add_package(packages, 'kernel.core', config=True, tests=True)
124 add_package(packages, 'kernel.core', config=True, tests=True)
125 add_package(packages, 'lib', tests=True)
125 add_package(packages, 'lib', tests=True)
126 add_package(packages, 'quarantine', tests=True)
126 add_package(packages, 'quarantine', tests=True)
127 add_package(packages, 'scripts')
127 add_package(packages, 'scripts')
128 add_package(packages, 'testing', tests=True)
128 add_package(packages, 'testing', tests=True)
129 add_package(packages, 'testing.plugin', tests=False)
129 add_package(packages, 'testing.plugin', tests=False)
130 add_package(packages, 'utils', tests=True)
130 add_package(packages, 'utils', tests=True)
131 return packages
131 return packages
132
132
133 #---------------------------------------------------------------------------
133 #---------------------------------------------------------------------------
134 # Find package data
134 # Find package data
135 #---------------------------------------------------------------------------
135 #---------------------------------------------------------------------------
136
136
137 def find_package_data():
137 def find_package_data():
138 """
138 """
139 Find IPython's package_data.
139 Find IPython's package_data.
140 """
140 """
141 # This is not enough for these things to appear in an sdist.
141 # This is not enough for these things to appear in an sdist.
142 # We need to muck with the MANIFEST to get this to work
142 # We need to muck with the MANIFEST to get this to work
143 package_data = {
143 package_data = {
144 'IPython.config.userconfig' : ['*'],
144 'IPython.config.userconfig' : ['*'],
145 'IPython.testing' : ['*.txt']
145 'IPython.testing' : ['*.txt']
146 }
146 }
147 return package_data
147 return package_data
148
148
149
149
150 #---------------------------------------------------------------------------
150 #---------------------------------------------------------------------------
151 # Find data files
151 # Find data files
152 #---------------------------------------------------------------------------
152 #---------------------------------------------------------------------------
153
153
154 def make_dir_struct(tag,base,out_base):
154 def make_dir_struct(tag,base,out_base):
155 """Make the directory structure of all files below a starting dir.
155 """Make the directory structure of all files below a starting dir.
156
156
157 This is just a convenience routine to help build a nested directory
157 This is just a convenience routine to help build a nested directory
158 hierarchy because distutils is too stupid to do this by itself.
158 hierarchy because distutils is too stupid to do this by itself.
159
159
160 XXX - this needs a proper docstring!
160 XXX - this needs a proper docstring!
161 """
161 """
162
162
163 # we'll use these a lot below
163 # we'll use these a lot below
164 lbase = len(base)
164 lbase = len(base)
165 pathsep = os.path.sep
165 pathsep = os.path.sep
166 lpathsep = len(pathsep)
166 lpathsep = len(pathsep)
167
167
168 out = []
168 out = []
169 for (dirpath,dirnames,filenames) in os.walk(base):
169 for (dirpath,dirnames,filenames) in os.walk(base):
170 # we need to strip out the dirpath from the base to map it to the
170 # we need to strip out the dirpath from the base to map it to the
171 # output (installation) path. This requires possibly stripping the
171 # output (installation) path. This requires possibly stripping the
172 # path separator, because otherwise pjoin will not work correctly
172 # path separator, because otherwise pjoin will not work correctly
173 # (pjoin('foo/','/bar') returns '/bar').
173 # (pjoin('foo/','/bar') returns '/bar').
174
174
175 dp_eff = dirpath[lbase:]
175 dp_eff = dirpath[lbase:]
176 if dp_eff.startswith(pathsep):
176 if dp_eff.startswith(pathsep):
177 dp_eff = dp_eff[lpathsep:]
177 dp_eff = dp_eff[lpathsep:]
178 # The output path must be anchored at the out_base marker
178 # The output path must be anchored at the out_base marker
179 out_path = pjoin(out_base,dp_eff)
179 out_path = pjoin(out_base,dp_eff)
180 # Now we can generate the final filenames. Since os.walk only produces
180 # Now we can generate the final filenames. Since os.walk only produces
181 # filenames, we must join back with the dirpath to get full valid file
181 # filenames, we must join back with the dirpath to get full valid file
182 # paths:
182 # paths:
183 pfiles = [pjoin(dirpath,f) for f in filenames]
183 pfiles = [pjoin(dirpath,f) for f in filenames]
184 # Finally, generate the entry we need, which is a triple of (tag,output
184 # Finally, generate the entry we need, which is a triple of (tag,output
185 # path, files) for use as a data_files parameter in install_data.
185 # path, files) for use as a data_files parameter in install_data.
186 out.append((tag,out_path,pfiles))
186 out.append((tag,out_path,pfiles))
187
187
188 return out
188 return out
189
189
190
190
191 def find_data_files():
191 def find_data_files():
192 """
192 """
193 Find IPython's data_files.
193 Find IPython's data_files.
194
194
195 Most of these are docs.
195 Most of these are docs.
196 """
196 """
197
197
198 docdirbase = pjoin('share', 'doc', 'ipython')
198 docdirbase = pjoin('share', 'doc', 'ipython')
199 manpagebase = pjoin('share', 'man', 'man1')
199 manpagebase = pjoin('share', 'man', 'man1')
200
200
201 # Simple file lists can be made by hand
201 # Simple file lists can be made by hand
202 manpages = filter(isfile, glob(pjoin('docs','man','*.1.gz')))
202 manpages = filter(isfile, glob(pjoin('docs','man','*.1.gz')))
203 igridhelpfiles = filter(isfile, glob(pjoin('IPython','Extensions','igrid_help.*')))
203 igridhelpfiles = filter(isfile, glob(pjoin('IPython','Extensions','igrid_help.*')))
204
204
205 # For nested structures, use the utility above
205 # For nested structures, use the utility above
206 example_files = make_dir_struct(
206 example_files = make_dir_struct(
207 'data',
207 'data',
208 pjoin('docs','examples'),
208 pjoin('docs','examples'),
209 pjoin(docdirbase,'examples')
209 pjoin(docdirbase,'examples')
210 )
210 )
211 manual_files = make_dir_struct(
211 manual_files = make_dir_struct(
212 'data',
212 'data',
213 pjoin('docs','dist'),
213 pjoin('docs','dist'),
214 pjoin(docdirbase,'manual')
214 pjoin(docdirbase,'manual')
215 )
215 )
216
216
217 # And assemble the entire output list
217 # And assemble the entire output list
218 data_files = [ ('data',manpagebase, manpages),
218 data_files = [ ('data',manpagebase, manpages),
219 ('data',pjoin(docdirbase,'extensions'),igridhelpfiles),
219 ('data',pjoin(docdirbase,'extensions'),igridhelpfiles),
220 ] + manual_files + example_files
220 ] + manual_files + example_files
221
221
222 ## import pprint # dbg
222 ## import pprint # dbg
223 ## print '*'*80
223 ## print '*'*80
224 ## print 'data files'
224 ## print 'data files'
225 ## pprint.pprint(data_files)
225 ## pprint.pprint(data_files)
226 ## print '*'*80
226 ## print '*'*80
227
227
228 return data_files
228 return data_files
229
229
230 #---------------------------------------------------------------------------
230 #---------------------------------------------------------------------------
231 # Find scripts
231 # Find scripts
232 #---------------------------------------------------------------------------
232 #---------------------------------------------------------------------------
233
233
234 def find_scripts():
234 def find_scripts():
235 """
235 """
236 Find IPython's scripts.
236 Find IPython's scripts.
237 """
237 """
238 kernel_scripts = pjoin('IPython','kernel','scripts')
238 kernel_scripts = pjoin('IPython','kernel','scripts')
239 main_scripts = pjoin('IPython','scripts')
239 main_scripts = pjoin('IPython','scripts')
240 scripts = [pjoin(kernel_scripts, 'ipengine'),
240 scripts = [pjoin(kernel_scripts, 'ipengine'),
241 pjoin(kernel_scripts, 'ipcontroller'),
241 pjoin(kernel_scripts, 'ipcontroller'),
242 pjoin(kernel_scripts, 'ipcluster'),
242 pjoin(kernel_scripts, 'ipcluster'),
243 pjoin(main_scripts, 'ipython'),
243 pjoin(main_scripts, 'ipython'),
244 pjoin(main_scripts, 'ipythonx'),
244 pjoin(main_scripts, 'ipythonx'),
245 pjoin(main_scripts, 'ipython-wx'),
245 pjoin(main_scripts, 'ipython-wx'),
246 pjoin(main_scripts, 'pycolor'),
246 pjoin(main_scripts, 'pycolor'),
247 pjoin(main_scripts, 'irunner'),
247 pjoin(main_scripts, 'irunner'),
248 pjoin(main_scripts, 'iptest')
248 pjoin(main_scripts, 'iptest')
249 ]
249 ]
250
250
251 # Script to be run by the windows binary installer after the default setup
251 # Script to be run by the windows binary installer after the default setup
252 # routine, to add shortcuts and similar windows-only things. Windows
252 # routine, to add shortcuts and similar windows-only things. Windows
253 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
253 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
254 # doesn't find them.
254 # doesn't find them.
255 if 'bdist_wininst' in sys.argv:
255 if 'bdist_wininst' in sys.argv:
256 if len(sys.argv) > 2 and ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
256 if len(sys.argv) > 2 and ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
257 print >> sys.stderr,"ERROR: bdist_wininst must be run alone. Exiting."
257 print >> sys.stderr,"ERROR: bdist_wininst must be run alone. Exiting."
258 sys.exit(1)
258 sys.exit(1)
259 scripts.append(pjoin(main_scripts,'ipython_win_post_install.py'))
259 scripts.append(pjoin('scripts','ipython_win_post_install.py'))
260
260
261 return scripts
261 return scripts
262
262
263 #---------------------------------------------------------------------------
263 #---------------------------------------------------------------------------
264 # Verify all dependencies
264 # Verify all dependencies
265 #---------------------------------------------------------------------------
265 #---------------------------------------------------------------------------
266
266
267 def check_for_dependencies():
267 def check_for_dependencies():
268 """Check for IPython's dependencies.
268 """Check for IPython's dependencies.
269
269
270 This function should NOT be called if running under setuptools!
270 This function should NOT be called if running under setuptools!
271 """
271 """
272 from setupext.setupext import (
272 from setupext.setupext import (
273 print_line, print_raw, print_status, print_message,
273 print_line, print_raw, print_status, print_message,
274 check_for_zopeinterface, check_for_twisted,
274 check_for_zopeinterface, check_for_twisted,
275 check_for_foolscap, check_for_pyopenssl,
275 check_for_foolscap, check_for_pyopenssl,
276 check_for_sphinx, check_for_pygments,
276 check_for_sphinx, check_for_pygments,
277 check_for_nose, check_for_pexpect
277 check_for_nose, check_for_pexpect
278 )
278 )
279 print_line()
279 print_line()
280 print_raw("BUILDING IPYTHON")
280 print_raw("BUILDING IPYTHON")
281 print_status('python', sys.version)
281 print_status('python', sys.version)
282 print_status('platform', sys.platform)
282 print_status('platform', sys.platform)
283 if sys.platform == 'win32':
283 if sys.platform == 'win32':
284 print_status('Windows version', sys.getwindowsversion())
284 print_status('Windows version', sys.getwindowsversion())
285
285
286 print_raw("")
286 print_raw("")
287 print_raw("OPTIONAL DEPENDENCIES")
287 print_raw("OPTIONAL DEPENDENCIES")
288
288
289 check_for_zopeinterface()
289 check_for_zopeinterface()
290 check_for_twisted()
290 check_for_twisted()
291 check_for_foolscap()
291 check_for_foolscap()
292 check_for_pyopenssl()
292 check_for_pyopenssl()
293 check_for_sphinx()
293 check_for_sphinx()
294 check_for_pygments()
294 check_for_pygments()
295 check_for_nose()
295 check_for_nose()
296 check_for_pexpect()
296 check_for_pexpect()
@@ -1,23 +1,23 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 """ Change the revision number in Release.py """
2 """ Change the revision number in Release.py """
3
3
4 import os
4 import os
5 import re,pprint
5 import re,pprint
6
6
7 def verinfo():
7 def verinfo():
8
8
9 out = os.popen('bzr version-info')
9 out = os.popen('bzr version-info')
10 pairs = (l.split(':',1) for l in out)
10 pairs = (l.split(':',1) for l in out)
11 d = dict(((k,v.strip()) for (k,v) in pairs))
11 d = dict(((k,v.strip()) for (k,v) in pairs))
12 return d
12 return d
13
13
14 ver = verinfo()
14 ver = verinfo()
15
15
16 pprint.pprint(ver)
16 pprint.pprint(ver)
17
17
18 rfile = open('../IPython/Release.py','rb').read()
18 rfile = open('../IPython/core/release.py','rb').read()
19 newcont = re.sub(r'revision\s*=.*', "revision = '%s'" % ver['revno'], rfile)
19 newcont = re.sub(r'revision\s*=.*', "revision = '%s'" % ver['revno'], rfile)
20
20
21 newcont = re.sub(r'^branch\s*=[^=].*', "branch = '%s'" % ver['branch-nick'], newcont )
21 newcont = re.sub(r'^branch\s*=[^=].*', "branch = '%s'" % ver['branch-nick'], newcont )
22
22
23 open('../IPython/Release.py','wb').write(newcont)
23 open('../IPython/core/release.py','wb').write(newcont)
General Comments 0
You need to be logged in to leave comments. Login now