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