Update to 7.20.0 and fix tests with Python 3.10.0a4
This commit is contained in:
parent
8ec6955e3e
commit
b7e3bf371c
14
ipython.spec
14
ipython.spec
@ -13,8 +13,8 @@
|
||||
%endif
|
||||
|
||||
Name: ipython
|
||||
Version: 7.19.0
|
||||
Release: 2%{?dist}
|
||||
Version: 7.20.0
|
||||
Release: 1%{?dist}
|
||||
Summary: An enhanced interactive Python shell
|
||||
|
||||
# See bug #603178 for a quick overview for the choice of licenses
|
||||
@ -24,6 +24,10 @@ License: (BSD and MIT and Python) and GPLv2+
|
||||
URL: http://ipython.org/
|
||||
Source0: %pypi_source
|
||||
|
||||
# Fix tests for Python 3.10
|
||||
# Proposed upstream: https://github.com/ipython/ipython/pull/12759
|
||||
Patch0: py310.patch
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: make
|
||||
BuildRequires: python3-devel
|
||||
@ -264,6 +268,12 @@ rm -r %{buildroot}%{python3_sitelib}/IPython/*/tests
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Feb 02 2021 Lumír Balhar <lbalhar@redhat.com> - 7.20.0-1
|
||||
- Fix tests with Python 3.10.0a4
|
||||
Resolves: rhbz#1901141
|
||||
- Update to 7.20.0
|
||||
Resolves: rhbz#1923782
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 7.19.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
|
||||
164
py310.patch
Normal file
164
py310.patch
Normal file
@ -0,0 +1,164 @@
|
||||
From 3987f6d04b6eb737d03ba4b05ef6638fea3d7e00 Mon Sep 17 00:00:00 2001
|
||||
From: Lumir Balhar <lbalhar@redhat.com>
|
||||
Date: Thu, 7 Jan 2021 14:41:11 +0100
|
||||
Subject: [PATCH 1/3] Update test_oinspect for postponed evaulation of
|
||||
annotations
|
||||
|
||||
Newer Pythons stores annotations as strings and evaluate them later.
|
||||
---
|
||||
IPython/core/tests/test_oinspect.py | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/IPython/core/tests/test_oinspect.py b/IPython/core/tests/test_oinspect.py
|
||||
index 19c6db7c4..edb3a7aac 100644
|
||||
--- a/IPython/core/tests/test_oinspect.py
|
||||
+++ b/IPython/core/tests/test_oinspect.py
|
||||
@@ -421,6 +421,14 @@ def long_function(
|
||||
long_function.__name__,
|
||||
)
|
||||
nt.assert_in(sig, [
|
||||
+ # Python >=3.10 with delayed annotations evaulation
|
||||
+ '''\
|
||||
+long_function(
|
||||
+ a_really_long_parameter: 'int',
|
||||
+ and_another_long_one: 'bool' = False,
|
||||
+ let_us_make_sure_this_is_looong: 'Optional[str]' = None,
|
||||
+) -> 'bool'\
|
||||
+''',
|
||||
# Python >=3.9
|
||||
'''\
|
||||
long_function(
|
||||
--
|
||||
2.29.2
|
||||
|
||||
From d0934ea03e8bf47de4614ddb214b55e3b397b970 Mon Sep 17 00:00:00 2001
|
||||
From: Lumir Balhar <lbalhar@redhat.com>
|
||||
Date: Thu, 7 Jan 2021 14:42:34 +0100
|
||||
Subject: [PATCH 2/3] Update test_magic_arguments for new argparse module
|
||||
|
||||
New argparse module uses "options" instead "optional arguments".
|
||||
|
||||
https://github.com/python/cpython/commit/41b223d29cdfeb1f222c12c3abaccc3bc128f5e7
|
||||
---
|
||||
IPython/core/tests/test_magic_arguments.py | 15 +++++++++------
|
||||
1 file changed, 9 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/IPython/core/tests/test_magic_arguments.py b/IPython/core/tests/test_magic_arguments.py
|
||||
index 5dea32dd8..ae3fa26a6 100644
|
||||
--- a/IPython/core/tests/test_magic_arguments.py
|
||||
+++ b/IPython/core/tests/test_magic_arguments.py
|
||||
@@ -7,6 +7,7 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
import argparse
|
||||
+import sys
|
||||
from nose.tools import assert_equal
|
||||
|
||||
from IPython.core.magic_arguments import (argument, argument_group, kwds,
|
||||
@@ -74,7 +75,9 @@ def foo(self, args):
|
||||
|
||||
|
||||
def test_magic_arguments():
|
||||
- assert_equal(magic_foo1.__doc__, '::\n\n %foo1 [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n')
|
||||
+ optional = "optional arguments:" if sys.version_info < (3, 10, 0) else "options:"
|
||||
+
|
||||
+ assert_equal(magic_foo1.__doc__, f'::\n\n %foo1 [-f FOO]\n\n A docstring.\n\n{optional}\n -f FOO, --foo FOO an argument\n')
|
||||
assert_equal(getattr(magic_foo1, 'argcmd_name', None), None)
|
||||
assert_equal(real_name(magic_foo1), 'foo1')
|
||||
assert_equal(magic_foo1(None, ''), argparse.Namespace(foo=None))
|
||||
@@ -86,32 +89,32 @@ def test_magic_arguments():
|
||||
assert_equal(magic_foo2(None, ''), argparse.Namespace())
|
||||
assert hasattr(magic_foo2, 'has_arguments')
|
||||
|
||||
- assert_equal(magic_foo3.__doc__, '::\n\n %foo3 [-f FOO] [-b BAR] [-z BAZ]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n\nGroup:\n -b BAR, --bar BAR a grouped argument\n\nSecond Group:\n -z BAZ, --baz BAZ another grouped argument\n')
|
||||
+ assert_equal(magic_foo3.__doc__, f'::\n\n %foo3 [-f FOO] [-b BAR] [-z BAZ]\n\n A docstring.\n\n{optional}\n -f FOO, --foo FOO an argument\n\nGroup:\n -b BAR, --bar BAR a grouped argument\n\nSecond Group:\n -z BAZ, --baz BAZ another grouped argument\n')
|
||||
assert_equal(getattr(magic_foo3, 'argcmd_name', None), None)
|
||||
assert_equal(real_name(magic_foo3), 'foo3')
|
||||
assert_equal(magic_foo3(None, ''),
|
||||
argparse.Namespace(bar=None, baz=None, foo=None))
|
||||
assert hasattr(magic_foo3, 'has_arguments')
|
||||
|
||||
- assert_equal(magic_foo4.__doc__, '::\n\n %foo4 [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n')
|
||||
+ assert_equal(magic_foo4.__doc__, f'::\n\n %foo4 [-f FOO]\n\n A docstring.\n\n{optional}\n -f FOO, --foo FOO an argument\n')
|
||||
assert_equal(getattr(magic_foo4, 'argcmd_name', None), None)
|
||||
assert_equal(real_name(magic_foo4), 'foo4')
|
||||
assert_equal(magic_foo4(None, ''), argparse.Namespace())
|
||||
assert hasattr(magic_foo4, 'has_arguments')
|
||||
|
||||
- assert_equal(magic_foo5.__doc__, '::\n\n %frobnicate [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n')
|
||||
+ assert_equal(magic_foo5.__doc__, f'::\n\n %frobnicate [-f FOO]\n\n A docstring.\n\n{optional}\n -f FOO, --foo FOO an argument\n')
|
||||
assert_equal(getattr(magic_foo5, 'argcmd_name', None), 'frobnicate')
|
||||
assert_equal(real_name(magic_foo5), 'frobnicate')
|
||||
assert_equal(magic_foo5(None, ''), argparse.Namespace(foo=None))
|
||||
assert hasattr(magic_foo5, 'has_arguments')
|
||||
|
||||
- assert_equal(magic_magic_foo.__doc__, '::\n\n %magic_foo [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n')
|
||||
+ assert_equal(magic_magic_foo.__doc__, f'::\n\n %magic_foo [-f FOO]\n\n A docstring.\n\n{optional}\n -f FOO, --foo FOO an argument\n')
|
||||
assert_equal(getattr(magic_magic_foo, 'argcmd_name', None), None)
|
||||
assert_equal(real_name(magic_magic_foo), 'magic_foo')
|
||||
assert_equal(magic_magic_foo(None, ''), argparse.Namespace(foo=None))
|
||||
assert hasattr(magic_magic_foo, 'has_arguments')
|
||||
|
||||
- assert_equal(foo.__doc__, '::\n\n %foo [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n')
|
||||
+ assert_equal(foo.__doc__, f'::\n\n %foo [-f FOO]\n\n A docstring.\n\n{optional}\n -f FOO, --foo FOO an argument\n')
|
||||
assert_equal(getattr(foo, 'argcmd_name', None), None)
|
||||
assert_equal(real_name(foo), 'foo')
|
||||
assert_equal(foo(None, ''), argparse.Namespace(foo=None))
|
||||
--
|
||||
2.29.2
|
||||
|
||||
From 098823bbf70c55d2de1e05811307a92da1142f8c Mon Sep 17 00:00:00 2001
|
||||
From: Lumir Balhar <lbalhar@redhat.com>
|
||||
Date: Thu, 7 Jan 2021 14:43:46 +0100
|
||||
Subject: [PATCH 3/3] xxlimited module is xxlimited_35 in Python 3.10
|
||||
|
||||
---
|
||||
IPython/lib/tests/test_pretty.py | 13 +++++++++----
|
||||
1 file changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/IPython/lib/tests/test_pretty.py b/IPython/lib/tests/test_pretty.py
|
||||
index ba4c32966..9cba39adf 100644
|
||||
--- a/IPython/lib/tests/test_pretty.py
|
||||
+++ b/IPython/lib/tests/test_pretty.py
|
||||
@@ -6,15 +6,16 @@
|
||||
|
||||
|
||||
from collections import Counter, defaultdict, deque, OrderedDict
|
||||
+from importlib import import_module
|
||||
import os
|
||||
import types
|
||||
import string
|
||||
+import sys
|
||||
import unittest
|
||||
|
||||
import nose.tools as nt
|
||||
|
||||
from IPython.lib import pretty
|
||||
-from IPython.testing.decorators import skip_without
|
||||
|
||||
from io import StringIO
|
||||
|
||||
@@ -118,13 +119,17 @@ def test_sets():
|
||||
yield nt.assert_equal, got_output, expected_output
|
||||
|
||||
|
||||
-@skip_without('xxlimited')
|
||||
def test_pprint_heap_allocated_type():
|
||||
"""
|
||||
Test that pprint works for heap allocated types.
|
||||
"""
|
||||
- import xxlimited
|
||||
- output = pretty.pretty(xxlimited.Null)
|
||||
+ module_name = "xxlimited" if sys.version_info < (3, 10, 0) else "xxlimited_35"
|
||||
+ try:
|
||||
+ module = import_module(module_name)
|
||||
+ except ImportError:
|
||||
+ pytest.skip(f"Module {module_name} is not available.")
|
||||
+
|
||||
+ output = pretty.pretty(getattr(module, "Null"))
|
||||
nt.assert_equal(output, 'xxlimited.Null')
|
||||
|
||||
def test_pprint_nomod():
|
||||
--
|
||||
2.29.2
|
||||
|
||||
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (ipython-7.19.0.tar.gz) = 5350a125da3050acaea4899939a3b9d779009a2f5769fc9f3aa514ce029df050069ef9310d3255ad62f28912b4dec39207267248d3a2c3e9131cffd691322622
|
||||
SHA512 (ipython-7.20.0.tar.gz) = 2fff1a64c3d83e794e76bcbdf54e105f499321d9a7e5d3221cdc3e15a96e90543fd465b8dbee4836965286e7c1f1ea6d13e4d3d88c095164858bf71c161111fe
|
||||
|
||||
Loading…
Reference in New Issue
Block a user