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