##// END OF EJS Templates
MAINT: remove support and testing on Python 3.8...
Matthias Bussonnier -
Show More
@@ -19,12 +19,12 b' jobs:'
19 fail-fast: false
19 fail-fast: false
20 matrix:
20 matrix:
21 os: [ubuntu-latest, windows-latest]
21 os: [ubuntu-latest, windows-latest]
22 python-version: ["3.8", "3.9", "3.10", "3.11"]
22 python-version: ["3.9", "3.10", "3.11"]
23 deps: [test_extra]
23 deps: [test_extra]
24 # Test all on ubuntu, test ends on macos
24 # Test all on ubuntu, test ends on macos
25 include:
25 include:
26 - os: macos-latest
26 - os: macos-latest
27 python-version: "3.8"
27 python-version: "3.9"
28 deps: test_extra
28 deps: test_extra
29 - os: macos-latest
29 - os: macos-latest
30 python-version: "3.11"
30 python-version: "3.11"
@@ -39,13 +39,13 b' jobs:'
39 deps: test
39 deps: test
40 # Installing optional dependencies stuff takes ages on PyPy
40 # Installing optional dependencies stuff takes ages on PyPy
41 - os: ubuntu-latest
41 - os: ubuntu-latest
42 python-version: "pypy-3.8"
42 python-version: "pypy-3.9"
43 deps: test
43 deps: test
44 - os: windows-latest
44 - os: windows-latest
45 python-version: "pypy-3.8"
45 python-version: "pypy-3.9"
46 deps: test
46 deps: test
47 - os: macos-latest
47 - os: macos-latest
48 python-version: "pypy-3.8"
48 python-version: "pypy-3.9"
49 deps: test
49 deps: test
50
50
51 steps:
51 steps:
@@ -26,10 +26,11 b' import sys'
26 #-----------------------------------------------------------------------------
26 #-----------------------------------------------------------------------------
27
27
28 # Don't forget to also update setup.py when this changes!
28 # Don't forget to also update setup.py when this changes!
29 if sys.version_info < (3, 8):
29 if sys.version_info < (3, 9):
30 raise ImportError(
30 raise ImportError(
31 """
31 """
32 IPython 8+ supports Python 3.8 and above, following NEP 29.
32 IPython 8.13+ supports Python 3.9 and above, following NEP 29.
33 IPython 8.0-8.12 supports Python 3.8 and above, following NEP 29.
33 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
34 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
34 Python 3.3 and 3.4 were supported up to IPython 6.x.
35 Python 3.3 and 3.4 were supported up to IPython 6.x.
35 Python 3.5 was supported with IPython 7.0 to 7.9.
36 Python 3.5 was supported with IPython 7.0 to 7.9.
@@ -508,9 +508,6 b' def eval_node(node: Union[ast.AST, None], context: EvaluationContext):'
508 return all_true
508 return all_true
509 if isinstance(node, ast.Constant):
509 if isinstance(node, ast.Constant):
510 return node.value
510 return node.value
511 if isinstance(node, ast.Index):
512 # deprecated since Python 3.9
513 return eval_node(node.value, context) # pragma: no cover
514 if isinstance(node, ast.Tuple):
511 if isinstance(node, ast.Tuple):
515 return tuple(eval_node(e, context) for e in node.elts)
512 return tuple(eval_node(e, context) for e in node.elts)
516 if isinstance(node, ast.List):
513 if isinstance(node, ast.List):
@@ -530,9 +527,6 b' def eval_node(node: Union[ast.AST, None], context: EvaluationContext):'
530 eval_node(node.upper, context),
527 eval_node(node.upper, context),
531 eval_node(node.step, context),
528 eval_node(node.step, context),
532 )
529 )
533 if isinstance(node, ast.ExtSlice):
534 # deprecated since Python 3.9
535 return tuple([eval_node(dim, context) for dim in node.dims]) # pragma: no cover
536 if isinstance(node, ast.UnaryOp):
530 if isinstance(node, ast.UnaryOp):
537 value = eval_node(node.operand, context)
531 value = eval_node(node.operand, context)
538 dunders = _find_dunder(node.op, UNARY_OP_DUNDERS)
532 dunders = _find_dunder(node.op, UNARY_OP_DUNDERS)
@@ -276,12 +276,12 b' class AsyncTest(TestCase):'
276 """
276 """
277 )
277 )
278
278
279 if sys.version_info < (3, 9) and platform.python_implementation() != "PyPy":
279 def test_memory_error(self):
280 # new pgen parser in 3.9 does not raise MemoryError on too many nested
280 """
281 # parens anymore
281 The pgen parser in 3.8 or before use to raise MemoryError on too many
282 def test_memory_error(self):
282 nested parens anymore"""
283 with self.assertRaises(MemoryError):
283
284 iprc("(" * 200 + ")" * 200)
284 iprc("(" * 200 + ")" * 200)
285
285
286 @skip_without('curio')
286 @skip_without('curio')
287 def test_autoawait_curio(self):
287 def test_autoawait_curio(self):
@@ -713,12 +713,10 b' class TestModules(tt.TempFileMixin):'
713 class Negator(ast.NodeTransformer):
713 class Negator(ast.NodeTransformer):
714 """Negates all number literals in an AST."""
714 """Negates all number literals in an AST."""
715
715
716 # for python 3.7 and earlier
717 def visit_Num(self, node):
716 def visit_Num(self, node):
718 node.n = -node.n
717 node.n = -node.n
719 return node
718 return node
720
719
721 # for python 3.8+
722 def visit_Constant(self, node):
720 def visit_Constant(self, node):
723 if isinstance(node.value, int):
721 if isinstance(node.value, int):
724 return self.visit_Num(node)
722 return self.visit_Num(node)
@@ -900,7 +898,6 b' class StringRejector(ast.NodeTransformer):'
900 not be executed by throwing an InputRejected.
898 not be executed by throwing an InputRejected.
901 """
899 """
902
900
903 # 3.8 only
904 def visit_Constant(self, node):
901 def visit_Constant(self, node):
905 if isinstance(node.value, str):
902 if isinstance(node.value, str):
906 raise InputRejected("test")
903 raise InputRejected("test")
@@ -166,93 +166,48 b' def doctest_tb_sysexit():'
166 """
166 """
167
167
168
168
169 if sys.version_info >= (3, 9):
169 if SV_VERSION < (0, 6):
170 if SV_VERSION < (0, 6):
170
171
171 def doctest_tb_sysexit_verbose_stack_data_05():
172 def doctest_tb_sysexit_verbose_stack_data_05():
172 """
173 """
173 In [18]: %run simpleerr.py exit
174 In [18]: %run simpleerr.py exit
174 An exception has occurred, use %tb to see the full traceback.
175 An exception has occurred, use %tb to see the full traceback.
175 SystemExit: (1, 'Mode = exit')
176 SystemExit: (1, 'Mode = exit')
176
177
177 In [19]: %run simpleerr.py exit 2
178 In [19]: %run simpleerr.py exit 2
178 An exception has occurred, use %tb to see the full traceback.
179 An exception has occurred, use %tb to see the full traceback.
179 SystemExit: (2, 'Mode = exit')
180 SystemExit: (2, 'Mode = exit')
180
181
181 In [23]: %xmode verbose
182 In [23]: %xmode verbose
182 Exception reporting mode: Verbose
183 Exception reporting mode: Verbose
183
184
184 In [24]: %tb
185 In [24]: %tb
185 ---------------------------------------------------------------------------
186 ---------------------------------------------------------------------------
186 SystemExit Traceback (most recent call last)
187 SystemExit Traceback (most recent call last)
187 <BLANKLINE>
188 <BLANKLINE>
188 ...
189 ...
189 30 except IndexError:
190 30 except IndexError:
190 31 mode = 'div'
191 31 mode = 'div'
191 ---> 33 bar(mode)
192 ---> 33 bar(mode)
192 mode = 'exit'
193 mode = 'exit'
193 <BLANKLINE>
194 <BLANKLINE>
194 ... in bar(mode='exit')
195 ... in bar(mode='exit')
195 ... except:
196 ... except:
196 ... stat = 1
197 ... stat = 1
197 ---> ... sysexit(stat, mode)
198 ---> ... sysexit(stat, mode)
198 mode = 'exit'
199 mode = 'exit'
199 stat = 2
200 stat = 2
200 ... else:
201 ... else:
201 ... raise ValueError('Unknown mode')
202 ... raise ValueError('Unknown mode')
202 <BLANKLINE>
203 <BLANKLINE>
203 ... in sysexit(stat=2, mode='exit')
204 ... in sysexit(stat=2, mode='exit')
204 10 def sysexit(stat, mode):
205 10 def sysexit(stat, mode):
205 ---> 11 raise SystemExit(stat, f"Mode = {mode}")
206 ---> 11 raise SystemExit(stat, f"Mode = {mode}")
206 stat = 2
207 stat = 2
207 <BLANKLINE>
208 <BLANKLINE>
208 SystemExit: (2, 'Mode = exit')
209 SystemExit: (2, 'Mode = exit')
209 """
210 """
210
211
212 else:
213 # currently the only difference is
214 # + mode = 'exit'
215
216 def doctest_tb_sysexit_verbose_stack_data_06():
217 """
218 In [18]: %run simpleerr.py exit
219 An exception has occurred, use %tb to see the full traceback.
220 SystemExit: (1, 'Mode = exit')
221
222 In [19]: %run simpleerr.py exit 2
223 An exception has occurred, use %tb to see the full traceback.
224 SystemExit: (2, 'Mode = exit')
225
226 In [23]: %xmode verbose
227 Exception reporting mode: Verbose
228
229 In [24]: %tb
230 ---------------------------------------------------------------------------
231 SystemExit Traceback (most recent call last)
232 <BLANKLINE>
233 ...
234 30 except IndexError:
235 31 mode = 'div'
236 ---> 33 bar(mode)
237 mode = 'exit'
238 <BLANKLINE>
239 ... in bar(mode='exit')
240 ... except:
241 ... stat = 1
242 ---> ... sysexit(stat, mode)
243 mode = 'exit'
244 stat = 2
245 ... else:
246 ... raise ValueError('Unknown mode')
247 <BLANKLINE>
248 ... in sysexit(stat=2, mode='exit')
249 10 def sysexit(stat, mode):
250 ---> 11 raise SystemExit(stat, f"Mode = {mode}")
251 stat = 2
252 mode = 'exit'
253 <BLANKLINE>
254 SystemExit: (2, 'Mode = exit')
255 """
256
211
257 def test_run_cell():
212 def test_run_cell():
258 import textwrap
213 import textwrap
@@ -568,20 +568,12 b' def test_render_signature_long():'
568 signature(long_function),
568 signature(long_function),
569 long_function.__name__,
569 long_function.__name__,
570 )
570 )
571 if sys.version_info >= (3, 9):
571 expected = """\
572 expected = """\
573 long_function(
572 long_function(
574 a_really_long_parameter: int,
573 a_really_long_parameter: int,
575 and_another_long_one: bool = False,
574 and_another_long_one: bool = False,
576 let_us_make_sure_this_is_looong: Optional[str] = None,
575 let_us_make_sure_this_is_looong: Optional[str] = None,
577 ) -> bool\
576 ) -> bool\
578 """
577 """
579 else:
578
580 expected = """\
581 long_function(
582 a_really_long_parameter: int,
583 and_another_long_one: bool = False,
584 let_us_make_sure_this_is_looong: Union[str, NoneType] = None,
585 ) -> bool\
586 """
587 assert sig == expected
579 assert sig == expected
@@ -244,15 +244,14 b' bar()'
244
244
245 import sys
245 import sys
246
246
247 if sys.version_info < (3, 9) and platform.python_implementation() != "PyPy":
247 if platform.python_implementation() != "PyPy":
248 """
248 """
249 New 3.9 Pgen Parser does not raise Memory error, except on failed malloc.
249 New 3.9 Pgen Parser does not raise Memory error, except on failed malloc.
250 """
250 """
251 class MemoryErrorTest(unittest.TestCase):
251 class MemoryErrorTest(unittest.TestCase):
252 def test_memoryerror(self):
252 def test_memoryerror(self):
253 memoryerror_code = "(" * 200 + ")" * 200
253 memoryerror_code = "(" * 200 + ")" * 200
254 with tt.AssertPrints("MemoryError"):
254 ip.run_cell(memoryerror_code)
255 ip.run_cell(memoryerror_code)
256
255
257
256
258 class Python3ChainedExceptionsTest(unittest.TestCase):
257 class Python3ChainedExceptionsTest(unittest.TestCase):
@@ -8,8 +8,8 b' environment:'
8 COLUMNS: 120 # Appveyor web viewer window width is 130 chars
8 COLUMNS: 120 # Appveyor web viewer window width is 130 chars
9
9
10 matrix:
10 matrix:
11 - PYTHON: "C:\\Python38"
11 - PYTHON: "C:\\Python39"
12 PYTHON_VERSION: "3.8.x"
12 PYTHON_VERSION: "3.9.x"
13 PYTHON_ARCH: "32"
13 PYTHON_ARCH: "32"
14
14
15 init:
15 init:
@@ -2,7 +2,7 b''
2 requires = ["setuptools >= 51.0.0"]
2 requires = ["setuptools >= 51.0.0"]
3 build-backend = "setuptools.build_meta"
3 build-backend = "setuptools.build_meta"
4 [tool.mypy]
4 [tool.mypy]
5 python_version = 3.8
5 python_version = 3.9
6 ignore_missing_imports = true
6 ignore_missing_imports = true
7 follow_imports = 'silent'
7 follow_imports = 'silent'
8 exclude = [
8 exclude = [
@@ -23,7 +23,7 b' import sys'
23 #
23 #
24 # This check is also made in IPython/__init__, don't forget to update both when
24 # This check is also made in IPython/__init__, don't forget to update both when
25 # changing Python version requirements.
25 # changing Python version requirements.
26 if sys.version_info < (3, 8):
26 if sys.version_info < (3, 9):
27 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
27 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
28 try:
28 try:
29 import pip
29 import pip
@@ -39,7 +39,8 b' if sys.version_info < (3, 8):'
39
39
40
40
41 error = """
41 error = """
42 IPython 8+ supports Python 3.8 and above, following NEP 29.
42 IPython 8.13+ supports Python 3.8 and above, following NEP 29.
43 IPython 8.0-8.12 supports Python 3.8 and above, following NEP 29.
43 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
44 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
44 Python 3.3 and 3.4 were supported up to IPython 6.x.
45 Python 3.3 and 3.4 were supported up to IPython 6.x.
45 Python 3.5 was supported with IPython 7.0 to 7.9.
46 Python 3.5 was supported with IPython 7.0 to 7.9.
General Comments 0
You need to be logged in to leave comments. Login now