2020-02-24 18:58:04 +01:00
|
|
|
#
|
2024-03-07 14:40:24 +01:00
|
|
|
# spec file for package python-nbclient
|
2020-02-24 18:58:04 +01:00
|
|
|
#
|
2024-03-07 14:40:24 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2020-02-24 18:58:04 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2021-04-01 12:21:32 +02:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
2024-03-07 14:40:24 +01:00
|
|
|
%define skip_python39 1
|
2021-04-01 12:21:32 +02:00
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
2021-11-19 12:51:34 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%bcond_without libalternatives
|
|
|
|
%else
|
|
|
|
%bcond_with libalternatives
|
|
|
|
%endif
|
2023-01-08 21:25:51 +01:00
|
|
|
|
2021-04-09 11:23:59 +02:00
|
|
|
Name: python-nbclient%{psuffix}
|
2023-11-26 17:25:08 +01:00
|
|
|
Version: 0.9.0
|
2020-02-24 18:58:04 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: A client library for executing notebooks
|
|
|
|
License: BSD-3-Clause
|
|
|
|
URL: https://github.com/jupyter/nbclient
|
|
|
|
Source: https://files.pythonhosted.org/packages/source/n/nbclient/nbclient-%{version}.tar.gz
|
2023-06-11 22:02:03 +02:00
|
|
|
BuildRequires: %{python_module base >= 3.8}
|
2023-01-08 21:25:51 +01:00
|
|
|
BuildRequires: %{python_module hatchling >= 1.10.0}
|
|
|
|
BuildRequires: %{python_module pip}
|
2020-02-24 18:58:04 +01:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2023-01-08 21:25:51 +01:00
|
|
|
Requires: python-jupyter-client >= 6.1.12
|
|
|
|
Requires: python-nbformat >= 5.1
|
2023-06-11 22:02:03 +02:00
|
|
|
Requires: python-traitlets >= 5.4
|
2023-01-08 21:25:51 +01:00
|
|
|
Requires: ((python-jupyter-core >= 4.12 with python-jupyter-core < 5) or python-jupyter-core >= 5.1)
|
2022-02-18 11:15:25 +01:00
|
|
|
BuildArch: noarch
|
2021-11-19 12:51:34 +01:00
|
|
|
%if %{with libalternatives}
|
|
|
|
BuildRequires: alts
|
2022-02-18 11:15:25 +01:00
|
|
|
Requires: alts
|
2021-11-19 12:51:34 +01:00
|
|
|
%else
|
2021-11-14 15:08:14 +01:00
|
|
|
Requires(post): update-alternatives
|
2024-03-07 14:40:24 +01:00
|
|
|
Requires(postun): update-alternatives
|
2021-11-19 12:51:34 +01:00
|
|
|
%endif
|
2021-04-01 12:21:32 +02:00
|
|
|
%if %{with test}
|
2023-04-23 22:23:41 +02:00
|
|
|
BuildRequires: %{python_module flaky}
|
2023-06-11 22:02:03 +02:00
|
|
|
BuildRequires: %{python_module ipykernel >= 6.19.3}
|
2022-06-05 19:14:41 +02:00
|
|
|
BuildRequires: %{python_module ipython}
|
|
|
|
BuildRequires: %{python_module ipywidgets}
|
2022-01-15 20:33:25 +01:00
|
|
|
BuildRequires: %{python_module nbclient = %{version}}
|
2023-01-08 21:25:51 +01:00
|
|
|
BuildRequires: %{python_module nbconvert >= 7}
|
|
|
|
BuildRequires: %{python_module pytest >= 7}
|
2022-02-28 11:00:45 +01:00
|
|
|
BuildRequires: %{python_module pytest-asyncio}
|
2022-06-05 19:14:41 +02:00
|
|
|
BuildRequires: %{python_module testpath}
|
2020-02-24 18:58:04 +01:00
|
|
|
BuildRequires: %{python_module xmltodict}
|
2021-04-01 12:21:32 +02:00
|
|
|
%endif
|
2020-02-24 18:58:04 +01:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
A client library for executing notebooks. Formally nbconvert's
|
|
|
|
ExecutePreprocessor.
|
|
|
|
|
|
|
|
NBClient is a tool for parameterizing andexecuting Jupyter Notebooks.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n nbclient-%{version}
|
2023-11-26 17:25:08 +01:00
|
|
|
sed -i 's/, "--color=yes"//' pyproject.toml
|
2020-02-24 18:58:04 +01:00
|
|
|
|
2023-01-08 21:25:51 +01:00
|
|
|
%if ! %{with test}
|
2020-02-24 18:58:04 +01:00
|
|
|
%build
|
2023-01-08 21:25:51 +01:00
|
|
|
%pyproject_wheel
|
2020-02-24 18:58:04 +01:00
|
|
|
|
|
|
|
%install
|
2023-01-08 21:25:51 +01:00
|
|
|
%pyproject_install
|
2021-11-14 15:08:14 +01:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/jupyter-execute
|
2020-02-24 18:58:04 +01:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2021-04-01 12:21:32 +02:00
|
|
|
%endif
|
2020-02-24 18:58:04 +01:00
|
|
|
|
2021-04-01 12:21:32 +02:00
|
|
|
%if %{with test}
|
2020-02-24 18:58:04 +01:00
|
|
|
%check
|
2021-09-22 16:57:58 +02:00
|
|
|
export IPYKERNEL_CELL_NAME="<IPY-INPUT>"
|
2021-11-21 18:30:59 +01:00
|
|
|
# tests on parallel notebooks randomly fail (4 tests) - https://github.com/jupyter/nbclient/pull/74#issuecomment-635929953
|
2022-01-17 20:51:38 +01:00
|
|
|
donttest="parallel_notebooks"
|
|
|
|
# https://github.com/jupyter/nbclient/issues/189
|
2022-02-28 11:18:17 +01:00
|
|
|
donttest+=" or (test_run_all_notebooks and (opts6 or opts8 or opts9))"
|
2022-01-17 20:51:38 +01:00
|
|
|
# extra -v for more verbose error diffs
|
2023-01-08 21:25:51 +01:00
|
|
|
%pytest -v -k "not ($donttest)"
|
2021-04-01 12:21:32 +02:00
|
|
|
%endif
|
2020-02-24 18:58:04 +01:00
|
|
|
|
2021-04-01 12:21:32 +02:00
|
|
|
%if ! %{with test}
|
2021-11-19 12:51:34 +01:00
|
|
|
%pre
|
|
|
|
%python_libalternatives_reset_alternative jupyter-execute
|
|
|
|
|
2021-11-14 15:08:14 +01:00
|
|
|
%post
|
|
|
|
%python_install_alternative jupyter-execute
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative jupyter-execute
|
|
|
|
|
2020-02-24 18:58:04 +01:00
|
|
|
%files %{python_files}
|
2023-01-08 21:25:51 +01:00
|
|
|
%doc README.md
|
2020-02-24 18:58:04 +01:00
|
|
|
%license LICENSE
|
2021-11-14 15:08:14 +01:00
|
|
|
%python_alternative %{_bindir}/jupyter-execute
|
2020-05-24 09:52:13 +02:00
|
|
|
%{python_sitelib}/nbclient
|
2023-01-08 21:25:51 +01:00
|
|
|
%{python_sitelib}/nbclient-%{version}.dist-info/
|
2021-04-01 12:21:32 +02:00
|
|
|
%endif
|
2020-02-24 18:58:04 +01:00
|
|
|
|
|
|
|
%changelog
|