From 138ab35c4c61e5ac7e8f069ed9d45a79d7940bea74bd07aab31a774525d3b2a5 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Thu, 23 May 2024 05:21:58 +0000 Subject: [PATCH 1/3] - Update to 8.24.0: * Improve inference from return type annotations in completer and the introduction of the optional target ipython[matplotlib] to explicitly request the matplotlib optional dependencies. * Move of the matplotlib backend handling from IPython to matplotlib. * pytest 8 compatibility. * typing-extension now needs 4.6 or newer. It was already the case, but not explicated. * Attempt to speed running code under debugger in some cases. - Add patch support-pytest-8.1.patch: * Support pytest >= 8.1 with the pytest plugin. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-ipython?expand=0&rev=129 --- ipython-8.22.2.tar.gz | 3 - ipython-8.24.0.tar.gz | 3 + python-ipython.changes | 15 +++++ python-ipython.spec | 11 ++-- support-pytest-8.1.patch | 125 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 150 insertions(+), 7 deletions(-) delete mode 100644 ipython-8.22.2.tar.gz create mode 100644 ipython-8.24.0.tar.gz create mode 100644 support-pytest-8.1.patch diff --git a/ipython-8.22.2.tar.gz b/ipython-8.22.2.tar.gz deleted file mode 100644 index dd6cff4..0000000 --- a/ipython-8.22.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2dcaad9049f9056f1fef63514f176c7d41f930daa78d05b82a176202818f2c14 -size 5490399 diff --git a/ipython-8.24.0.tar.gz b/ipython-8.24.0.tar.gz new file mode 100644 index 0000000..b597344 --- /dev/null +++ b/ipython-8.24.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:010db3f8a728a578bb641fdd06c063b9fb8e96a9464c63aec6310fbcb5e80501 +size 5491819 diff --git a/python-ipython.changes b/python-ipython.changes index 4119602..24628c5 100644 --- a/python-ipython.changes +++ b/python-ipython.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Thu May 23 05:20:42 UTC 2024 - Steve Kowalik + +- Update to 8.24.0: + * Improve inference from return type annotations in completer and the + introduction of the optional target ipython[matplotlib] to explicitly + request the matplotlib optional dependencies. + * Move of the matplotlib backend handling from IPython to matplotlib. + * pytest 8 compatibility. + * typing-extension now needs 4.6 or newer. It was already the case, but + not explicated. + * Attempt to speed running code under debugger in some cases. +- Add patch support-pytest-8.1.patch: + * Support pytest >= 8.1 with the pytest plugin. + ------------------------------------------------------------------- Fri Mar 29 17:16:13 UTC 2024 - Ben Greiner diff --git a/python-ipython.spec b/python-ipython.spec index 2dec30e..03ee870 100644 --- a/python-ipython.spec +++ b/python-ipython.spec @@ -35,14 +35,15 @@ %define skip_python39 1 %{?sle15_python_module_pythons} Name: python-ipython%{psuffix} -Version: 8.22.2 +Version: 8.24.0 Release: 0 Summary: Rich architecture for interactive computing with Python License: BSD-3-Clause -Group: Development/Languages/Python URL: https://github.com/ipython/ipython Source: https://files.pythonhosted.org/packages/source/i/ipython/ipython-%{version}.tar.gz Source1: https://raw.githubusercontent.com/jupyter/qtconsole/4.0.0/qtconsole/resources/icon/JupyterConsole.svg +# PATCH-FIX-UPSTREAM gh#ipython/ipython#14441 +Patch0: support-pytest-8.1.patch BuildRequires: %{python_module base >= 3.10} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 61.2} @@ -63,6 +64,9 @@ Requires: (python-prompt_toolkit >= 3.0.41 with python-prompt_toolkit < 3. %if %{python_version_nodots} < 311 Requires: python-exceptiongroup %endif +%if %{python_version_nodots} < 312 +Requires: python-typing_extensions >= 4.6 +%endif Recommends: jupyter Recommends: python-ipykernel Recommends: python-ipyparallel @@ -85,12 +89,11 @@ Obsoletes: python-jupyter_ipython-doc-pdf < %{version} BuildArch: noarch %if %{with test} BuildRequires: %{python_module ipython = %{version}} -BuildRequires: %{python_module matplotlib} BuildRequires: %{python_module numpy >= 1.23} BuildRequires: %{python_module pandas} BuildRequires: %{python_module pickleshare} -BuildRequires: %{python_module pytest < 8} BuildRequires: %{python_module pytest-asyncio} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module testpath} BuildRequires: %{python_module trio} %endif diff --git a/support-pytest-8.1.patch b/support-pytest-8.1.patch new file mode 100644 index 0000000..db51227 --- /dev/null +++ b/support-pytest-8.1.patch @@ -0,0 +1,125 @@ +From 7df70a3cd79068be6f98596e427d60a5d0cfe5b3 Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +Date: Thu, 23 May 2024 13:00:43 +1000 +Subject: [PATCH] Support pytest 8.1+ changes in pytest plugin + +Pytest 8.1 has also changed the plugin API, as well as required new +keyword arguments. I've shifted the pytest version calculation to the +module level so we can use it everywhere, and continue supporting all +versions of pytest that we can. + +Fixes #14390 +--- + IPython/testing/plugin/pytest_ipdoctest.py | 36 ++++++++++++++++------ + 1 file changed, 26 insertions(+), 10 deletions(-) + +diff --git a/IPython/testing/plugin/pytest_ipdoctest.py b/IPython/testing/plugin/pytest_ipdoctest.py +index fc8af13b579..40a3ae92b40 100644 +--- a/IPython/testing/plugin/pytest_ipdoctest.py ++++ b/IPython/testing/plugin/pytest_ipdoctest.py +@@ -38,7 +38,11 @@ + from _pytest.compat import safe_getattr + from _pytest.config import Config + from _pytest.config.argparsing import Parser +-from _pytest.fixtures import FixtureRequest ++ ++try: ++ from _pytest.fixtures import TopRequest as FixtureRequest ++except ImportError: ++ from _pytest.fixtures import FixtureRequest + from _pytest.nodes import Collector + from _pytest.outcomes import OutcomeException + from _pytest.pathlib import fnmatch_ex, import_path +@@ -69,6 +73,8 @@ + # Lazy definition of output checker class + CHECKER_CLASS: Optional[Type["IPDoctestOutputChecker"]] = None + ++pytest_version = tuple([int(part) for part in pytest.__version__.split(".")]) ++ + + def pytest_addoption(parser: Parser) -> None: + parser.addini( +@@ -143,7 +149,7 @@ def pytest_collect_file( + return None + + +-if int(pytest.__version__.split(".")[0]) < 7: ++if pytest_version[0] < 7: + _collect_file = pytest_collect_file + + def pytest_collect_file( +@@ -448,7 +454,7 @@ def reportinfo(self) -> Tuple[Union["os.PathLike[str]", str], Optional[int], str + assert self.dtest is not None + return self.path, self.dtest.lineno, "[ipdoctest] %s" % self.name + +- if int(pytest.__version__.split(".")[0]) < 7: ++ if pytest_version[0] < 7: + + @property + def path(self) -> Path: +@@ -521,7 +527,7 @@ def collect(self) -> Iterable[IPDoctestItem]: + self, name=test.name, runner=runner, dtest=test + ) + +- if int(pytest.__version__.split(".")[0]) < 7: ++ if pytest_version[0] < 7: + + @property + def path(self) -> Path: +@@ -636,20 +642,26 @@ def _find( + ) + + if self.path.name == "conftest.py": +- if int(pytest.__version__.split(".")[0]) < 7: ++ if pytest_version[0] < 7: + module = self.config.pluginmanager._importconftest( + self.path, + self.config.getoption("importmode"), + ) + else: ++ kwargs = {"rootpath": self.config.rootpath} ++ if pytest_version >= (8, 1): ++ kwargs["consider_namespace_packages"] = False + module = self.config.pluginmanager._importconftest( + self.path, + self.config.getoption("importmode"), +- rootpath=self.config.rootpath, ++ **kwargs, + ) + else: + try: +- module = import_path(self.path, root=self.config.rootpath) ++ kwargs = {"root": self.config.rootpath} ++ if pytest_version >= (8, 1): ++ kwargs["consider_namespace_packages"] = False ++ module = import_path(self.path, **kwargs) + except ImportError: + if self.config.getvalue("ipdoctest_ignore_import_errors"): + pytest.skip("unable to import module %r" % self.path) +@@ -671,7 +683,7 @@ def _find( + self, name=test.name, runner=runner, dtest=test + ) + +- if int(pytest.__version__.split(".")[0]) < 7: ++ if pytest_version[0] < 7: + + @property + def path(self) -> Path: +@@ -701,11 +713,15 @@ def func() -> None: + + doctest_item.funcargs = {} # type: ignore[attr-defined] + fm = doctest_item.session._fixturemanager ++ kwargs = {"node": doctest_item, "func": func, "cls": None} ++ if pytest_version <= (8, 0): ++ kwargs["funcargs"] = False + doctest_item._fixtureinfo = fm.getfixtureinfo( # type: ignore[attr-defined] +- node=doctest_item, func=func, cls=None, funcargs=False ++ **kwargs + ) + fixture_request = FixtureRequest(doctest_item, _ispytest=True) +- fixture_request._fillfixtures() ++ if pytest_version <= (8, 0): ++ fixture_request._fillfixtures() + return fixture_request + + From bc4553d9e58adac5ea1000c753afcffd2d24b41598abaee69ba08aa53b85939b Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 4 Jun 2024 03:20:23 +0000 Subject: [PATCH 2/3] - Update to 8.25.0: * Rplaces the unicode micro symbol with greek letter mu, visually identical but should fix nfkc normalisations issues. * Introduces intersphinx_registry as a new dependency which is recommended only to build documentation. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-ipython?expand=0&rev=130 --- ipython-8.24.0.tar.gz | 3 - ipython-8.25.0.tar.gz | 3 + python-ipython.changes | 10 ++-- python-ipython.spec | 4 +- support-pytest-8.1.patch | 125 --------------------------------------- 5 files changed, 10 insertions(+), 135 deletions(-) delete mode 100644 ipython-8.24.0.tar.gz create mode 100644 ipython-8.25.0.tar.gz delete mode 100644 support-pytest-8.1.patch diff --git a/ipython-8.24.0.tar.gz b/ipython-8.24.0.tar.gz deleted file mode 100644 index b597344..0000000 --- a/ipython-8.24.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:010db3f8a728a578bb641fdd06c063b9fb8e96a9464c63aec6310fbcb5e80501 -size 5491819 diff --git a/ipython-8.25.0.tar.gz b/ipython-8.25.0.tar.gz new file mode 100644 index 0000000..c321882 --- /dev/null +++ b/ipython-8.25.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6ed726a140b6e725b911528f80439c534fac915246af3efc39440a6b0f9d716 +size 5492936 diff --git a/python-ipython.changes b/python-ipython.changes index 24628c5..85b21a4 100644 --- a/python-ipython.changes +++ b/python-ipython.changes @@ -1,7 +1,11 @@ ------------------------------------------------------------------- -Thu May 23 05:20:42 UTC 2024 - Steve Kowalik +Tue Jun 4 03:19:44 UTC 2024 - Steve Kowalik -- Update to 8.24.0: +- Update to 8.25.0: + * Rplaces the unicode micro symbol with greek letter mu, visually + identical but should fix nfkc normalisations issues. + * Introduces intersphinx_registry as a new dependency which is recommended + only to build documentation. * Improve inference from return type annotations in completer and the introduction of the optional target ipython[matplotlib] to explicitly request the matplotlib optional dependencies. @@ -10,8 +14,6 @@ Thu May 23 05:20:42 UTC 2024 - Steve Kowalik * typing-extension now needs 4.6 or newer. It was already the case, but not explicated. * Attempt to speed running code under debugger in some cases. -- Add patch support-pytest-8.1.patch: - * Support pytest >= 8.1 with the pytest plugin. ------------------------------------------------------------------- Fri Mar 29 17:16:13 UTC 2024 - Ben Greiner diff --git a/python-ipython.spec b/python-ipython.spec index 03ee870..a62c13e 100644 --- a/python-ipython.spec +++ b/python-ipython.spec @@ -35,15 +35,13 @@ %define skip_python39 1 %{?sle15_python_module_pythons} Name: python-ipython%{psuffix} -Version: 8.24.0 +Version: 8.25.0 Release: 0 Summary: Rich architecture for interactive computing with Python License: BSD-3-Clause URL: https://github.com/ipython/ipython Source: https://files.pythonhosted.org/packages/source/i/ipython/ipython-%{version}.tar.gz Source1: https://raw.githubusercontent.com/jupyter/qtconsole/4.0.0/qtconsole/resources/icon/JupyterConsole.svg -# PATCH-FIX-UPSTREAM gh#ipython/ipython#14441 -Patch0: support-pytest-8.1.patch BuildRequires: %{python_module base >= 3.10} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 61.2} diff --git a/support-pytest-8.1.patch b/support-pytest-8.1.patch deleted file mode 100644 index db51227..0000000 --- a/support-pytest-8.1.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 7df70a3cd79068be6f98596e427d60a5d0cfe5b3 Mon Sep 17 00:00:00 2001 -From: Steve Kowalik -Date: Thu, 23 May 2024 13:00:43 +1000 -Subject: [PATCH] Support pytest 8.1+ changes in pytest plugin - -Pytest 8.1 has also changed the plugin API, as well as required new -keyword arguments. I've shifted the pytest version calculation to the -module level so we can use it everywhere, and continue supporting all -versions of pytest that we can. - -Fixes #14390 ---- - IPython/testing/plugin/pytest_ipdoctest.py | 36 ++++++++++++++++------ - 1 file changed, 26 insertions(+), 10 deletions(-) - -diff --git a/IPython/testing/plugin/pytest_ipdoctest.py b/IPython/testing/plugin/pytest_ipdoctest.py -index fc8af13b579..40a3ae92b40 100644 ---- a/IPython/testing/plugin/pytest_ipdoctest.py -+++ b/IPython/testing/plugin/pytest_ipdoctest.py -@@ -38,7 +38,11 @@ - from _pytest.compat import safe_getattr - from _pytest.config import Config - from _pytest.config.argparsing import Parser --from _pytest.fixtures import FixtureRequest -+ -+try: -+ from _pytest.fixtures import TopRequest as FixtureRequest -+except ImportError: -+ from _pytest.fixtures import FixtureRequest - from _pytest.nodes import Collector - from _pytest.outcomes import OutcomeException - from _pytest.pathlib import fnmatch_ex, import_path -@@ -69,6 +73,8 @@ - # Lazy definition of output checker class - CHECKER_CLASS: Optional[Type["IPDoctestOutputChecker"]] = None - -+pytest_version = tuple([int(part) for part in pytest.__version__.split(".")]) -+ - - def pytest_addoption(parser: Parser) -> None: - parser.addini( -@@ -143,7 +149,7 @@ def pytest_collect_file( - return None - - --if int(pytest.__version__.split(".")[0]) < 7: -+if pytest_version[0] < 7: - _collect_file = pytest_collect_file - - def pytest_collect_file( -@@ -448,7 +454,7 @@ def reportinfo(self) -> Tuple[Union["os.PathLike[str]", str], Optional[int], str - assert self.dtest is not None - return self.path, self.dtest.lineno, "[ipdoctest] %s" % self.name - -- if int(pytest.__version__.split(".")[0]) < 7: -+ if pytest_version[0] < 7: - - @property - def path(self) -> Path: -@@ -521,7 +527,7 @@ def collect(self) -> Iterable[IPDoctestItem]: - self, name=test.name, runner=runner, dtest=test - ) - -- if int(pytest.__version__.split(".")[0]) < 7: -+ if pytest_version[0] < 7: - - @property - def path(self) -> Path: -@@ -636,20 +642,26 @@ def _find( - ) - - if self.path.name == "conftest.py": -- if int(pytest.__version__.split(".")[0]) < 7: -+ if pytest_version[0] < 7: - module = self.config.pluginmanager._importconftest( - self.path, - self.config.getoption("importmode"), - ) - else: -+ kwargs = {"rootpath": self.config.rootpath} -+ if pytest_version >= (8, 1): -+ kwargs["consider_namespace_packages"] = False - module = self.config.pluginmanager._importconftest( - self.path, - self.config.getoption("importmode"), -- rootpath=self.config.rootpath, -+ **kwargs, - ) - else: - try: -- module = import_path(self.path, root=self.config.rootpath) -+ kwargs = {"root": self.config.rootpath} -+ if pytest_version >= (8, 1): -+ kwargs["consider_namespace_packages"] = False -+ module = import_path(self.path, **kwargs) - except ImportError: - if self.config.getvalue("ipdoctest_ignore_import_errors"): - pytest.skip("unable to import module %r" % self.path) -@@ -671,7 +683,7 @@ def _find( - self, name=test.name, runner=runner, dtest=test - ) - -- if int(pytest.__version__.split(".")[0]) < 7: -+ if pytest_version[0] < 7: - - @property - def path(self) -> Path: -@@ -701,11 +713,15 @@ def func() -> None: - - doctest_item.funcargs = {} # type: ignore[attr-defined] - fm = doctest_item.session._fixturemanager -+ kwargs = {"node": doctest_item, "func": func, "cls": None} -+ if pytest_version <= (8, 0): -+ kwargs["funcargs"] = False - doctest_item._fixtureinfo = fm.getfixtureinfo( # type: ignore[attr-defined] -- node=doctest_item, func=func, cls=None, funcargs=False -+ **kwargs - ) - fixture_request = FixtureRequest(doctest_item, _ispytest=True) -- fixture_request._fillfixtures() -+ if pytest_version <= (8, 0): -+ fixture_request._fillfixtures() - return fixture_request - - From 8901c812b71b7a50a8efc44137917086e015379d0dd72fdbf4a877be01b372d4 Mon Sep 17 00:00:00 2001 From: Benjamin Greiner Date: Tue, 4 Jun 2024 06:55:58 +0000 Subject: [PATCH 3/3] Accepting request 1178447 from home:bnavigator:branches:devel:languages:python:jupyter - Reenable testing matplotlib OBS-URL: https://build.opensuse.org/request/show/1178447 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-ipython?expand=0&rev=131 --- python-ipython.changes | 5 +++++ python-ipython.spec | 1 + 2 files changed, 6 insertions(+) diff --git a/python-ipython.changes b/python-ipython.changes index 85b21a4..9f0377d 100644 --- a/python-ipython.changes +++ b/python-ipython.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jun 4 06:55:22 UTC 2024 - Ben Greiner + +- Reenable testing matplotlib + ------------------------------------------------------------------- Tue Jun 4 03:19:44 UTC 2024 - Steve Kowalik diff --git a/python-ipython.spec b/python-ipython.spec index a62c13e..97b0654 100644 --- a/python-ipython.spec +++ b/python-ipython.spec @@ -87,6 +87,7 @@ Obsoletes: python-jupyter_ipython-doc-pdf < %{version} BuildArch: noarch %if %{with test} BuildRequires: %{python_module ipython = %{version}} +BuildRequires: %{python_module matplotlib} BuildRequires: %{python_module numpy >= 1.23} BuildRequires: %{python_module pandas} BuildRequires: %{python_module pickleshare}