##// END OF EJS Templates
Fixes to build/setup machinery....
Fernando Perez -
Show More
@@ -1,99 +1,99 b''
1 1 # -*- coding: utf-8 -*-
2 2 """Release data for the IPython project.
3 3
4 4 $Id: Release.py 3002 2008-02-01 07:17:00Z fperez $"""
5 5
6 6 #*****************************************************************************
7 7 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
8 8 #
9 9 # Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and Nathaniel Gray
10 10 # <n8gray@caltech.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 # Name of the package for release purposes. This is the name which labels
17 17 # the tarballs and RPMs made by distutils, so it's best to lowercase it.
18 18 name = 'ipython'
19 19
20 20 # For versions with substrings (like 0.6.16.svn), use an extra . to separate
21 21 # the new substring. We have to avoid using either dashes or underscores,
22 22 # because bdist_rpm does not accept dashes (an RPM) convention, and
23 23 # bdist_deb does not accept underscores (a Debian convention).
24 24
25 development = True # change this to False to do a release
26 version_base = '0.9.0'
25 development = False # change this to False to do a release
26 version_base = '0.9.beta'
27 27 branch = 'ipython'
28 28 revision = '1016'
29 29
30 30 if development:
31 31 if branch == 'ipython':
32 32 version = '%s.bzr.r%s' % (version_base, revision)
33 33 else:
34 34 version = '%s.bzr.r%s.%s' % (version_base, revision, branch)
35 35 else:
36 36 version = version_base
37 37
38 38
39 39 description = "Tools for interactive development in Python."
40 40
41 41 long_description = \
42 42 """
43 43 IPython provides a replacement for the interactive Python interpreter with
44 44 extra functionality.
45 45
46 46 Main features:
47 47
48 48 * Comprehensive object introspection.
49 49
50 50 * Input history, persistent across sessions.
51 51
52 52 * Caching of output results during a session with automatically generated
53 53 references.
54 54
55 55 * Readline based name completion.
56 56
57 57 * Extensible system of 'magic' commands for controlling the environment and
58 58 performing many tasks related either to IPython or the operating system.
59 59
60 60 * Configuration system with easy switching between different setups (simpler
61 61 than changing $PYTHONSTARTUP environment variables every time).
62 62
63 63 * Session logging and reloading.
64 64
65 65 * Extensible syntax processing for special purpose situations.
66 66
67 67 * Access to the system shell with user-extensible alias system.
68 68
69 69 * Easily embeddable in other Python programs.
70 70
71 71 * Integrated access to the pdb debugger and the Python profiler.
72 72
73 73 The latest development version is always available at the IPython subversion
74 74 repository_.
75 75
76 76 .. _repository: http://ipython.scipy.org/svn/ipython/ipython/trunk#egg=ipython-dev
77 77 """
78 78
79 79 license = 'BSD'
80 80
81 81 authors = {'Fernando' : ('Fernando Perez','fperez@colorado.edu'),
82 82 'Janko' : ('Janko Hauser','jhauser@zscout.de'),
83 83 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu'),
84 84 'Ville' : ('Ville Vainio','vivainio@gmail.com'),
85 85 'Brian' : ('Brian E Granger', 'ellisonbg@gmail.com'),
86 86 'Min' : ('Min Ragan-Kelley', 'benjaminrk@gmail.com')
87 87 }
88 88
89 89 author = 'The IPython Development Team'
90 90
91 91 author_email = 'ipython-dev@scipy.org'
92 92
93 93 url = 'http://ipython.scipy.org'
94 94
95 95 download_url = 'http://ipython.scipy.org/dist'
96 96
97 97 platforms = ['Linux','Mac OSX','Windows XP/2000/NT','Windows 95/98/ME']
98 98
99 99 keywords = ['Interactive','Interpreter','Shell','Parallel','Distributed']
@@ -1,31 +1,32 b''
1 1 include README_Windows.txt
2 2 include win32_manual_post_install.py
3 3 include ipython.py
4 4 include setupbase.py
5 5
6 6 graft scripts
7 7
8 8 graft setupext
9 9
10 10 graft IPython/UserConfig
11 11
12 12 graft IPython/kernel
13 13 graft IPython/config
14 14 graft IPython/testing
15 15 graft IPython/tools
16 16
17 recursive-include IPython/Extensions igrid_help*
18
17 19 graft docs
18 20 exclude docs/\#*
19 21 exclude docs/man/*.1
20 22
21 # There seems to be no way of excluding whole subdirectories, other than
22 # manually excluding all their subdirs. distutils really is horrible...
23 exclude docs/attic/*
24 exclude docs/build/*
23 # docs subdirs we want to skip
24 prune docs/attic
25 prune docs/build
25 26
26 27 global-exclude *~
27 28 global-exclude *.flc
28 29 global-exclude *.pyc
29 30 global-exclude .dircopy.log
30 31 global-exclude .svn
31 32 global-exclude .bzr
@@ -1,70 +1,87 b''
1 1 # Makefile for Sphinx documentation
2 2 #
3 3
4 4 # You can set these variables from the command line.
5 5 SPHINXOPTS =
6 6 SPHINXBUILD = sphinx-build
7 7 PAPER =
8 8
9 9 # Internal variables.
10 10 PAPEROPT_a4 = -D latex_paper_size=a4
11 11 PAPEROPT_letter = -D latex_paper_size=letter
12 12 ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
13 13
14 14 .PHONY: help clean html web pickle htmlhelp latex changes linkcheck
15 15
16 16 help:
17 17 @echo "Please use \`make <target>' where <target> is one of"
18 18 @echo " html to make standalone HTML files"
19 19 @echo " pickle to make pickle files (usable by e.g. sphinx-web)"
20 20 @echo " htmlhelp to make HTML files and a HTML help project"
21 21 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
22 22 @echo " changes to make an overview over all changed/added/deprecated items"
23 23 @echo " linkcheck to check all external links for integrity"
24 @echo
25 @echo "Compound utility targets:"
26 @echo "pdf latex and then runs the PDF generation"
27 @echo "all html and pdf"
28 @echo "dist all, and then puts the results in dist/"
24 29
25 30 clean:
26 31 -rm -rf build/*
27 32
33 pdf: latex
34 cd build/latex && make all-pdf
35
36 all: html pdf
37
38 dist: all
39 mkdir -p dist
40 -rm -rf dist/*
41 ln build/latex/IPython.pdf dist/
42 cp -al build/html dist/
43 @echo "Build finished. Final docs are in dist/"
44
28 45 html:
29 46 mkdir -p build/html build/doctrees
30 47 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html
31 48 @echo
32 49 @echo "Build finished. The HTML pages are in build/html."
33 50
34 51 pickle:
35 52 mkdir -p build/pickle build/doctrees
36 53 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle
37 54 @echo
38 55 @echo "Build finished; now you can process the pickle files or run"
39 56 @echo " sphinx-web build/pickle"
40 57 @echo "to start the sphinx-web server."
41 58
42 59 web: pickle
43 60
44 61 htmlhelp:
45 62 mkdir -p build/htmlhelp build/doctrees
46 63 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp
47 64 @echo
48 65 @echo "Build finished; now you can run HTML Help Workshop with the" \
49 66 ".hhp project file in build/htmlhelp."
50 67
51 68 latex:
52 69 mkdir -p build/latex build/doctrees
53 70 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex
54 71 @echo
55 72 @echo "Build finished; the LaTeX files are in build/latex."
56 73 @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
57 74 "run these through (pdf)latex."
58 75
59 76 changes:
60 77 mkdir -p build/changes build/doctrees
61 78 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes
62 79 @echo
63 80 @echo "The overview file is in build/changes."
64 81
65 82 linkcheck:
66 83 mkdir -p build/linkcheck build/doctrees
67 84 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck
68 85 @echo
69 86 @echo "Link check complete; look for any errors in the above output " \
70 87 "or in build/linkcheck/output.txt."
@@ -1,161 +1,165 b''
1 1 # -*- coding: utf-8 -*-
2 2 #
3 3 # IPython documentation build configuration file, created by
4 4 # sphinx-quickstart on Thu May 8 16:45:02 2008.
5 5 #
6 6 # This file is execfile()d with the current directory set to its containing dir.
7 7 #
8 8 # The contents of this file are pickled, so don't put values in the namespace
9 9 # that aren't pickleable (module imports are okay, they're removed automatically).
10 10 #
11 11 # All configuration values have a default value; values that are commented out
12 12 # serve to show the default value.
13 13
14 14 import sys, os
15 15
16 16 # If your extensions are in another directory, add it here. If the directory
17 17 # is relative to the documentation root, use os.path.abspath to make it
18 18 # absolute, like shown here.
19 19 #sys.path.append(os.path.abspath('some/directory'))
20 20
21 21 # General configuration
22 22 # ---------------------
23 23
24 24 # Add any Sphinx extension module names here, as strings. They can be extensions
25 25 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
26 26 #extensions = []
27 27
28 28 # Add any paths that contain templates here, relative to this directory.
29 29 templates_path = ['_templates']
30 30
31 31 # The suffix of source filenames.
32 32 source_suffix = '.txt'
33 33
34 34 # The master toctree document.
35 35 master_doc = 'index'
36 36
37 37 # General substitutions.
38 38 project = 'IPython'
39 39 copyright = '2008, The IPython Development Team'
40 40
41 41 # The default replacements for |version| and |release|, also used in various
42 42 # other places throughout the built documents.
43 43 #
44 44 # The short X.Y version.
45 45 version = '0.9'
46 46 # The full version, including alpha/beta/rc tags.
47 release = '0.9'
47 release = '0.9.beta1'
48 48
49 49 # There are two options for replacing |today|: either, you set today to some
50 50 # non-false value, then it is used:
51 51 #today = ''
52 52 # Else, today_fmt is used as the format for a strftime call.
53 53 today_fmt = '%B %d, %Y'
54 54
55 55 # List of documents that shouldn't be included in the build.
56 56 #unused_docs = []
57 57
58 58 # List of directories, relative to source directories, that shouldn't be searched
59 59 # for source files.
60 60 #exclude_dirs = []
61 61
62 62 # If true, '()' will be appended to :func: etc. cross-reference text.
63 63 #add_function_parentheses = True
64 64
65 65 # If true, the current module name will be prepended to all description
66 66 # unit titles (such as .. function::).
67 67 #add_module_names = True
68 68
69 69 # If true, sectionauthor and moduleauthor directives will be shown in the
70 70 # output. They are ignored by default.
71 71 #show_authors = False
72 72
73 73 # The name of the Pygments (syntax highlighting) style to use.
74 74 pygments_style = 'sphinx'
75 75
76 76
77 77 # Options for HTML output
78 78 # -----------------------
79 79
80 80 # The style sheet to use for HTML and HTML Help pages. A file of that name
81 81 # must exist either in Sphinx' static/ path, or in one of the custom paths
82 82 # given in html_static_path.
83 83 html_style = 'default.css'
84 84
85 85 # The name for this set of Sphinx documents. If None, it defaults to
86 86 # "<project> v<release> documentation".
87 87 #html_title = None
88 88
89 89 # The name of an image file (within the static path) to place at the top of
90 90 # the sidebar.
91 91 #html_logo = None
92 92
93 93 # Add any paths that contain custom static files (such as style sheets) here,
94 94 # relative to this directory. They are copied after the builtin static files,
95 95 # so a file named "default.css" will overwrite the builtin "default.css".
96 96 html_static_path = ['_static']
97 97
98 98 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
99 99 # using the given strftime format.
100 100 html_last_updated_fmt = '%b %d, %Y'
101 101
102 102 # If true, SmartyPants will be used to convert quotes and dashes to
103 103 # typographically correct entities.
104 104 #html_use_smartypants = True
105 105
106 106 # Custom sidebar templates, maps document names to template names.
107 107 #html_sidebars = {}
108 108
109 109 # Additional templates that should be rendered to pages, maps page names to
110 110 # template names.
111 111 #html_additional_pages = {}
112 112
113 113 # If false, no module index is generated.
114 114 #html_use_modindex = True
115 115
116 116 # If true, the reST sources are included in the HTML build as _sources/<name>.
117 117 #html_copy_source = True
118 118
119 119 # If true, an OpenSearch description file will be output, and all pages will
120 120 # contain a <link> tag referring to it. The value of this option must be the
121 121 # base URL from which the finished HTML is served.
122 122 #html_use_opensearch = ''
123 123
124 124 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
125 125 #html_file_suffix = ''
126 126
127 127 # Output file base name for HTML help builder.
128 128 htmlhelp_basename = 'IPythondoc'
129 129
130 130
131 131 # Options for LaTeX output
132 132 # ------------------------
133 133
134 134 # The paper size ('letter' or 'a4').
135 135 latex_paper_size = 'letter'
136 136
137 137 # The font size ('10pt', '11pt' or '12pt').
138 latex_font_size = '10pt'
138 latex_font_size = '11pt'
139 139
140 140 # Grouping the document tree into LaTeX files. List of tuples
141 141 # (source start file, target name, title, author, document class [howto/manual]).
142 latex_documents = [
143 ('index', 'IPython.tex', 'IPython Documentation', 'The IPython Development Team', 'manual'),
142
143 latex_documents = [ ('index', 'IPython.tex', 'IPython Documentation',
144 ur"""Brian Granger and Fernando PΓ©rez\\
145 With contributions from:\\
146 Benjamin Ragan-Kelley and Ville Vainio.""",
147 'manual'),
144 148 ]
145 149
146 150 # The name of an image file (relative to this directory) to place at the top of
147 151 # the title page.
148 152 #latex_logo = None
149 153
150 154 # For "manual" documents, if this is true, then toplevel headings are parts,
151 155 # not chapters.
152 156 #latex_use_parts = False
153 157
154 158 # Additional stuff for the LaTeX preamble.
155 159 #latex_preamble = ''
156 160
157 161 # Documents to append as an appendix to all manuals.
158 162 #latex_appendices = []
159 163
160 164 # If false, no module index is generated.
161 165 #latex_use_modindex = True
@@ -1,175 +1,179 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) 2008 The IPython Development Team
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 #-------------------------------------------------------------------------------
17 17 # Imports
18 18 #-------------------------------------------------------------------------------
19 19
20 20 # Stdlib imports
21 21 import os
22 22 import sys
23 23
24 24 from glob import glob
25 25
26 26 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
27 27 # update it when the contents of directories change.
28 28 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
29 29
30 30 from distutils.core import setup
31 31
32 32 # Local imports
33 33 from IPython.genutils import target_update
34 34
35 35 from setupbase import (
36 36 setup_args,
37 37 find_packages,
38 38 find_package_data,
39 39 find_scripts,
40 40 find_data_files,
41 41 check_for_dependencies
42 42 )
43 43
44 44 isfile = os.path.isfile
45 45
46 46 #-------------------------------------------------------------------------------
47 47 # Handle OS specific things
48 48 #-------------------------------------------------------------------------------
49 49
50 50 if os.name == 'posix':
51 51 os_name = 'posix'
52 52 elif os.name in ['nt','dos']:
53 53 os_name = 'windows'
54 54 else:
55 55 print 'Unsupported operating system:',os.name
56 56 sys.exit(1)
57 57
58 58 # Under Windows, 'sdist' has not been supported. Now that the docs build with
59 59 # Sphinx it might work, but let's not turn it on until someone confirms that it
60 60 # actually works.
61 61 if os_name == 'windows' and 'sdist' in sys.argv:
62 62 print 'The sdist command is not available under Windows. Exiting.'
63 63 sys.exit(1)
64 64
65 65 #-------------------------------------------------------------------------------
66 66 # Things related to the IPython documentation
67 67 #-------------------------------------------------------------------------------
68 68
69 69 # update the manuals when building a source dist
70 70 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
71 71 import textwrap
72 72
73 73 # List of things to be updated. Each entry is a triplet of args for
74 74 # target_update()
75 75 to_update = [
76 76 # FIXME - Disabled for now: we need to redo an automatic way
77 77 # of generating the magic info inside the rst.
78 78 #('docs/magic.tex',
79 79 #['IPython/Magic.py'],
80 80 #"cd doc && ./update_magic.sh" ),
81 81
82 82 ('docs/man/ipython.1.gz',
83 83 ['docs/man/ipython.1'],
84 84 "cd docs/man && gzip -9c ipython.1 > ipython.1.gz"),
85 85
86 86 ('docs/man/pycolor.1.gz',
87 87 ['docs/man/pycolor.1'],
88 88 "cd docs/man && gzip -9c pycolor.1 > pycolor.1.gz"),
89 89 ]
90 90
91 91 # Only build the docs is sphinx is present
92 92 try:
93 93 import sphinx
94 94 except ImportError:
95 95 pass
96 96 else:
97 97 pass
98 98 # BEG: This is disabled as I am not sure what to depend on.
99 99 # I actually don't think we should be automatically building
100 100 # the docs for people.
101 101 # The do_sphinx scripts builds html and pdf, so just one
102 102 # target is enough to cover all manual generation
103 103 # to_update.append(
104 104 # ('docs/manual/ipython.pdf',
105 105 # ['IPython/Release.py','docs/source/ipython.rst'],
106 106 # "cd docs && python do_sphinx.py")
107 107 # )
108
108 109 [ target_update(*t) for t in to_update ]
109 110
111 # Build the docs
112 os.system('cd docs && make dist')
113
110 114 #---------------------------------------------------------------------------
111 115 # Find all the packages, package data, scripts and data_files
112 116 #---------------------------------------------------------------------------
113 117
114 118 packages = find_packages()
115 119 package_data = find_package_data()
116 120 scripts = find_scripts()
117 121 data_files = find_data_files()
118 122
119 123 #---------------------------------------------------------------------------
120 124 # Handle dependencies and setuptools specific things
121 125 #---------------------------------------------------------------------------
122 126
123 127 # This dict is used for passing extra arguments that are setuptools
124 128 # specific to setup
125 129 setuptools_extra_args = {}
126 130
127 131 if 'setuptools' in sys.modules:
128 132 setuptools_extra_args['zip_safe'] = False
129 133 setuptools_extra_args['entry_points'] = {
130 134 'console_scripts': [
131 135 'ipython = IPython.ipapi:launch_new_instance',
132 136 'pycolor = IPython.PyColorize:main',
133 137 'ipcontroller = IPython.kernel.scripts.ipcontroller:main',
134 138 'ipengine = IPython.kernel.scripts.ipengine:main',
135 139 'ipcluster = IPython.kernel.scripts.ipcluster:main',
136 140 'ipythonx = IPython.frontend.wx.ipythonx:main'
137 141 ]
138 142 }
139 143 setup_args["extras_require"] = dict(
140 144 kernel = [
141 145 "zope.interface>=3.4.1",
142 146 "Twisted>=8.0.1",
143 147 "foolscap>=0.2.6"
144 148 ],
145 149 doc=['Sphinx>=0.3','pygments'],
146 150 test='nose>=0.10.1',
147 151 security=["pyOpenSSL>=0.6"]
148 152 )
149 153 # Allow setuptools to handle the scripts
150 154 scripts = []
151 155 # eggs will lack docs, examples
152 156 data_files = []
153 157 else:
154 158 # package_data of setuptools was introduced to distutils in 2.4
155 159 cfgfiles = filter(isfile, glob('IPython/UserConfig/*'))
156 160 if sys.version_info < (2,4):
157 161 data_files.append(('lib', 'IPython/UserConfig', cfgfiles))
158 162 # If we are running without setuptools, call this function which will
159 163 # check for dependencies an inform the user what is needed. This is
160 164 # just to make life easy for users.
161 165 check_for_dependencies()
162 166
163 167
164 168 #---------------------------------------------------------------------------
165 169 # Do the actual setup now
166 170 #---------------------------------------------------------------------------
167 171
168 172 setup_args['packages'] = packages
169 173 setup_args['package_data'] = package_data
170 174 setup_args['scripts'] = scripts
171 175 setup_args['data_files'] = data_files
172 176 setup_args.update(setuptools_extra_args)
173 177
174 178 if __name__ == '__main__':
175 179 setup(**setup_args)
@@ -1,244 +1,275 b''
1 1 # encoding: utf-8
2 2
3 3 """
4 4 This module defines the things that are used in setup.py for building IPython
5 5
6 6 This includes:
7 7
8 8 * The basic arguments to setup
9 9 * Functions for finding things like packages, package data, etc.
10 10 * A function for checking dependencies.
11 11 """
12 12
13 13 __docformat__ = "restructuredtext en"
14 14
15 15 #-------------------------------------------------------------------------------
16 16 # Copyright (C) 2008 The IPython Development Team
17 17 #
18 18 # Distributed under the terms of the BSD License. The full license is in
19 19 # the file COPYING, distributed as part of this software.
20 20 #-------------------------------------------------------------------------------
21 21
22 22 #-------------------------------------------------------------------------------
23 23 # Imports
24 24 #-------------------------------------------------------------------------------
25 25
26 26 import os, sys
27 27
28 28 from glob import glob
29 29
30 30 from setupext import install_data_ext
31 31
32 32 #-------------------------------------------------------------------------------
33 33 # Useful globals and utility functions
34 34 #-------------------------------------------------------------------------------
35 35
36 36 # A few handy globals
37 37 isfile = os.path.isfile
38 38 pjoin = os.path.join
39 39
40 40 def oscmd(s):
41 41 print ">", s
42 42 os.system(s)
43 43
44 44 # A little utility we'll need below, since glob() does NOT allow you to do
45 45 # exclusion on multiple endings!
46 46 def file_doesnt_endwith(test,endings):
47 47 """Return true if test is a file and its name does NOT end with any
48 48 of the strings listed in endings."""
49 49 if not isfile(test):
50 50 return False
51 51 for e in endings:
52 52 if test.endswith(e):
53 53 return False
54 54 return True
55 55
56 56 #---------------------------------------------------------------------------
57 57 # Basic project information
58 58 #---------------------------------------------------------------------------
59 59
60 60 # Release.py contains version, authors, license, url, keywords, etc.
61 61 execfile(pjoin('IPython','Release.py'))
62 62
63 63 # Create a dict with the basic information
64 64 # This dict is eventually passed to setup after additional keys are added.
65 65 setup_args = dict(
66 66 name = name,
67 67 version = version,
68 68 description = description,
69 69 long_description = long_description,
70 70 author = author,
71 71 author_email = author_email,
72 72 url = url,
73 73 download_url = download_url,
74 74 license = license,
75 75 platforms = platforms,
76 76 keywords = keywords,
77 77 cmdclass = {'install_data': install_data_ext},
78 78 )
79 79
80 80
81 81 #---------------------------------------------------------------------------
82 82 # Find packages
83 83 #---------------------------------------------------------------------------
84 84
85 def add_package(packages, pname, config=False, tests=False, scripts=False, others=None):
85 def add_package(packages,pname,config=False,tests=False,scripts=False,
86 others=None):
86 87 """
87 88 Add a package to the list of packages, including certain subpackages.
88 89 """
89 90 packages.append('.'.join(['IPython',pname]))
90 91 if config:
91 92 packages.append('.'.join(['IPython',pname,'config']))
92 93 if tests:
93 94 packages.append('.'.join(['IPython',pname,'tests']))
94 95 if scripts:
95 96 packages.append('.'.join(['IPython',pname,'scripts']))
96 97 if others is not None:
97 98 for o in others:
98 99 packages.append('.'.join(['IPython',pname,o]))
99 100
100 101 def find_packages():
101 102 """
102 103 Find all of IPython's packages.
103 104 """
104 105 packages = ['IPython']
105 106 add_package(packages, 'config', tests=True)
106 107 add_package(packages , 'Extensions')
107 108 add_package(packages, 'external')
108 109 add_package(packages, 'gui')
109 110 add_package(packages, 'gui.wx')
110 111 add_package(packages, 'frontend', tests=True)
111 112 add_package(packages, 'frontend._process')
112 113 add_package(packages, 'frontend.wx')
113 114 add_package(packages, 'frontend.cocoa', tests=True)
114 115 add_package(packages, 'kernel', config=True, tests=True, scripts=True)
115 116 add_package(packages, 'kernel.core', config=True, tests=True)
116 117 add_package(packages, 'testing', tests=True)
117 118 add_package(packages, 'tools', tests=True)
118 119 add_package(packages, 'UserConfig')
119 120 return packages
120 121
121 122 #---------------------------------------------------------------------------
122 123 # Find package data
123 124 #---------------------------------------------------------------------------
124 125
125 126 def find_package_data():
126 127 """
127 128 Find IPython's package_data.
128 129 """
129 130 # This is not enough for these things to appear in an sdist.
130 131 # We need to muck with the MANIFEST to get this to work
131 132 package_data = {
132 133 'IPython.UserConfig' : ['*'],
133 134 'IPython.tools.tests' : ['*.txt'],
134 135 'IPython.testing' : ['*.txt']
135 136 }
136 137 return package_data
137 138
138 139
139 140 #---------------------------------------------------------------------------
140 141 # Find data files
141 142 #---------------------------------------------------------------------------
142 143
144 def make_dir_struct(tag,base,out_base):
145 """Make the directory structure of all files below a starting dir.
146
147 This is just a convenience routine to help build a nested directory
148 hierarchy because distutils is too stupid to do this by itself.
149
150 XXX - this needs a proper docstring!
151 """
152
153 # we'll use these a lot below
154 lbase = len(base)
155 pathsep = os.path.sep
156 lpathsep = len(pathsep)
157
158 out = []
159 for (dirpath,dirnames,filenames) in os.walk(base):
160 # we need to strip out the dirpath from the base to map it to the
161 # output (installation) path. This requires possibly stripping the
162 # path separator, because otherwise pjoin will not work correctly
163 # (pjoin('foo/','/bar') returns '/bar').
164
165 dp_eff = dirpath[lbase:]
166 if dp_eff.startswith(pathsep):
167 dp_eff = dp_eff[lpathsep:]
168 # The output path must be anchored at the out_base marker
169 out_path = pjoin(out_base,dp_eff)
170 # Now we can generate the final filenames. Since os.walk only produces
171 # filenames, we must join back with the dirpath to get full valid file
172 # paths:
173 pfiles = [pjoin(dirpath,f) for f in filenames]
174 # Finally, generate the entry we need, which is a triple of (tag,output
175 # path, files) for use as a data_files parameter in install_data.
176 out.append((tag,out_path,pfiles))
177
178 return out
179
180
143 181 def find_data_files():
144 182 """
145 183 Find IPython's data_files.
184
185 Most of these are docs.
146 186 """
147 187
148 # I can't find how to make distutils create a nested dir. structure, so
149 # in the meantime do it manually. Butt ugly.
150 # Note that http://www.redbrick.dcu.ie/~noel/distutils.html, ex. 2/3, contain
151 # information on how to do this more cleanly once python 2.4 can be assumed.
152 # Thanks to Noel for the tip.
153 188 docdirbase = 'share/doc/ipython'
154 189 manpagebase = 'share/man/man1'
155 190
156 # We only need to exclude from this things NOT already excluded in the
157 # MANIFEST.in file.
158 exclude = ('.sh','.1.gz')
159 # We need to figure out how we want to package all of our rst docs?
160 # docfiles = filter(lambda f:file_doesnt_endwith(f,exclude),glob('docs/*'))
161 # XXX - For now all the example files
162 examfiles = filter(isfile, glob('docs/examples/core/*.py'))
163 examfiles += filter(isfile, glob('docs/examples/kernel/*.py'))
164
191 # Simple file lists can be made by hand
165 192 manpages = filter(isfile, glob('docs/man/*.1.gz'))
166 193 igridhelpfiles = filter(isfile, glob('IPython/Extensions/igrid_help.*'))
167 194
168 data_files = [#('data', docdirbase, docfiles),
169 ('data', pjoin(docdirbase, 'examples'),examfiles),
170 ('data', manpagebase, manpages),
195 # For nested structures, use the utility above
196 example_files = make_dir_struct('data','docs/examples',
197 pjoin(docdirbase,'examples'))
198 manual_files = make_dir_struct('data','docs/dist',pjoin(docdirbase,'manual'))
199
200 # And assemble the entire output list
201 data_files = [ ('data',manpagebase, manpages),
171 202 ('data',pjoin(docdirbase, 'extensions'),igridhelpfiles),
172 ]
203 ] + manual_files + example_files
173 204
174 205 ## import pprint # dbg
175 206 ## print '*'*80
176 207 ## print 'data files'
177 208 ## pprint.pprint(data_files)
178 209 ## print '*'*80
179 210
180 211 return data_files
181 212
182 213 #---------------------------------------------------------------------------
183 214 # Find scripts
184 215 #---------------------------------------------------------------------------
185 216
186 217 def find_scripts():
187 218 """
188 219 Find IPython's scripts.
189 220 """
190 scripts = []
191 scripts.append('IPython/kernel/scripts/ipengine')
192 scripts.append('IPython/kernel/scripts/ipcontroller')
193 scripts.append('IPython/kernel/scripts/ipcluster')
194 scripts.append('scripts/ipython')
195 scripts.append('scripts/ipythonx')
196 scripts.append('scripts/pycolor')
197 scripts.append('scripts/irunner')
221 scripts = ['IPython/kernel/scripts/ipengine',
222 'IPython/kernel/scripts/ipcontroller',
223 'IPython/kernel/scripts/ipcluster',
224 'scripts/ipython',
225 'scripts/ipythonx',
226 'scripts/pycolor',
227 'scripts/irunner',
228 ]
198 229
199 230 # Script to be run by the windows binary installer after the default setup
200 231 # routine, to add shortcuts and similar windows-only things. Windows
201 232 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
202 233 # doesn't find them.
203 234 if 'bdist_wininst' in sys.argv:
204 235 if len(sys.argv) > 2 and ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
205 236 print >> sys.stderr,"ERROR: bdist_wininst must be run alone. Exiting."
206 237 sys.exit(1)
207 238 scripts.append('scripts/ipython_win_post_install.py')
208 239
209 240 return scripts
210 241
211 242 #---------------------------------------------------------------------------
212 # Find scripts
243 # Verify all dependencies
213 244 #---------------------------------------------------------------------------
214 245
215 246 def check_for_dependencies():
216 247 """Check for IPython's dependencies.
217 248
218 249 This function should NOT be called if running under setuptools!
219 250 """
220 251 from setupext.setupext import (
221 252 print_line, print_raw, print_status, print_message,
222 253 check_for_zopeinterface, check_for_twisted,
223 254 check_for_foolscap, check_for_pyopenssl,
224 255 check_for_sphinx, check_for_pygments,
225 256 check_for_nose, check_for_pexpect
226 257 )
227 258 print_line()
228 259 print_raw("BUILDING IPYTHON")
229 260 print_status('python', sys.version)
230 261 print_status('platform', sys.platform)
231 262 if sys.platform == 'win32':
232 263 print_status('Windows version', sys.getwindowsversion())
233 264
234 265 print_raw("")
235 266 print_raw("OPTIONAL DEPENDENCIES")
236 267
237 268 check_for_zopeinterface()
238 269 check_for_twisted()
239 270 check_for_foolscap()
240 271 check_for_pyopenssl()
241 272 check_for_sphinx()
242 273 check_for_pygments()
243 274 check_for_nose()
244 275 check_for_pexpect()
General Comments 0
You need to be logged in to leave comments. Login now