##// END OF EJS Templates
Merge pull request #4975 from minrk/t2pp...
Thomas Kluyver -
r15088:d4d34f7f merge
parent child Browse files
Show More
@@ -35,3 +35,4 b' global-exclude *.pyc'
35 global-exclude *.pyo
35 global-exclude *.pyo
36 global-exclude .dircopy.log
36 global-exclude .dircopy.log
37 global-exclude .git
37 global-exclude .git
38 global-exclude .ipynb_checkpoints
@@ -67,6 +67,7 b' from setupbase import ('
67 update_submodules,
67 update_submodules,
68 require_submodules,
68 require_submodules,
69 UpdateSubmodules,
69 UpdateSubmodules,
70 get_bdist_wheel,
70 CompileCSS,
71 CompileCSS,
71 JavascriptVersion,
72 JavascriptVersion,
72 install_symlinked,
73 install_symlinked,
@@ -242,8 +243,8 b" setup_args['cmdclass'] = {"
242 # For some commands, use setuptools. Note that we do NOT list install here!
243 # For some commands, use setuptools. Note that we do NOT list install here!
243 # If you want a setuptools-enhanced install, just run 'setupegg.py install'
244 # If you want a setuptools-enhanced install, just run 'setupegg.py install'
244 needs_setuptools = set(('develop', 'release', 'bdist_egg', 'bdist_rpm',
245 needs_setuptools = set(('develop', 'release', 'bdist_egg', 'bdist_rpm',
245 'bdist', 'bdist_dumb', 'bdist_wininst', 'install_egg_info',
246 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel',
246 'egg_info', 'easy_install', 'upload',
247 'egg_info', 'easy_install', 'upload', 'install_egg_info',
247 ))
248 ))
248 if sys.platform == 'win32':
249 if sys.platform == 'win32':
249 # Depend on setuptools for install on *Windows only*
250 # Depend on setuptools for install on *Windows only*
@@ -259,43 +260,38 b' if len(needs_setuptools.intersection(sys.argv)) > 0:'
259 # specific to setup
260 # specific to setup
260 setuptools_extra_args = {}
261 setuptools_extra_args = {}
261
262
263 # setuptools requirements
264
265 extras_require = dict(
266 parallel = ['pyzmq>=2.1.11'],
267 qtconsole = ['pyzmq>=2.1.11', 'pygments'],
268 zmq = ['pyzmq>=2.1.11'],
269 doc = ['Sphinx>=1.1', 'numpydoc'],
270 test = ['nose>=0.10.1'],
271 notebook = ['tornado>=3.1', 'pyzmq>=2.1.11', 'jinja2'],
272 nbconvert = ['pygments', 'jinja2', 'Sphinx>=0.3']
273 )
274 everything = set()
275 for deps in extras_require.values():
276 everything.update(deps)
277 extras_require['all'] = everything
278 install_requires = []
279 if sys.platform == 'darwin':
280 install_requires.append('readline')
281 elif sys.platform.startswith('win'):
282 # Pyreadline has unicode and Python 3 fixes in 2.0
283 install_requires.append('pyreadline>=2.0')
284
262 if 'setuptools' in sys.modules:
285 if 'setuptools' in sys.modules:
263 # setup.py develop should check for submodules
286 # setup.py develop should check for submodules
264 from setuptools.command.develop import develop
287 from setuptools.command.develop import develop
265 setup_args['cmdclass']['develop'] = require_submodules(develop)
288 setup_args['cmdclass']['develop'] = require_submodules(develop)
289 setup_args['cmdclass']['bdist_wheel'] = get_bdist_wheel()
266
290
267 setuptools_extra_args['zip_safe'] = False
291 setuptools_extra_args['zip_safe'] = False
268 setuptools_extra_args['entry_points'] = {'console_scripts':find_entry_points()}
292 setuptools_extra_args['entry_points'] = {'console_scripts':find_entry_points()}
269 setup_args['extras_require'] = dict(
293 setup_args['extras_require'] = extras_require
270 parallel = 'pyzmq>=2.1.11',
294 requires = setup_args['install_requires'] = install_requires
271 qtconsole = ['pyzmq>=2.1.11', 'pygments'],
272 zmq = 'pyzmq>=2.1.11',
273 doc = ['Sphinx>=1.1', 'numpydoc'],
274 test = 'nose>=0.10.1',
275 notebook = ['tornado>=3.1', 'pyzmq>=2.1.11', 'jinja2'],
276 nbconvert = ['pygments', 'jinja2', 'Sphinx>=0.3']
277 )
278 everything = set()
279 for deps in setup_args['extras_require'].values():
280 if not isinstance(deps, list):
281 deps = [deps]
282 for dep in deps:
283 everything.add(dep)
284 setup_args['extras_require']['all'] = everything
285
286 requires = setup_args.setdefault('install_requires', [])
287 setupext.display_status = False
288 if not setupext.check_for_readline():
289 if sys.platform == 'darwin':
290 requires.append('readline')
291 elif sys.platform.startswith('win'):
292 # Pyreadline 64 bit windows issue solved in versions >=1.7.1
293 # Also solves issues with some older versions of pyreadline that
294 # satisfy the unconstrained depdendency.
295 requires.append('pyreadline>=1.7.1')
296 else:
297 pass
298 # do we want to install readline here?
299
295
300 # Script to be run by the windows binary installer after the default setup
296 # Script to be run by the windows binary installer after the default setup
301 # routine, to add shortcuts and similar windows-only things. Windows
297 # routine, to add shortcuts and similar windows-only things. Windows
@@ -314,10 +310,13 b" if 'setuptools' in sys.modules:"
314 "ipython_win_post_install.py"}}
310 "ipython_win_post_install.py"}}
315
311
316 else:
312 else:
317 # If we are running without setuptools, call this function which will
313 # If we are installing without setuptools, call this function which will
318 # check for dependencies an inform the user what is needed. This is
314 # check for dependencies an inform the user what is needed. This is
319 # just to make life easy for users.
315 # just to make life easy for users.
320 check_for_dependencies()
316 for install_cmd in ('install', 'symlink'):
317 if install_cmd in sys.argv:
318 check_for_dependencies()
319 break
321 # scripts has to be a non-empty list, or install_scripts isn't called
320 # scripts has to be a non-empty list, or install_scripts isn't called
322 setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()]
321 setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()]
323
322
@@ -127,23 +127,44 b' def find_package_data():'
127 # This is not enough for these things to appear in an sdist.
127 # This is not enough for these things to appear in an sdist.
128 # We need to muck with the MANIFEST to get this to work
128 # We need to muck with the MANIFEST to get this to work
129
129
130 # exclude static things that we don't ship (e.g. mathjax)
130 # exclude components from the walk,
131 excludes = ['mathjax']
131 # we will build the components separately
132 excludes = ['components']
132
133
133 # add 'static/' prefix to exclusions, and tuplify for use in startswith
134 # add 'static/' prefix to exclusions, and tuplify for use in startswith
134 excludes = tuple([os.path.join('static', ex) for ex in excludes])
135 excludes = tuple([pjoin('static', ex) for ex in excludes])
135
136
136 # walk notebook resources:
137 # walk notebook resources:
137 cwd = os.getcwd()
138 cwd = os.getcwd()
138 os.chdir(os.path.join('IPython', 'html'))
139 os.chdir(os.path.join('IPython', 'html'))
139 static_walk = list(os.walk('static'))
140 static_data = []
140 static_data = []
141 for parent, dirs, files in static_walk:
141 for parent, dirs, files in os.walk('static'):
142 if parent.startswith(excludes):
142 if parent.startswith(excludes):
143 continue
143 continue
144 for f in files:
144 for f in files:
145 static_data.append(os.path.join(parent, f))
145 static_data.append(pjoin(parent, f))
146
146 components = pjoin("static", "components")
147 # select the components we actually need to install
148 # (there are lots of resources we bundle for sdist-reasons that we don't actually use)
149 static_data.extend([
150 pjoin(components, "backbone", "backbone-min.js"),
151 pjoin(components, "bootstrap", "bootstrap", "js", "bootstrap.min.js"),
152 pjoin(components, "font-awesome", "font", "*.*"),
153 pjoin(components, "highlight.js", "build", "highlight.pack.js"),
154 pjoin(components, "jquery", "jquery.min.js"),
155 pjoin(components, "jquery-ui", "ui", "minified", "jquery-ui.min.js"),
156 pjoin(components, "jquery-ui", "themes", "smoothness", "jquery-ui.min.css"),
157 pjoin(components, "marked", "lib", "marked.js"),
158 pjoin(components, "requirejs", "require.js"),
159 pjoin(components, "underscore", "underscore-min.js"),
160 ])
161
162 # Ship all of Codemirror's CSS and JS
163 for parent, dirs, files in os.walk(pjoin(components, 'codemirror')):
164 for f in files:
165 if f.endswith(('.js', '.css')):
166 static_data.append(pjoin(parent, f))
167
147 os.chdir(os.path.join('tests',))
168 os.chdir(os.path.join('tests',))
148 js_tests = glob('casperjs/*.*') + glob('casperjs/*/*')
169 js_tests = glob('casperjs/*.*') + glob('casperjs/*/*')
149
170
@@ -157,7 +178,6 b' def find_package_data():'
157 'IPython.config.profile' : ['README*', '*/*.py'],
178 'IPython.config.profile' : ['README*', '*/*.py'],
158 'IPython.core.tests' : ['*.png', '*.jpg'],
179 'IPython.core.tests' : ['*.png', '*.jpg'],
159 'IPython.lib.tests' : ['*.wav'],
180 'IPython.lib.tests' : ['*.wav'],
160 'IPython.testing' : ['*.txt'],
161 'IPython.testing.plugin' : ['*.txt'],
181 'IPython.testing.plugin' : ['*.txt'],
162 'IPython.html' : ['templates/*'] + static_data,
182 'IPython.html' : ['templates/*'] + static_data,
163 'IPython.html.tests' : js_tests,
183 'IPython.html.tests' : js_tests,
@@ -167,6 +187,17 b' def find_package_data():'
167 'IPython.nbconvert.filters' : ['marked.js'],
187 'IPython.nbconvert.filters' : ['marked.js'],
168 'IPython.nbformat' : ['tests/*.ipynb']
188 'IPython.nbformat' : ['tests/*.ipynb']
169 }
189 }
190
191 # verify that package_data makes sense
192 for pkg, data in package_data.items():
193 pkg_root = pjoin(*pkg.split('.'))
194 for d in data:
195 path = pjoin(pkg_root, d)
196 if '*' in path:
197 assert len(glob(path)) > 0, "No files match pattern %s" % path
198 else:
199 assert os.path.exists(path), "Missing package data: %s" % path
200
170 return package_data
201 return package_data
171
202
172
203
@@ -215,10 +246,9 b' def find_data_files():'
215 """
246 """
216 Find IPython's data_files.
247 Find IPython's data_files.
217
248
218 Most of these are docs.
249 Just man pages at this point.
219 """
250 """
220
251
221 docdirbase = pjoin('share', 'doc', 'ipython')
222 manpagebase = pjoin('share', 'man', 'man1')
252 manpagebase = pjoin('share', 'man', 'man1')
223
253
224 # Simple file lists can be made by hand
254 # Simple file lists can be made by hand
@@ -227,24 +257,8 b' def find_data_files():'
227 # When running from a source tree, the manpages aren't gzipped
257 # When running from a source tree, the manpages aren't gzipped
228 manpages = [f for f in glob(pjoin('docs','man','*.1')) if isfile(f)]
258 manpages = [f for f in glob(pjoin('docs','man','*.1')) if isfile(f)]
229
259
230 igridhelpfiles = [f for f in glob(pjoin('IPython','extensions','igrid_help.*')) if isfile(f)]
231
232 # For nested structures, use the utility above
233 example_files = make_dir_struct(
234 'data',
235 pjoin('docs','examples'),
236 pjoin(docdirbase,'examples')
237 )
238 manual_files = make_dir_struct(
239 'data',
240 pjoin('docs','html'),
241 pjoin(docdirbase,'manual')
242 )
243
244 # And assemble the entire output list
260 # And assemble the entire output list
245 data_files = [ (manpagebase, manpages),
261 data_files = [ (manpagebase, manpages) ]
246 (pjoin(docdirbase, 'extensions'), igridhelpfiles),
247 ] + manual_files + example_files
248
262
249 return data_files
263 return data_files
250
264
@@ -452,7 +466,8 b' def check_for_dependencies():'
452 check_for_sphinx()
466 check_for_sphinx()
453 check_for_pygments()
467 check_for_pygments()
454 check_for_nose()
468 check_for_nose()
455 check_for_pexpect()
469 if os.name == 'posix':
470 check_for_pexpect()
456 check_for_pyzmq()
471 check_for_pyzmq()
457 check_for_tornado()
472 check_for_tornado()
458 check_for_readline()
473 check_for_readline()
@@ -556,6 +571,70 b' def require_submodules(command):'
556 return DecoratedCommand
571 return DecoratedCommand
557
572
558 #---------------------------------------------------------------------------
573 #---------------------------------------------------------------------------
574 # bdist related
575 #---------------------------------------------------------------------------
576
577 def get_bdist_wheel():
578 """Construct bdist_wheel command for building wheels
579
580 Constructs py2-none-any tag, instead of py2.7-none-any
581 """
582 class RequiresWheel(Command):
583 description = "Dummy command for missing bdist_wheel"
584 user_options = []
585
586 def initialize_options(self):
587 pass
588
589 def finalize_options(self):
590 pass
591
592 def run(self):
593 print("bdist_wheel requires the wheel package")
594 sys.exit(1)
595
596 if 'setuptools' not in sys.modules:
597 return RequiresWheel
598 else:
599 try:
600 from wheel.bdist_wheel import bdist_wheel, read_pkg_info, write_pkg_info
601 except ImportError:
602 return RequiresWheel
603
604 class bdist_wheel_tag(bdist_wheel):
605
606 def get_tag(self):
607 return ('py%i' % sys.version_info[0], 'none', 'any')
608
609 def add_requirements(self, metadata_path):
610 """transform platform-dependent requirements"""
611 pkg_info = read_pkg_info(metadata_path)
612 # pkg_info is an email.Message object (?!)
613 # we have to remove the unconditional 'readline' and/or 'pyreadline' entries
614 # and transform them to conditionals
615 requires = pkg_info.get_all('Requires-Dist')
616 del pkg_info['Requires-Dist']
617 def _remove_startswith(lis, prefix):
618 """like list.remove, but with startswith instead of =="""
619 found = False
620 for idx, item in enumerate(lis):
621 if item.startswith(prefix):
622 found = True
623 break
624 if found:
625 lis.pop(idx)
626
627 for pkg in ("readline", "pyreadline"):
628 _remove_startswith(requires, pkg)
629 requires.append("readline; sys.platform == 'darwin'")
630 requires.append("pyreadline (>=2.0); sys.platform == 'win32'")
631 for r in requires:
632 pkg_info['Requires-Dist'] = r
633 write_pkg_info(metadata_path, pkg_info)
634
635 return bdist_wheel_tag
636
637 #---------------------------------------------------------------------------
559 # Notebook related
638 # Notebook related
560 #---------------------------------------------------------------------------
639 #---------------------------------------------------------------------------
561
640
@@ -107,7 +107,7 b' def check_for_pexpect():'
107 try:
107 try:
108 import pexpect
108 import pexpect
109 except ImportError:
109 except ImportError:
110 print_status("pexpect", "no (required for running standalone doctests)")
110 print_status("pexpect", "no (will use bundled version in IPython.external)")
111 return False
111 return False
112 else:
112 else:
113 print_status("pexpect", pexpect.__version__)
113 print_status("pexpect", pexpect.__version__)
General Comments 0
You need to be logged in to leave comments. Login now