##// END OF EJS Templates
docs: remove build crap from sdist with manifest.in
Ville M. Vainio -
Show More
@@ -1,30 +1,36 b''
1 include README_Windows.txt
1 include README_Windows.txt
2 include win32_manual_post_install.py
2 include win32_manual_post_install.py
3 include ipython.py
3 include ipython.py
4
4
5 graft scripts
5 graft scripts
6
6
7 graft setupext
7 graft setupext
8
8
9 graft IPython/UserConfig
9 graft IPython/UserConfig
10
10
11 graft doc
11 graft doc
12 exclude doc/*.1
12 exclude doc/*.1
13 exclude doc/manual_base*
13 exclude doc/manual_base*
14 exclude doc/ChangeLog.*
14 exclude doc/ChangeLog.*
15 exclude doc/\#*
15 exclude doc/\#*
16 exclude doc/update_magic.sh
16 exclude doc/update_magic.sh
17 exclude doc/update_version.sh
17 exclude doc/update_version.sh
18 exclude doc/manual_base*
18 exclude doc/manual_base*
19 exclude doc/manual/WARNINGS
19 exclude doc/manual/WARNINGS
20 exclude doc/manual/*.aux
20 exclude doc/manual/*.aux
21 exclude doc/manual/*.log
21 exclude doc/manual/*.log
22 exclude doc/manual/*.out
22 exclude doc/manual/*.out
23 exclude doc/manual/*.pl
23 exclude doc/manual/*.pl
24 exclude doc/manual/*.tex
24 exclude doc/manual/*.tex
25 exclude doc/build/doctrees/*
26 exclude doc/build/latex/*
27 exclude doc/build/html/_sources/*
28
29
30
25
31
26 global-exclude *~
32 global-exclude *~
27 global-exclude *.flc
33 global-exclude *.flc
28 global-exclude *.pyc
34 global-exclude *.pyc
29 global-exclude .dircopy.log
35 global-exclude .dircopy.log
30 global-exclude .svn
36 global-exclude .svn
@@ -1,170 +1,165 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
2 # -*- coding: utf-8 -*-
3 """Setup script for IPython.
3 """Setup script for IPython.
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>
11 #
11 #
12 # Distributed under the terms of the BSD License. The full license is in
12 # Distributed under the terms of the BSD License. The full license is in
13 # the file COPYING, distributed as part of this software.
13 # the file COPYING, distributed as part of this software.
14 #*****************************************************************************
14 #*****************************************************************************
15
15
16 # Stdlib imports
16 # Stdlib imports
17 import os
17 import os
18 import sys
18 import sys
19
19
20 from glob import glob
20 from glob import glob
21 from setupext import install_data_ext
21 from setupext import install_data_ext
22
22
23 # A few handy globals
23 # A few handy globals
24 isfile = os.path.isfile
24 isfile = os.path.isfile
25 pjoin = os.path.join
25 pjoin = os.path.join
26
26
27 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
27 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
28 # update it when the contents of directories change.
28 # update it when the contents of directories change.
29 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
29 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
30
30
31 if os.name == 'posix':
31 if os.name == 'posix':
32 os_name = 'posix'
32 os_name = 'posix'
33 elif os.name in ['nt','dos']:
33 elif os.name in ['nt','dos']:
34 os_name = 'windows'
34 os_name = 'windows'
35 else:
35 else:
36 print 'Unsupported operating system:',os.name
36 print 'Unsupported operating system:',os.name
37 sys.exit(1)
37 sys.exit(1)
38
38
39 # Under Windows, 'sdist' is not supported, since it requires lyxport (and
39 # Under Windows, 'sdist' is not supported, since it requires lyxport (and
40 # hence lyx,perl,latex,pdflatex,latex2html,sh,...)
40 # hence lyx,perl,latex,pdflatex,latex2html,sh,...)
41 if os_name == 'windows' and 'sdist' in sys.argv:
41 if os_name == 'windows' and 'sdist' in sys.argv:
42 print 'The sdist command is not available under Windows. Exiting.'
42 print 'The sdist command is not available under Windows. Exiting.'
43 sys.exit(1)
43 sys.exit(1)
44
44
45 from distutils.core import setup
45 from distutils.core import setup
46
46
47 # update the manuals when building a source dist
47 # update the manuals when building a source dist
48 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
48 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
49 import textwrap
49 import textwrap
50 from IPython.genutils import target_update
50 from IPython.genutils import target_update
51 # list of things to be updated. Each entry is a triplet of args for
51 # list of things to be updated. Each entry is a triplet of args for
52 # target_update()
52 # target_update()
53
53
54 def oscmd(s):
54 def oscmd(s):
55 cwd = os.getcwd()
55 print ">", s
56 for l in textwrap.dedent(s).splitlines():
56 os.system(s)
57 print ">", l.strip()
58 os.system(l.strip())
59
57
60 os.chdir(cwd)
58 oscmd("cd doc && python do_sphinx.py")
61
62 oscmd("""\
63 cd doc && python do_sphinx.py""")
64
59
65 oscmd("cd doc && gzip -9c ipython.1 > ipython.1.gz")
60 oscmd("cd doc && gzip -9c ipython.1 > ipython.1.gz")
66 oscmd("cd doc && gzip -9c pycolor.1 > pycolor.1.gz")
61 oscmd("cd doc && gzip -9c pycolor.1 > pycolor.1.gz")
67
62
68 # Release.py contains version, authors, license, url, keywords, etc.
63 # Release.py contains version, authors, license, url, keywords, etc.
69 execfile(pjoin('IPython','Release.py'))
64 execfile(pjoin('IPython','Release.py'))
70
65
71 # A little utility we'll need below, since glob() does NOT allow you to do
66 # A little utility we'll need below, since glob() does NOT allow you to do
72 # exclusion on multiple endings!
67 # exclusion on multiple endings!
73 def file_doesnt_endwith(test,endings):
68 def file_doesnt_endwith(test,endings):
74 """Return true if test is a file and its name does NOT end with any
69 """Return true if test is a file and its name does NOT end with any
75 of the strings listed in endings."""
70 of the strings listed in endings."""
76 if not isfile(test):
71 if not isfile(test):
77 return False
72 return False
78 for e in endings:
73 for e in endings:
79 if test.endswith(e):
74 if test.endswith(e):
80 return False
75 return False
81 return True
76 return True
82
77
83 # I can't find how to make distutils create a nested dir. structure, so
78 # I can't find how to make distutils create a nested dir. structure, so
84 # in the meantime do it manually. Butt ugly.
79 # in the meantime do it manually. Butt ugly.
85 # Note that http://www.redbrick.dcu.ie/~noel/distutils.html, ex. 2/3, contain
80 # Note that http://www.redbrick.dcu.ie/~noel/distutils.html, ex. 2/3, contain
86 # information on how to do this more cleanly once python 2.4 can be assumed.
81 # information on how to do this more cleanly once python 2.4 can be assumed.
87 # Thanks to Noel for the tip.
82 # Thanks to Noel for the tip.
88 docdirbase = 'share/doc/ipython'
83 docdirbase = 'share/doc/ipython'
89 manpagebase = 'share/man/man1'
84 manpagebase = 'share/man/man1'
90
85
91 # We only need to exclude from this things NOT already excluded in the
86 # We only need to exclude from this things NOT already excluded in the
92 # MANIFEST.in file.
87 # MANIFEST.in file.
93 exclude = ('.sh','.1.gz')
88 exclude = ('.sh','.1.gz')
94 docfiles = filter(lambda f:file_doesnt_endwith(f,exclude),glob('doc/*'))
89 docfiles = filter(lambda f:file_doesnt_endwith(f,exclude),glob('doc/*'))
95
90
96 examfiles = filter(isfile, glob('doc/examples/*.py'))
91 examfiles = filter(isfile, glob('doc/examples/*.py'))
97 manfiles = filter(isfile, glob('doc/build/html/*'))
92 manfiles = filter(isfile, glob('doc/build/html/*'))
98 manstatic = filter(isfile, glob('doc/build/html/_static/*'))
93 manstatic = filter(isfile, glob('doc/build/html/_static/*'))
99
94
100 # filter(isfile, glob('doc/manual/*.css')) + \
95 # filter(isfile, glob('doc/manual/*.css')) + \
101 # filter(isfile, glob('doc/manual/*.png'))
96 # filter(isfile, glob('doc/manual/*.png'))
102
97
103 manpages = filter(isfile, glob('doc/*.1.gz'))
98 manpages = filter(isfile, glob('doc/*.1.gz'))
104 cfgfiles = filter(isfile, glob('IPython/UserConfig/*'))
99 cfgfiles = filter(isfile, glob('IPython/UserConfig/*'))
105 scriptfiles = filter(isfile, ['scripts/ipython','scripts/pycolor',
100 scriptfiles = filter(isfile, ['scripts/ipython','scripts/pycolor',
106 'scripts/irunner'])
101 'scripts/irunner'])
107 igridhelpfiles = filter(isfile, glob('IPython/Extensions/igrid_help.*'))
102 igridhelpfiles = filter(isfile, glob('IPython/Extensions/igrid_help.*'))
108
103
109 # Script to be run by the windows binary installer after the default setup
104 # Script to be run by the windows binary installer after the default setup
110 # routine, to add shortcuts and similar windows-only things. Windows
105 # routine, to add shortcuts and similar windows-only things. Windows
111 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
106 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
112 # doesn't find them.
107 # doesn't find them.
113 if 'bdist_wininst' in sys.argv:
108 if 'bdist_wininst' in sys.argv:
114 if len(sys.argv) > 2 and ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
109 if len(sys.argv) > 2 and ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
115 print >> sys.stderr,"ERROR: bdist_wininst must be run alone. Exiting."
110 print >> sys.stderr,"ERROR: bdist_wininst must be run alone. Exiting."
116 sys.exit(1)
111 sys.exit(1)
117 scriptfiles.append('scripts/ipython_win_post_install.py')
112 scriptfiles.append('scripts/ipython_win_post_install.py')
118
113
119 datafiles = [('data', docdirbase, docfiles),
114 datafiles = [('data', docdirbase, docfiles),
120 ('data', pjoin(docdirbase, 'examples'),examfiles),
115 ('data', pjoin(docdirbase, 'examples'),examfiles),
121 ('data', pjoin(docdirbase, 'manual'),manfiles),
116 ('data', pjoin(docdirbase, 'manual'),manfiles),
122 ('data', pjoin(docdirbase, 'manual/_static'),manstatic),
117 ('data', pjoin(docdirbase, 'manual/_static'),manstatic),
123 ('data', manpagebase, manpages),
118 ('data', manpagebase, manpages),
124 ('data',pjoin(docdirbase, 'extensions'),igridhelpfiles),
119 ('data',pjoin(docdirbase, 'extensions'),igridhelpfiles),
125 ]
120 ]
126
121
127 if 'setuptools' in sys.modules:
122 if 'setuptools' in sys.modules:
128 # setuptools config for egg building
123 # setuptools config for egg building
129 egg_extra_kwds = {
124 egg_extra_kwds = {
130 'entry_points': {
125 'entry_points': {
131 'console_scripts': [
126 'console_scripts': [
132 'ipython = IPython.ipapi:launch_new_instance',
127 'ipython = IPython.ipapi:launch_new_instance',
133 'pycolor = IPython.PyColorize:main'
128 'pycolor = IPython.PyColorize:main'
134 ]}
129 ]}
135 }
130 }
136 scriptfiles = []
131 scriptfiles = []
137 # eggs will lack docs, eaxmples
132 # eggs will lack docs, eaxmples
138 datafiles = []
133 datafiles = []
139
134
140 #datafiles = [('lib', 'IPython/UserConfig', cfgfiles)]
135 #datafiles = [('lib', 'IPython/UserConfig', cfgfiles)]
141 else:
136 else:
142 egg_extra_kwds = {}
137 egg_extra_kwds = {}
143 # package_data of setuptools was introduced to distutils in 2.4
138 # package_data of setuptools was introduced to distutils in 2.4
144 if sys.version_info < (2,4):
139 if sys.version_info < (2,4):
145 datafiles.append(('lib', 'IPython/UserConfig', cfgfiles))
140 datafiles.append(('lib', 'IPython/UserConfig', cfgfiles))
146
141
147
142
148
143
149
144
150 # Call the setup() routine which does most of the work
145 # Call the setup() routine which does most of the work
151 setup(name = name,
146 setup(name = name,
152 version = version,
147 version = version,
153 description = description,
148 description = description,
154 long_description = long_description,
149 long_description = long_description,
155 author = authors['Fernando'][0],
150 author = authors['Fernando'][0],
156 author_email = authors['Fernando'][1],
151 author_email = authors['Fernando'][1],
157 url = url,
152 url = url,
158 download_url = download_url,
153 download_url = download_url,
159 license = license,
154 license = license,
160 platforms = platforms,
155 platforms = platforms,
161 keywords = keywords,
156 keywords = keywords,
162 packages = ['IPython', 'IPython.Extensions', 'IPython.external', 'IPython.gui', 'IPython.gui.wx', 'IPython.UserConfig'],
157 packages = ['IPython', 'IPython.Extensions', 'IPython.external', 'IPython.gui', 'IPython.gui.wx', 'IPython.UserConfig'],
163 scripts = scriptfiles,
158 scripts = scriptfiles,
164 package_data = {'IPython.UserConfig' : ['*'] },
159 package_data = {'IPython.UserConfig' : ['*'] },
165
160
166 cmdclass = {'install_data': install_data_ext},
161 cmdclass = {'install_data': install_data_ext},
167 data_files = datafiles,
162 data_files = datafiles,
168 # extra params needed for eggs
163 # extra params needed for eggs
169 **egg_extra_kwds
164 **egg_extra_kwds
170 )
165 )
General Comments 0
You need to be logged in to leave comments. Login now