From da68a4c89914bd4dbfc9bba093c6e14331ecc4ffc48a57618c553de792cec331 Mon Sep 17 00:00:00 2001 From: Benjamin Greiner Date: Wed, 4 Feb 2026 15:00:59 +0000 Subject: [PATCH] - Revert multibuild and fix kernel selection in tests OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-ipykernel?expand=0&rev=124 --- _multibuild | 6 ------ python-ipykernel.changes | 5 +++++ python-ipykernel.spec | 45 ++++++++++------------------------------ 3 files changed, 16 insertions(+), 40 deletions(-) delete mode 100644 _multibuild diff --git a/_multibuild b/_multibuild deleted file mode 100644 index 55ed970..0000000 --- a/_multibuild +++ /dev/null @@ -1,6 +0,0 @@ - - test-py311 - test-py312 - test-py313 - test-py314 - diff --git a/python-ipykernel.changes b/python-ipykernel.changes index a24c99f..ac5f2a5 100644 --- a/python-ipykernel.changes +++ b/python-ipykernel.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Feb 4 13:57:06 UTC 2026 - Ben Greiner + +- Revert multibuild and fix kernel selection in tests + ------------------------------------------------------------------- Mon Feb 2 13:38:42 UTC 2026 - Markéta Machová diff --git a/python-ipykernel.spec b/python-ipykernel.spec index 13acca9..0bf3b50 100644 --- a/python-ipykernel.spec +++ b/python-ipykernel.spec @@ -16,32 +16,6 @@ # -%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 @@ -98,10 +72,8 @@ 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} @@ -109,7 +81,6 @@ 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} @@ -142,7 +113,6 @@ $python -m ipykernel install \ %endif %check -%if %{with test} # fails in obs setups ignoretests="--ignore tests/test_debugger.py" # flaky obs timeouts @@ -150,10 +120,18 @@ donttest="test_init_ipc_socket" # we don't want ipyparallel and its dependencies in Ring1 ignoretests="$ignoretests --ignore tests/test_pickleutil.py" donttest="$donttest or test_do_apply" -%pytest -k "not ($donttest)" $ignoretests -%endif +%{python_expand # +export PYTHONPATH=%{buildroot}%{$python_sitelib} +# install single kernelspecs for each flavor, so that it is taken by default +mkdir testjupyter-{$python_bin_suffix} +export JUPYTER_DATA_DIR=$PWD/testjupyter-%{$python_bin_suffix} +$python -m ipykernel install \ + --prefix=$JUPYTER_DATA_DIR \ + --name python%{$python_bin_suffix} \ + --display-name 'Python %{$python_bin_suffix} (ipykernel)' +$python -m pytest -v -k "not ($donttest)" $ignoretests +} -%if !%{with test} %files %{python_files} %doc README.md %license LICENSE @@ -165,6 +143,5 @@ donttest="$donttest or test_do_apply" %if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" || 0%{?suse_version} < 1600 %{_jupyter_kernel_dir}/python3 %endif -%endif %changelog