From f8015f7151ddc4e4cb54cd839e26f43956b6fdc80f1ed04f9f7e49779d085ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 2 Feb 2026 13:58:57 +0000 Subject: [PATCH] - Convert to multibuild with separate flavor testing to fix the issue with jupyter kernel detection OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-ipykernel?expand=0&rev=123 --- _multibuild | 6 ++++++ python-ipykernel.changes | 6 ++++++ python-ipykernel.spec | 37 ++++++++++++++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..55ed970 --- /dev/null +++ b/_multibuild @@ -0,0 +1,6 @@ + + test-py311 + test-py312 + test-py313 + test-py314 + diff --git a/python-ipykernel.changes b/python-ipykernel.changes index 55424bf..a24c99f 100644 --- a/python-ipykernel.changes +++ b/python-ipykernel.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Feb 2 13:38:42 UTC 2026 - Markéta Machová + +- Convert to multibuild with separate flavor testing to fix the issue + with jupyter kernel detection + ------------------------------------------------------------------- Mon Oct 20 15:11:47 UTC 2025 - Markéta Machová diff --git a/python-ipykernel.spec b/python-ipykernel.spec index e15a9cd..13acca9 100644 --- a/python-ipykernel.spec +++ b/python-ipykernel.spec @@ -1,7 +1,7 @@ # # spec file for package python-ipykernel # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,32 @@ # +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "" +%define psuffix %{nil} +%bcond_with test +%else +# we are unable to set the correct jupyter kernel file, hence the flavored tests need to be run in separate environments +%bcond_without test +%define psuffix -%{flavor} +%if "%{flavor}" != "test-py311" +%define skip_python311 1 +%endif +%if "%{flavor}" != "test-py312" +%define skip_python312 1 +%endif +%if "%{flavor}" != "test-py313" +%define skip_python313 1 +%endif +%if "%{flavor}" != "test-py314" +%define skip_python314 1 +%endif +%endif +# The obs server-side interpreter cannot use lua or rpm shrink +%if "%pythons" == "" || "%pythons" == " " || "%pythons" == " " || "%pythons" == " " || "%pythons" == " " || ( "%pythons" == "python311" && 0%{?skip_python311} ) +ExclusiveArch: donotbuild +%define python_module() %flavor-not-enabled-in-buildset-for-suse-%{?suse_version} +%endif %{?sle15_python_module_pythons} Name: python-ipykernel Version: 6.31.0 @@ -72,8 +98,10 @@ Requires: python-tornado >= 6.2 Requires: python-traitlets >= 5.4.0 Requires: (python-jupyter-core >= 5.1 or (python-jupyter-core >= 4.12 with python-jupyter-core < 5.0)) # /SECTION +%if %{with test} # SECTION test requirements BuildRequires: %{python_module flaky} +BuildRequires: %{python_module ipykernel = %{version}} BuildRequires: %{python_module matplotlib} BuildRequires: %{python_module pytest >= 7.0} BuildRequires: %{python_module pytest-asyncio >= 0.23.5} @@ -81,6 +109,7 @@ BuildRequires: %{python_module pytest-timeout} # we don't want ipyparallel and its dependencies in Ring1, see below #BuildRequires: #{python_module ipyparallel} # /SECTION +%endif %if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" Provides: jupyter-ipykernel = %{version}-%{release} Obsoletes: jupyter-ipykernel < %{version}-%{release} @@ -98,6 +127,7 @@ sed -i -e 's/, "--color=yes"//' pyproject.toml %pyproject_wheel %install +%if !%{with test} %pyproject_install %{python_expand # install kernelspecs for each flavor @@ -109,8 +139,10 @@ $python -m ipykernel install \ } %python_expand %fdupes %{buildroot}%{$python_sitelib} %fdupes %{buildroot}%{_jupyter_kernel_dir} +%endif %check +%if %{with test} # fails in obs setups ignoretests="--ignore tests/test_debugger.py" # flaky obs timeouts @@ -119,7 +151,9 @@ donttest="test_init_ipc_socket" ignoretests="$ignoretests --ignore tests/test_pickleutil.py" donttest="$donttest or test_do_apply" %pytest -k "not ($donttest)" $ignoretests +%endif +%if !%{with test} %files %{python_files} %doc README.md %license LICENSE @@ -131,5 +165,6 @@ donttest="$donttest or test_do_apply" %if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" || 0%{?suse_version} < 1600 %{_jupyter_kernel_dir}/python3 %endif +%endif %changelog