##// END OF EJS Templates
use napoleon instead of numpydoc
Min RK -
Show More
@@ -1,3 +1,2 b''
1 numpydoc
2 -e .
1 -e .
3 ipykernel
2 ipykernel
@@ -1,267 +1,267 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 #
2 #
3 # IPython documentation build configuration file.
3 # IPython documentation build configuration file.
4
4
5 # NOTE: This file has been edited manually from the auto-generated one from
5 # NOTE: This file has been edited manually from the auto-generated one from
6 # sphinx. Do NOT delete and re-generate. If any changes from sphinx are
6 # sphinx. Do NOT delete and re-generate. If any changes from sphinx are
7 # needed, generate a scratch one and merge by hand any new fields needed.
7 # needed, generate a scratch one and merge by hand any new fields needed.
8
8
9 #
9 #
10 # This file is execfile()d with the current directory set to its containing dir.
10 # This file is execfile()d with the current directory set to its containing dir.
11 #
11 #
12 # The contents of this file are pickled, so don't put values in the namespace
12 # The contents of this file are pickled, so don't put values in the namespace
13 # that aren't pickleable (module imports are okay, they're removed automatically).
13 # that aren't pickleable (module imports are okay, they're removed automatically).
14 #
14 #
15 # All configuration values have a default value; values that are commented out
15 # All configuration values have a default value; values that are commented out
16 # serve to show the default value.
16 # serve to show the default value.
17
17
18 import sys, os
18 import sys, os
19
19
20 ON_RTD = os.environ.get('READTHEDOCS', None) == 'True'
20 ON_RTD = os.environ.get('READTHEDOCS', None) == 'True'
21
21
22 if ON_RTD:
22 if ON_RTD:
23 # Mock the presence of matplotlib, which we don't have on RTD
23 # Mock the presence of matplotlib, which we don't have on RTD
24 # see
24 # see
25 # http://read-the-docs.readthedocs.org/en/latest/faq.html
25 # http://read-the-docs.readthedocs.org/en/latest/faq.html
26 tags.add('rtd')
26 tags.add('rtd')
27
27
28 # RTD doesn't use the Makefile, so re-run autogen_{things}.py here.
28 # RTD doesn't use the Makefile, so re-run autogen_{things}.py here.
29 for name in ('config', 'api', 'magics'):
29 for name in ('config', 'api', 'magics'):
30 fname = 'autogen_{}.py'.format(name)
30 fname = 'autogen_{}.py'.format(name)
31 fpath = os.path.abspath(os.path.join('..', fname))
31 fpath = os.path.abspath(os.path.join('..', fname))
32 with open(fpath) as f:
32 with open(fpath) as f:
33 exec(compile(f.read(), fname, 'exec'), {
33 exec(compile(f.read(), fname, 'exec'), {
34 '__file__': fpath,
34 '__file__': fpath,
35 '__name__': '__main__',
35 '__name__': '__main__',
36 })
36 })
37
37
38 # If your extensions are in another directory, add it here. If the directory
38 # If your extensions are in another directory, add it here. If the directory
39 # is relative to the documentation root, use os.path.abspath to make it
39 # is relative to the documentation root, use os.path.abspath to make it
40 # absolute, like shown here.
40 # absolute, like shown here.
41 sys.path.insert(0, os.path.abspath('../sphinxext'))
41 sys.path.insert(0, os.path.abspath('../sphinxext'))
42
42
43 # We load the ipython release info into a dict by explicit execution
43 # We load the ipython release info into a dict by explicit execution
44 iprelease = {}
44 iprelease = {}
45 exec(compile(open('../../IPython/core/release.py').read(), '../../IPython/core/release.py', 'exec'),iprelease)
45 exec(compile(open('../../IPython/core/release.py').read(), '../../IPython/core/release.py', 'exec'),iprelease)
46
46
47 # General configuration
47 # General configuration
48 # ---------------------
48 # ---------------------
49
49
50 # Add any Sphinx extension module names here, as strings. They can be extensions
50 # Add any Sphinx extension module names here, as strings. They can be extensions
51 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
51 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
52 extensions = [
52 extensions = [
53 'matplotlib.sphinxext.mathmpl',
53 'matplotlib.sphinxext.mathmpl',
54 'matplotlib.sphinxext.only_directives',
54 'matplotlib.sphinxext.only_directives',
55 'matplotlib.sphinxext.plot_directive',
55 'matplotlib.sphinxext.plot_directive',
56 'sphinx.ext.autodoc',
56 'sphinx.ext.autodoc',
57 'sphinx.ext.autosummary',
57 'sphinx.ext.autosummary',
58 'sphinx.ext.doctest',
58 'sphinx.ext.doctest',
59 'sphinx.ext.inheritance_diagram',
59 'sphinx.ext.inheritance_diagram',
60 'sphinx.ext.intersphinx',
60 'sphinx.ext.intersphinx',
61 'IPython.sphinxext.ipython_console_highlighting',
61 'IPython.sphinxext.ipython_console_highlighting',
62 'IPython.sphinxext.ipython_directive',
62 'IPython.sphinxext.ipython_directive',
63 'numpydoc', # to preprocess docstrings
63 'sphinx.ext.napoleon', # to preprocess docstrings
64 'github', # for easy GitHub links
64 'github', # for easy GitHub links
65 'magics',
65 'magics',
66 ]
66 ]
67
67
68 if ON_RTD:
68 if ON_RTD:
69 # Remove extensions not currently supported on RTD
69 # Remove extensions not currently supported on RTD
70 extensions.remove('matplotlib.sphinxext.only_directives')
70 extensions.remove('matplotlib.sphinxext.only_directives')
71 extensions.remove('matplotlib.sphinxext.mathmpl')
71 extensions.remove('matplotlib.sphinxext.mathmpl')
72 extensions.remove('matplotlib.sphinxext.plot_directive')
72 extensions.remove('matplotlib.sphinxext.plot_directive')
73 extensions.remove('IPython.sphinxext.ipython_directive')
73 extensions.remove('IPython.sphinxext.ipython_directive')
74 extensions.remove('IPython.sphinxext.ipython_console_highlighting')
74 extensions.remove('IPython.sphinxext.ipython_console_highlighting')
75
75
76 # Add any paths that contain templates here, relative to this directory.
76 # Add any paths that contain templates here, relative to this directory.
77 templates_path = ['_templates']
77 templates_path = ['_templates']
78
78
79 # The suffix of source filenames.
79 # The suffix of source filenames.
80 source_suffix = '.rst'
80 source_suffix = '.rst'
81
81
82 if iprelease['_version_extra'] == 'dev':
82 if iprelease['_version_extra'] == 'dev':
83 rst_prolog = """
83 rst_prolog = """
84 .. note::
84 .. note::
85
85
86 This documentation is for a development version of IPython. There may be
86 This documentation is for a development version of IPython. There may be
87 significant differences from the latest stable release.
87 significant differences from the latest stable release.
88
88
89 """
89 """
90
90
91 # The master toctree document.
91 # The master toctree document.
92 master_doc = 'index'
92 master_doc = 'index'
93
93
94 # General substitutions.
94 # General substitutions.
95 project = 'IPython'
95 project = 'IPython'
96 copyright = 'The IPython Development Team'
96 copyright = 'The IPython Development Team'
97
97
98 # ghissue config
98 # ghissue config
99 github_project_url = "https://github.com/ipython/ipython"
99 github_project_url = "https://github.com/ipython/ipython"
100
100
101 # numpydoc config
101 # numpydoc config
102 numpydoc_show_class_members = False # Otherwise Sphinx emits thousands of warnings
102 numpydoc_show_class_members = False # Otherwise Sphinx emits thousands of warnings
103 numpydoc_class_members_toctree = False
103 numpydoc_class_members_toctree = False
104
104
105 # The default replacements for |version| and |release|, also used in various
105 # The default replacements for |version| and |release|, also used in various
106 # other places throughout the built documents.
106 # other places throughout the built documents.
107 #
107 #
108 # The full version, including alpha/beta/rc tags.
108 # The full version, including alpha/beta/rc tags.
109 release = "%s" % iprelease['version']
109 release = "%s" % iprelease['version']
110 # Just the X.Y.Z part, no '-dev'
110 # Just the X.Y.Z part, no '-dev'
111 version = iprelease['version'].split('-', 1)[0]
111 version = iprelease['version'].split('-', 1)[0]
112
112
113
113
114 # There are two options for replacing |today|: either, you set today to some
114 # There are two options for replacing |today|: either, you set today to some
115 # non-false value, then it is used:
115 # non-false value, then it is used:
116 #today = ''
116 #today = ''
117 # Else, today_fmt is used as the format for a strftime call.
117 # Else, today_fmt is used as the format for a strftime call.
118 today_fmt = '%B %d, %Y'
118 today_fmt = '%B %d, %Y'
119
119
120 # List of documents that shouldn't be included in the build.
120 # List of documents that shouldn't be included in the build.
121 #unused_docs = []
121 #unused_docs = []
122
122
123 # Exclude these glob-style patterns when looking for source files. They are
123 # Exclude these glob-style patterns when looking for source files. They are
124 # relative to the source/ directory.
124 # relative to the source/ directory.
125 exclude_patterns = ['whatsnew/pr']
125 exclude_patterns = ['whatsnew/pr']
126
126
127
127
128 # If true, '()' will be appended to :func: etc. cross-reference text.
128 # If true, '()' will be appended to :func: etc. cross-reference text.
129 #add_function_parentheses = True
129 #add_function_parentheses = True
130
130
131 # If true, the current module name will be prepended to all description
131 # If true, the current module name will be prepended to all description
132 # unit titles (such as .. function::).
132 # unit titles (such as .. function::).
133 #add_module_names = True
133 #add_module_names = True
134
134
135 # If true, sectionauthor and moduleauthor directives will be shown in the
135 # If true, sectionauthor and moduleauthor directives will be shown in the
136 # output. They are ignored by default.
136 # output. They are ignored by default.
137 #show_authors = False
137 #show_authors = False
138
138
139 # The name of the Pygments (syntax highlighting) style to use.
139 # The name of the Pygments (syntax highlighting) style to use.
140 pygments_style = 'sphinx'
140 pygments_style = 'sphinx'
141
141
142 # Set the default role so we can use `foo` instead of ``foo``
142 # Set the default role so we can use `foo` instead of ``foo``
143 default_role = 'literal'
143 default_role = 'literal'
144
144
145 # Options for HTML output
145 # Options for HTML output
146 # -----------------------
146 # -----------------------
147
147
148 # The style sheet to use for HTML and HTML Help pages. A file of that name
148 # The style sheet to use for HTML and HTML Help pages. A file of that name
149 # must exist either in Sphinx' static/ path, or in one of the custom paths
149 # must exist either in Sphinx' static/ path, or in one of the custom paths
150 # given in html_static_path.
150 # given in html_static_path.
151 html_style = 'default.css'
151 html_style = 'default.css'
152
152
153 # The name for this set of Sphinx documents. If None, it defaults to
153 # The name for this set of Sphinx documents. If None, it defaults to
154 # "<project> v<release> documentation".
154 # "<project> v<release> documentation".
155 #html_title = None
155 #html_title = None
156
156
157 # The name of an image file (within the static path) to place at the top of
157 # The name of an image file (within the static path) to place at the top of
158 # the sidebar.
158 # the sidebar.
159 #html_logo = None
159 #html_logo = None
160
160
161 # Add any paths that contain custom static files (such as style sheets) here,
161 # Add any paths that contain custom static files (such as style sheets) here,
162 # relative to this directory. They are copied after the builtin static files,
162 # relative to this directory. They are copied after the builtin static files,
163 # so a file named "default.css" will overwrite the builtin "default.css".
163 # so a file named "default.css" will overwrite the builtin "default.css".
164 html_static_path = ['_static']
164 html_static_path = ['_static']
165
165
166 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
166 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
167 # using the given strftime format.
167 # using the given strftime format.
168 html_last_updated_fmt = '%b %d, %Y'
168 html_last_updated_fmt = '%b %d, %Y'
169
169
170 # If true, SmartyPants will be used to convert quotes and dashes to
170 # If true, SmartyPants will be used to convert quotes and dashes to
171 # typographically correct entities.
171 # typographically correct entities.
172 #html_use_smartypants = True
172 #html_use_smartypants = True
173
173
174 # Custom sidebar templates, maps document names to template names.
174 # Custom sidebar templates, maps document names to template names.
175 #html_sidebars = {}
175 #html_sidebars = {}
176
176
177 # Additional templates that should be rendered to pages, maps page names to
177 # Additional templates that should be rendered to pages, maps page names to
178 # template names.
178 # template names.
179 html_additional_pages = {
179 html_additional_pages = {
180 'interactive/htmlnotebook': 'notebook_redirect.html',
180 'interactive/htmlnotebook': 'notebook_redirect.html',
181 'interactive/notebook': 'notebook_redirect.html',
181 'interactive/notebook': 'notebook_redirect.html',
182 'interactive/nbconvert': 'notebook_redirect.html',
182 'interactive/nbconvert': 'notebook_redirect.html',
183 'interactive/public_server': 'notebook_redirect.html',
183 'interactive/public_server': 'notebook_redirect.html',
184 }
184 }
185
185
186 # If false, no module index is generated.
186 # If false, no module index is generated.
187 #html_use_modindex = True
187 #html_use_modindex = True
188
188
189 # If true, the reST sources are included in the HTML build as _sources/<name>.
189 # If true, the reST sources are included in the HTML build as _sources/<name>.
190 #html_copy_source = True
190 #html_copy_source = True
191
191
192 # If true, an OpenSearch description file will be output, and all pages will
192 # If true, an OpenSearch description file will be output, and all pages will
193 # contain a <link> tag referring to it. The value of this option must be the
193 # contain a <link> tag referring to it. The value of this option must be the
194 # base URL from which the finished HTML is served.
194 # base URL from which the finished HTML is served.
195 #html_use_opensearch = ''
195 #html_use_opensearch = ''
196
196
197 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
197 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
198 #html_file_suffix = ''
198 #html_file_suffix = ''
199
199
200 # Output file base name for HTML help builder.
200 # Output file base name for HTML help builder.
201 htmlhelp_basename = 'ipythondoc'
201 htmlhelp_basename = 'ipythondoc'
202
202
203 intersphinx_mapping = {'python': ('http://docs.python.org/2/', None),
203 intersphinx_mapping = {'python': ('http://docs.python.org/2/', None),
204 'rpy2': ('http://rpy.sourceforge.net/rpy2/doc-2.4/html/', None),
204 'rpy2': ('http://rpy.sourceforge.net/rpy2/doc-2.4/html/', None),
205 'traitlets': ('http://traitlets.readthedocs.org/en/latest/', None),
205 'traitlets': ('http://traitlets.readthedocs.org/en/latest/', None),
206 'jupyterclient': ('http://jupyter-client.readthedocs.org/en/latest/', None),
206 'jupyterclient': ('http://jupyter-client.readthedocs.org/en/latest/', None),
207 'ipyparallel': ('http://ipyparallel.readthedocs.org/en/latest/', None),
207 'ipyparallel': ('http://ipyparallel.readthedocs.org/en/latest/', None),
208 }
208 }
209
209
210 # Options for LaTeX output
210 # Options for LaTeX output
211 # ------------------------
211 # ------------------------
212
212
213 # The paper size ('letter' or 'a4').
213 # The paper size ('letter' or 'a4').
214 latex_paper_size = 'letter'
214 latex_paper_size = 'letter'
215
215
216 # The font size ('10pt', '11pt' or '12pt').
216 # The font size ('10pt', '11pt' or '12pt').
217 latex_font_size = '11pt'
217 latex_font_size = '11pt'
218
218
219 # Grouping the document tree into LaTeX files. List of tuples
219 # Grouping the document tree into LaTeX files. List of tuples
220 # (source start file, target name, title, author, document class [howto/manual]).
220 # (source start file, target name, title, author, document class [howto/manual]).
221
221
222 latex_documents = [
222 latex_documents = [
223 ('index', 'ipython.tex', 'IPython Documentation',
223 ('index', 'ipython.tex', 'IPython Documentation',
224 u"""The IPython Development Team""", 'manual', True),
224 u"""The IPython Development Team""", 'manual', True),
225 ('parallel/winhpc_index', 'winhpc_whitepaper.tex',
225 ('parallel/winhpc_index', 'winhpc_whitepaper.tex',
226 'Using IPython on Windows HPC Server 2008',
226 'Using IPython on Windows HPC Server 2008',
227 u"Brian E. Granger", 'manual', True)
227 u"Brian E. Granger", 'manual', True)
228 ]
228 ]
229
229
230 # The name of an image file (relative to this directory) to place at the top of
230 # The name of an image file (relative to this directory) to place at the top of
231 # the title page.
231 # the title page.
232 #latex_logo = None
232 #latex_logo = None
233
233
234 # For "manual" documents, if this is true, then toplevel headings are parts,
234 # For "manual" documents, if this is true, then toplevel headings are parts,
235 # not chapters.
235 # not chapters.
236 #latex_use_parts = False
236 #latex_use_parts = False
237
237
238 # Additional stuff for the LaTeX preamble.
238 # Additional stuff for the LaTeX preamble.
239 #latex_preamble = ''
239 #latex_preamble = ''
240
240
241 # Documents to append as an appendix to all manuals.
241 # Documents to append as an appendix to all manuals.
242 #latex_appendices = []
242 #latex_appendices = []
243
243
244 # If false, no module index is generated.
244 # If false, no module index is generated.
245 latex_use_modindex = True
245 latex_use_modindex = True
246
246
247
247
248 # Options for texinfo output
248 # Options for texinfo output
249 # --------------------------
249 # --------------------------
250
250
251 texinfo_documents = [
251 texinfo_documents = [
252 (master_doc, 'ipython', 'IPython Documentation',
252 (master_doc, 'ipython', 'IPython Documentation',
253 'The IPython Development Team',
253 'The IPython Development Team',
254 'IPython',
254 'IPython',
255 'IPython Documentation',
255 'IPython Documentation',
256 'Programming',
256 'Programming',
257 1),
257 1),
258 ]
258 ]
259
259
260 modindex_common_prefix = ['IPython.']
260 modindex_common_prefix = ['IPython.']
261
261
262
262
263 # Cleanup
263 # Cleanup
264 # -------
264 # -------
265 # delete release info to avoid pickling errors from sphinx
265 # delete release info to avoid pickling errors from sphinx
266
266
267 del iprelease
267 del iprelease
@@ -1,294 +1,294 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) 2008-2011, IPython Development Team.
10 # Copyright (c) 2008-2011, IPython Development Team.
11 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
11 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
12 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
12 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
13 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
13 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
14 #
14 #
15 # Distributed under the terms of the Modified BSD License.
15 # Distributed under the terms of the Modified BSD License.
16 #
16 #
17 # The full license is in the file COPYING.rst, distributed with this software.
17 # The full license is in the file COPYING.rst, distributed with this software.
18 #-----------------------------------------------------------------------------
18 #-----------------------------------------------------------------------------
19
19
20 #-----------------------------------------------------------------------------
20 #-----------------------------------------------------------------------------
21 # Minimal Python version sanity check
21 # Minimal Python version sanity check
22 #-----------------------------------------------------------------------------
22 #-----------------------------------------------------------------------------
23 from __future__ import print_function
23 from __future__ import print_function
24
24
25 import sys
25 import sys
26
26
27 # This check is also made in IPython/__init__, don't forget to update both when
27 # This check is also made in IPython/__init__, don't forget to update both when
28 # changing Python version requirements.
28 # changing Python version requirements.
29 v = sys.version_info
29 v = sys.version_info
30 if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):
30 if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):
31 error = "ERROR: IPython requires Python version 2.7 or 3.3 or above."
31 error = "ERROR: IPython requires Python version 2.7 or 3.3 or above."
32 print(error, file=sys.stderr)
32 print(error, file=sys.stderr)
33 sys.exit(1)
33 sys.exit(1)
34
34
35 PY3 = (sys.version_info[0] >= 3)
35 PY3 = (sys.version_info[0] >= 3)
36
36
37 # At least we're on the python version we need, move on.
37 # At least we're on the python version we need, move on.
38
38
39 #-------------------------------------------------------------------------------
39 #-------------------------------------------------------------------------------
40 # Imports
40 # Imports
41 #-------------------------------------------------------------------------------
41 #-------------------------------------------------------------------------------
42
42
43 # Stdlib imports
43 # Stdlib imports
44 import os
44 import os
45 import shutil
45 import shutil
46
46
47 from glob import glob
47 from glob import glob
48
48
49 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
49 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
50 # update it when the contents of directories change.
50 # update it when the contents of directories change.
51 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
51 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
52
52
53 from distutils.core import setup
53 from distutils.core import setup
54
54
55 # Our own imports
55 # Our own imports
56 from setupbase import target_update
56 from setupbase import target_update
57
57
58 from setupbase import (
58 from setupbase import (
59 setup_args,
59 setup_args,
60 find_packages,
60 find_packages,
61 find_package_data,
61 find_package_data,
62 check_package_data_first,
62 check_package_data_first,
63 find_entry_points,
63 find_entry_points,
64 build_scripts_entrypt,
64 build_scripts_entrypt,
65 find_data_files,
65 find_data_files,
66 git_prebuild,
66 git_prebuild,
67 install_symlinked,
67 install_symlinked,
68 install_lib_symlink,
68 install_lib_symlink,
69 install_scripts_for_symlink,
69 install_scripts_for_symlink,
70 unsymlink,
70 unsymlink,
71 )
71 )
72
72
73 isfile = os.path.isfile
73 isfile = os.path.isfile
74 pjoin = os.path.join
74 pjoin = os.path.join
75
75
76 #-------------------------------------------------------------------------------
76 #-------------------------------------------------------------------------------
77 # Handle OS specific things
77 # Handle OS specific things
78 #-------------------------------------------------------------------------------
78 #-------------------------------------------------------------------------------
79
79
80 if os.name in ('nt','dos'):
80 if os.name in ('nt','dos'):
81 os_name = 'windows'
81 os_name = 'windows'
82 else:
82 else:
83 os_name = os.name
83 os_name = os.name
84
84
85 # Under Windows, 'sdist' has not been supported. Now that the docs build with
85 # Under Windows, 'sdist' has not been supported. Now that the docs build with
86 # Sphinx it might work, but let's not turn it on until someone confirms that it
86 # Sphinx it might work, but let's not turn it on until someone confirms that it
87 # actually works.
87 # actually works.
88 if os_name == 'windows' and 'sdist' in sys.argv:
88 if os_name == 'windows' and 'sdist' in sys.argv:
89 print('The sdist command is not available under Windows. Exiting.')
89 print('The sdist command is not available under Windows. Exiting.')
90 sys.exit(1)
90 sys.exit(1)
91
91
92
92
93 #-------------------------------------------------------------------------------
93 #-------------------------------------------------------------------------------
94 # Things related to the IPython documentation
94 # Things related to the IPython documentation
95 #-------------------------------------------------------------------------------
95 #-------------------------------------------------------------------------------
96
96
97 # update the manuals when building a source dist
97 # update the manuals when building a source dist
98 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
98 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
99
99
100 # List of things to be updated. Each entry is a triplet of args for
100 # List of things to be updated. Each entry is a triplet of args for
101 # target_update()
101 # target_update()
102 to_update = [
102 to_update = [
103 ('docs/man/ipython.1.gz',
103 ('docs/man/ipython.1.gz',
104 ['docs/man/ipython.1'],
104 ['docs/man/ipython.1'],
105 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
105 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
106 ]
106 ]
107
107
108
108
109 [ target_update(*t) for t in to_update ]
109 [ target_update(*t) for t in to_update ]
110
110
111 #---------------------------------------------------------------------------
111 #---------------------------------------------------------------------------
112 # Find all the packages, package data, and data_files
112 # Find all the packages, package data, and data_files
113 #---------------------------------------------------------------------------
113 #---------------------------------------------------------------------------
114
114
115 packages = find_packages()
115 packages = find_packages()
116 package_data = find_package_data()
116 package_data = find_package_data()
117
117
118 data_files = find_data_files()
118 data_files = find_data_files()
119
119
120 setup_args['packages'] = packages
120 setup_args['packages'] = packages
121 setup_args['package_data'] = package_data
121 setup_args['package_data'] = package_data
122 setup_args['data_files'] = data_files
122 setup_args['data_files'] = data_files
123
123
124 #---------------------------------------------------------------------------
124 #---------------------------------------------------------------------------
125 # custom distutils commands
125 # custom distutils commands
126 #---------------------------------------------------------------------------
126 #---------------------------------------------------------------------------
127 # imports here, so they are after setuptools import if there was one
127 # imports here, so they are after setuptools import if there was one
128 from distutils.command.sdist import sdist
128 from distutils.command.sdist import sdist
129 from distutils.command.upload import upload
129 from distutils.command.upload import upload
130
130
131 class UploadWindowsInstallers(upload):
131 class UploadWindowsInstallers(upload):
132
132
133 description = "Upload Windows installers to PyPI (only used from tools/release_windows.py)"
133 description = "Upload Windows installers to PyPI (only used from tools/release_windows.py)"
134 user_options = upload.user_options + [
134 user_options = upload.user_options + [
135 ('files=', 'f', 'exe file (or glob) to upload')
135 ('files=', 'f', 'exe file (or glob) to upload')
136 ]
136 ]
137 def initialize_options(self):
137 def initialize_options(self):
138 upload.initialize_options(self)
138 upload.initialize_options(self)
139 meta = self.distribution.metadata
139 meta = self.distribution.metadata
140 base = '{name}-{version}'.format(
140 base = '{name}-{version}'.format(
141 name=meta.get_name(),
141 name=meta.get_name(),
142 version=meta.get_version()
142 version=meta.get_version()
143 )
143 )
144 self.files = os.path.join('dist', '%s.*.exe' % base)
144 self.files = os.path.join('dist', '%s.*.exe' % base)
145
145
146 def run(self):
146 def run(self):
147 for dist_file in glob(self.files):
147 for dist_file in glob(self.files):
148 self.upload_file('bdist_wininst', 'any', dist_file)
148 self.upload_file('bdist_wininst', 'any', dist_file)
149
149
150 setup_args['cmdclass'] = {
150 setup_args['cmdclass'] = {
151 'build_py': \
151 'build_py': \
152 check_package_data_first(git_prebuild('IPython')),
152 check_package_data_first(git_prebuild('IPython')),
153 'sdist' : git_prebuild('IPython', sdist),
153 'sdist' : git_prebuild('IPython', sdist),
154 'upload_wininst' : UploadWindowsInstallers,
154 'upload_wininst' : UploadWindowsInstallers,
155 'symlink': install_symlinked,
155 'symlink': install_symlinked,
156 'install_lib_symlink': install_lib_symlink,
156 'install_lib_symlink': install_lib_symlink,
157 'install_scripts_sym': install_scripts_for_symlink,
157 'install_scripts_sym': install_scripts_for_symlink,
158 'unsymlink': unsymlink,
158 'unsymlink': unsymlink,
159 }
159 }
160
160
161
161
162 #---------------------------------------------------------------------------
162 #---------------------------------------------------------------------------
163 # Handle scripts, dependencies, and setuptools specific things
163 # Handle scripts, dependencies, and setuptools specific things
164 #---------------------------------------------------------------------------
164 #---------------------------------------------------------------------------
165
165
166 # For some commands, use setuptools. Note that we do NOT list install here!
166 # For some commands, use setuptools. Note that we do NOT list install here!
167 # If you want a setuptools-enhanced install, just run 'setupegg.py install'
167 # If you want a setuptools-enhanced install, just run 'setupegg.py install'
168 needs_setuptools = set(('develop', 'release', 'bdist_egg', 'bdist_rpm',
168 needs_setuptools = set(('develop', 'release', 'bdist_egg', 'bdist_rpm',
169 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel',
169 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel',
170 'egg_info', 'easy_install', 'upload', 'install_egg_info',
170 'egg_info', 'easy_install', 'upload', 'install_egg_info',
171 ))
171 ))
172
172
173 if len(needs_setuptools.intersection(sys.argv)) > 0:
173 if len(needs_setuptools.intersection(sys.argv)) > 0:
174 import setuptools
174 import setuptools
175
175
176 # This dict is used for passing extra arguments that are setuptools
176 # This dict is used for passing extra arguments that are setuptools
177 # specific to setup
177 # specific to setup
178 setuptools_extra_args = {}
178 setuptools_extra_args = {}
179
179
180 # setuptools requirements
180 # setuptools requirements
181
181
182 extras_require = dict(
182 extras_require = dict(
183 parallel = ['ipyparallel'],
183 parallel = ['ipyparallel'],
184 qtconsole = ['qtconsole'],
184 qtconsole = ['qtconsole'],
185 doc = ['Sphinx>=1.1', 'numpydoc'],
185 doc = ['Sphinx>=1.3'],
186 test = ['nose>=0.10.1', 'requests', 'testpath'],
186 test = ['nose>=0.10.1', 'requests', 'testpath'],
187 terminal = [],
187 terminal = [],
188 kernel = ['ipykernel'],
188 kernel = ['ipykernel'],
189 nbformat = ['nbformat'],
189 nbformat = ['nbformat'],
190 notebook = ['notebook'],
190 notebook = ['notebook'],
191 nbconvert = ['nbconvert'],
191 nbconvert = ['nbconvert'],
192 )
192 )
193 install_requires = [
193 install_requires = [
194 'decorator',
194 'decorator',
195 'pickleshare',
195 'pickleshare',
196 'simplegeneric>0.8',
196 'simplegeneric>0.8',
197 'traitlets',
197 'traitlets',
198 ]
198 ]
199
199
200 # Platform-specific dependencies:
200 # Platform-specific dependencies:
201 # This is the correct way to specify these,
201 # This is the correct way to specify these,
202 # but requires pip >= 6. pip < 6 ignores these.
202 # but requires pip >= 6. pip < 6 ignores these.
203
203
204 extras_require.update({
204 extras_require.update({
205 ':sys_platform != "win32"': ['pexpect'],
205 ':sys_platform != "win32"': ['pexpect'],
206 ':sys_platform == "darwin"': ['appnope'],
206 ':sys_platform == "darwin"': ['appnope'],
207 ':sys_platform == "darwin" and platform_python_implementation == "CPython"': ['gnureadline'],
207 ':sys_platform == "darwin" and platform_python_implementation == "CPython"': ['gnureadline'],
208 'terminal:sys_platform == "win32"': ['pyreadline>=2'],
208 'terminal:sys_platform == "win32"': ['pyreadline>=2'],
209 'test:python_version == "2.7"': ['mock'],
209 'test:python_version == "2.7"': ['mock'],
210 })
210 })
211 # FIXME: re-specify above platform dependencies for pip < 6
211 # FIXME: re-specify above platform dependencies for pip < 6
212 # These would result in non-portable bdists.
212 # These would result in non-portable bdists.
213 if not any(arg.startswith('bdist') for arg in sys.argv):
213 if not any(arg.startswith('bdist') for arg in sys.argv):
214 if sys.version_info < (3, 3):
214 if sys.version_info < (3, 3):
215 extras_require['test'].append('mock')
215 extras_require['test'].append('mock')
216
216
217 if sys.platform == 'darwin':
217 if sys.platform == 'darwin':
218 install_requires.extend(['appnope'])
218 install_requires.extend(['appnope'])
219 have_readline = False
219 have_readline = False
220 try:
220 try:
221 import readline
221 import readline
222 except ImportError:
222 except ImportError:
223 pass
223 pass
224 else:
224 else:
225 if 'libedit' not in readline.__doc__:
225 if 'libedit' not in readline.__doc__:
226 have_readline = True
226 have_readline = True
227 if not have_readline:
227 if not have_readline:
228 install_requires.extend(['gnureadline'])
228 install_requires.extend(['gnureadline'])
229
229
230 if sys.platform.startswith('win'):
230 if sys.platform.startswith('win'):
231 extras_require['terminal'].append('pyreadline>=2.0')
231 extras_require['terminal'].append('pyreadline>=2.0')
232 else:
232 else:
233 install_requires.append('pexpect')
233 install_requires.append('pexpect')
234
234
235 # workaround pypa/setuptools#147, where setuptools misspells
235 # workaround pypa/setuptools#147, where setuptools misspells
236 # platform_python_implementation as python_implementation
236 # platform_python_implementation as python_implementation
237 if 'setuptools' in sys.modules:
237 if 'setuptools' in sys.modules:
238 for key in list(extras_require):
238 for key in list(extras_require):
239 if 'platform_python_implementation' in key:
239 if 'platform_python_implementation' in key:
240 new_key = key.replace('platform_python_implementation', 'python_implementation')
240 new_key = key.replace('platform_python_implementation', 'python_implementation')
241 extras_require[new_key] = extras_require.pop(key)
241 extras_require[new_key] = extras_require.pop(key)
242
242
243 everything = set()
243 everything = set()
244 for key, deps in extras_require.items():
244 for key, deps in extras_require.items():
245 if ':' not in key:
245 if ':' not in key:
246 everything.update(deps)
246 everything.update(deps)
247 extras_require['all'] = everything
247 extras_require['all'] = everything
248
248
249 if 'setuptools' in sys.modules:
249 if 'setuptools' in sys.modules:
250 setuptools_extra_args['zip_safe'] = False
250 setuptools_extra_args['zip_safe'] = False
251 setuptools_extra_args['entry_points'] = {
251 setuptools_extra_args['entry_points'] = {
252 'console_scripts': find_entry_points(),
252 'console_scripts': find_entry_points(),
253 'pygments.lexers': [
253 'pygments.lexers': [
254 'ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer',
254 'ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer',
255 'ipython = IPython.lib.lexers:IPythonLexer',
255 'ipython = IPython.lib.lexers:IPythonLexer',
256 'ipython3 = IPython.lib.lexers:IPython3Lexer',
256 'ipython3 = IPython.lib.lexers:IPython3Lexer',
257 ],
257 ],
258 }
258 }
259 setup_args['extras_require'] = extras_require
259 setup_args['extras_require'] = extras_require
260 requires = setup_args['install_requires'] = install_requires
260 requires = setup_args['install_requires'] = install_requires
261
261
262 # Script to be run by the windows binary installer after the default setup
262 # Script to be run by the windows binary installer after the default setup
263 # routine, to add shortcuts and similar windows-only things. Windows
263 # routine, to add shortcuts and similar windows-only things. Windows
264 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
264 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
265 # doesn't find them.
265 # doesn't find them.
266 if 'bdist_wininst' in sys.argv:
266 if 'bdist_wininst' in sys.argv:
267 if len(sys.argv) > 2 and \
267 if len(sys.argv) > 2 and \
268 ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
268 ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
269 print("ERROR: bdist_wininst must be run alone. Exiting.", file=sys.stderr)
269 print("ERROR: bdist_wininst must be run alone. Exiting.", file=sys.stderr)
270 sys.exit(1)
270 sys.exit(1)
271 setup_args['data_files'].append(
271 setup_args['data_files'].append(
272 ['Scripts', ('scripts/ipython.ico', 'scripts/ipython_nb.ico')])
272 ['Scripts', ('scripts/ipython.ico', 'scripts/ipython_nb.ico')])
273 setup_args['scripts'] = [pjoin('scripts','ipython_win_post_install.py')]
273 setup_args['scripts'] = [pjoin('scripts','ipython_win_post_install.py')]
274 setup_args['options'] = {"bdist_wininst":
274 setup_args['options'] = {"bdist_wininst":
275 {"install_script":
275 {"install_script":
276 "ipython_win_post_install.py"}}
276 "ipython_win_post_install.py"}}
277
277
278 else:
278 else:
279 # scripts has to be a non-empty list, or install_scripts isn't called
279 # scripts has to be a non-empty list, or install_scripts isn't called
280 setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()]
280 setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()]
281
281
282 setup_args['cmdclass']['build_scripts'] = build_scripts_entrypt
282 setup_args['cmdclass']['build_scripts'] = build_scripts_entrypt
283
283
284 #---------------------------------------------------------------------------
284 #---------------------------------------------------------------------------
285 # Do the actual setup now
285 # Do the actual setup now
286 #---------------------------------------------------------------------------
286 #---------------------------------------------------------------------------
287
287
288 setup_args.update(setuptools_extra_args)
288 setup_args.update(setuptools_extra_args)
289
289
290 def main():
290 def main():
291 setup(**setup_args)
291 setup(**setup_args)
292
292
293 if __name__ == '__main__':
293 if __name__ == '__main__':
294 main()
294 main()
General Comments 0
You need to be logged in to leave comments. Login now