##// END OF EJS Templates
Merge pull request #4002 from takluyver/drop-26-32...
Thomas Kluyver -
r12193:ed74e939 merge
parent child Browse files
Show More
@@ -1,13 +1,10 b''
1 1 # http://travis-ci.org/#!/ipython/ipython
2 2 language: python
3 3 python:
4 - 2.6
5 4 - 2.7
6 - 3.2
7 5 - 3.3
8 6 before_install:
9 - "if [[ $TRAVIS_PYTHON_VERSION == '3.2'* ]]; then pip install -Iv https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.6.tar.gz; fi"
10 - "if [[ ! $TRAVIS_PYTHON_VERSION == '3.2'* ]]; then pip install jinja2; fi"
7 - pip install jinja2
11 8 - easy_install -q pyzmq
12 9 - sudo apt-get install pandoc
13 10 - pip install pygments
@@ -115,10 +115,7 b' class LevelFormatter(logging.Formatter):'
115 115 record.highlevel = self.highlevel_format % record.__dict__
116 116 else:
117 117 record.highlevel = ""
118 if sys.version_info[:2] > (2,6):
119 return super(LevelFormatter, self).format(record)
120 else:
121 return logging.Formatter.format(self, record)
118 return super(LevelFormatter, self).format(record)
122 119
123 120
124 121 class Application(SingletonConfigurable):
@@ -287,7 +287,6 b' class InteractiveRunner(object):'
287 287
288 288 self.run_file(args[0],opts.interact)
289 289
290 _ipython_cmd = "ipython3" if py3compat.PY3 else "ipython"
291 290
292 291 # Specific runners for particular programs
293 292 class IPythonRunner(InteractiveRunner):
@@ -303,15 +302,20 b' class IPythonRunner(InteractiveRunner):'
303 302 prompts would break this.
304 303 """
305 304
306 def __init__(self,program = _ipython_cmd, args=None, out=sys.stdout, echo=True):
305 def __init__(self, program='<ipython>', args=None, out=sys.stdout, echo=True):
307 306 """New runner, optionally passing the ipython command to use."""
308 307 args0 = ['--colors=NoColor',
309 308 '--no-term-title',
310 309 '--no-autoindent',
311 310 # '--quick' is important, to prevent loading default config:
312 311 '--quick']
313 if args is None: args = args0
314 else: args = args0 + args
312 args = args0 + (args or [])
313
314 # Special case to launch IPython with current interpreter
315 if program == '<ipython>':
316 program = sys.executable
317 args = ['-m', 'IPython'] + args
318
315 319 prompts = [r'In \[\d+\]: ',r' \.*: ']
316 320 InteractiveRunner.__init__(self,program,prompts,args,out,echo)
317 321
@@ -31,15 +31,6 b' from IPython.parallel import error'
31 31 # Functions
32 32 #-----------------------------------------------------------------------------
33 33
34 def _total_seconds(td):
35 """timedelta.total_seconds was added in 2.7"""
36 try:
37 # Python >= 2.7
38 return td.total_seconds()
39 except AttributeError:
40 # Python 2.6
41 return 1e-6 * (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6)
42
43 34 def _raw_text(s):
44 35 display_pretty(s, raw=True)
45 36
@@ -338,7 +329,7 b' class AsyncResult(object):'
338 329 # handle single_result AsyncResults, where ar.stamp is single object,
339 330 # not a list
340 331 end = end_key(end)
341 return _total_seconds(end - start)
332 return (end - start).total_seconds()
342 333
343 334 @property
344 335 def progress(self):
@@ -361,7 +352,7 b' class AsyncResult(object):'
361 352 stamp = self._client.metadata[msg_id]['submitted']
362 353 if stamp and stamp < submitted:
363 354 submitted = stamp
364 return _total_seconds(now-submitted)
355 return (now-submitted).total_seconds()
365 356
366 357 @property
367 358 @check_ready
@@ -372,7 +363,7 b' class AsyncResult(object):'
372 363 """
373 364 t = 0
374 365 for md in self._metadata:
375 t += _total_seconds(md['completed'] - md['started'])
366 t += (md['completed'] - md['started']).total_seconds()
376 367 return t
377 368
378 369 @property
@@ -25,11 +25,6 b' import base64'
25 25
26 26 from Queue import Empty
27 27
28 try:
29 from contextlib import nested
30 except:
31 from IPython.utils.nested_context import nested
32
33 28 from IPython.core import page
34 29 from IPython.utils.warn import warn, error
35 30 from IPython.utils import io
@@ -303,8 +298,8 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):'
303 298 raw = base64.decodestring(data[mime].encode('ascii'))
304 299 imageformat = self._imagemime[mime]
305 300 filename = 'tmp.{0}'.format(imageformat)
306 with nested(NamedFileInTemporaryDirectory(filename),
307 open(os.devnull, 'w')) as (f, devnull):
301 with NamedFileInTemporaryDirectory(filename) as f, \
302 open(os.devnull, 'w') as devnull:
308 303 f.write(raw)
309 304 f.flush()
310 305 fmt = dict(file=f.name, format=imageformat)
@@ -27,13 +27,6 b' from __future__ import with_statement'
27 27 import sys
28 28 import warnings
29 29
30 # We need to use nested to support python 2.6, once we move to >=2.7, we can
31 # use the with keyword's new builtin support for nested managers
32 try:
33 from contextlib import nested
34 except:
35 from IPython.utils.nested_context import nested
36
37 30 from IPython.core import ultratb, compilerop
38 31 from IPython.core.magic import Magics, magics_class, line_magic
39 32 from IPython.terminal.interactiveshell import TerminalInteractiveShell
@@ -251,7 +244,7 b' class InteractiveShellEmbed(TerminalInteractiveShell):'
251 244 # actually completes using the frame's locals/globals
252 245 self.set_completer_frame()
253 246
254 with nested(self.builtin_trap, self.display_trap):
247 with self.builtin_trap, self.display_trap:
255 248 self.interact(display_banner=display_banner)
256 249
257 250 # now, purge out the local namespace of IPython's hidden variables.
@@ -19,13 +19,6 b' import bdb'
19 19 import os
20 20 import sys
21 21
22 # We need to use nested to support python 2.6, once we move to >=2.7, we can
23 # use the with keyword's new builtin support for nested managers
24 try:
25 from contextlib import nested
26 except:
27 from IPython.utils.nested_context import nested
28
29 22 from IPython.core.error import TryNext, UsageError
30 23 from IPython.core.usage import interactive_usage, default_banner
31 24 from IPython.core.inputsplitter import IPythonInputSplitter
@@ -429,7 +422,7 b' class TerminalInteractiveShell(InteractiveShell):'
429 422 internally created default banner.
430 423 """
431 424
432 with nested(self.builtin_trap, self.display_trap):
425 with self.builtin_trap, self.display_trap:
433 426
434 427 while 1:
435 428 try:
@@ -43,10 +43,6 b' import warnings'
43 43 # is slow and we need it for our parametric tests to work correctly.
44 44 from IPython.testing import nosepatch
45 45
46 # Monkeypatch extra assert methods into nose.tools if they're not already there.
47 # This can be dropped once we no longer test on Python 2.6
48 from IPython.testing import nose_assert_methods
49
50 46 # Now, proceed to import nose itself
51 47 import nose.plugins.builtin
52 48 from nose.plugins.xunit import Xunit
@@ -165,11 +165,7 b' def get_ipython_cmd(as_string=False):'
165 165 as_string: bool
166 166 Flag to allow to return the command as a string.
167 167 """
168 # FIXME: remove workaround for 2.6 support
169 if sys.version_info[:2] > (2,6):
170 ipython_cmd = [sys.executable, "-m", "IPython"]
171 else:
172 ipython_cmd = ["ipython"]
168 ipython_cmd = [sys.executable, "-m", "IPython"]
173 169
174 170 if as_string:
175 171 ipython_cmd = " ".join(ipython_cmd)
@@ -1,8 +1,8 b''
1 IPython requires Python 2.6, 2.7, or ≥ 3.2.
1 IPython requires Python 2.7 or ≥ 3.3.
2 2
3 3 .. note::
4 4
5 If you need to use Python 2.5, you can find an old version (≤0.10) of IPython
5 If you need to use Python 2.6 or 3.2, you can find IPython 1.0
6 6 `here <http://archive.ipython.org/release/>`__.
7 7
8 8 Quickstart
@@ -273,10 +273,9 b' for parallel computing.'
273 273 Portability and Python requirements
274 274 -----------------------------------
275 275
276 As of the 1.0 release, IPython works with Python 2.6, 2.7, 3.2 and 3.3.
277 Version 0.12 introduced full support for Python 3. Version 0.11 worked with
278 Python 2.6 and 2.7 only. Versions 0.9 and 0.10 worked with Python 2.4 and
279 above (not including Python 3).
276 As of the 2.0 release, IPython works with Python 2.7 and 3.3 or above.
277 Version 1.0 additionally worked with Python 2.6 and 3.2.
278 Version 0.12 was the first version to fully support Python 3.
280 279
281 280 IPython is known to work on the following operating systems:
282 281
@@ -8,3 +8,5 b' This document describes in-flight development work.'
8 8 Backwards incompatible changes
9 9 ------------------------------
10 10
11 * Python 2.6 and 3.2 are no longer supported: the minimum required
12 Python versions are now 2.7 and 3.3.
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now