2021-02-03 13:35:36 +01:00
|
|
|
#
|
2022-08-02 23:24:37 +02:00
|
|
|
# spec file
|
2021-02-03 13:35:36 +01:00
|
|
|
#
|
2023-02-12 18:10:54 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2021-02-03 13:35:36 +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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2022-08-02 23:24:37 +02:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
2021-10-27 13:52:16 +02:00
|
|
|
%else
|
2022-08-02 23:24:37 +02:00
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
2021-10-27 13:52:16 +02:00
|
|
|
%endif
|
2022-08-02 23:24:37 +02:00
|
|
|
# this conditional is used in the python-rpm-macros, but `osc build --without libalternatives` won't work
|
|
|
|
%bcond_without libalternatives
|
|
|
|
Name: python-nbclassic%{psuffix}
|
2023-04-23 22:33:14 +02:00
|
|
|
Version: 0.5.5
|
2021-02-03 13:35:36 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Jupyter Notebook as a Jupyter Server Extension
|
|
|
|
License: BSD-3-Clause
|
|
|
|
URL: https://github.com/jupyterlab/nbclassic
|
2022-08-02 23:24:37 +02:00
|
|
|
# The github archive has the nbclassic tests
|
|
|
|
Source0: https://github.com/jupyterlab/nbclassic/archive/v%{version}.tar.gz#/nbclassic-%{version}-gh.tar.gz
|
|
|
|
# The wheel has the notebook 6 JS stuff
|
|
|
|
Source1: https://files.pythonhosted.org/packages/py3/n/nbclassic/nbclassic-%{version}-py3-none-any.whl
|
|
|
|
BuildRequires: %{python_module base >= 3.7}
|
|
|
|
BuildRequires: %{python_module pip}
|
2021-02-03 13:35:36 +01:00
|
|
|
BuildRequires: fdupes
|
2022-08-02 23:24:37 +02:00
|
|
|
BuildRequires: hicolor-icon-theme
|
2022-06-05 20:31:11 +02:00
|
|
|
BuildRequires: jupyter-rpm-macros
|
2021-10-27 13:52:16 +02:00
|
|
|
BuildRequires: python-rpm-macros >= 20210929
|
2022-08-02 23:24:37 +02:00
|
|
|
BuildRequires: update-desktop-files
|
2021-02-03 13:35:36 +01:00
|
|
|
Requires: jupyter-nbclassic = %{version}
|
2022-08-02 23:24:37 +02:00
|
|
|
Requires: python-Jinja2
|
|
|
|
Requires: python-Send2Trash >= 1.8.0
|
|
|
|
Requires: python-argon2-cffi
|
|
|
|
Requires: python-ipykernel
|
|
|
|
Requires: python-ipython_genutils
|
|
|
|
Requires: python-jupyter-client >= 6.1.1
|
|
|
|
Requires: python-jupyter-core >= 4.6.1
|
|
|
|
Requires: python-nbconvert >= 5
|
|
|
|
Requires: python-nbformat
|
|
|
|
Requires: python-nest-asyncio >= 1.5
|
|
|
|
Requires: python-notebook-shim >= 0.1.0
|
|
|
|
Requires: python-prometheus-client
|
|
|
|
Requires: python-pyzmq >= 17
|
|
|
|
Requires: python-terminado >= 0.8.3
|
|
|
|
Requires: python-tornado >= 6.1
|
|
|
|
Requires: python-traitlets >= 4.2.1
|
2022-10-01 10:03:24 +02:00
|
|
|
BuildArch: noarch
|
2021-10-27 13:52:16 +02:00
|
|
|
%if %{with libalternatives}
|
|
|
|
BuildRequires: alts
|
2022-02-18 05:01:41 +01:00
|
|
|
Requires: alts
|
2021-10-27 13:52:16 +02:00
|
|
|
%else
|
2022-08-02 23:24:37 +02:00
|
|
|
BuildRequires: this-specfile-is-not-functional-without-libalternatives
|
2021-10-27 13:52:16 +02:00
|
|
|
%endif
|
2022-08-02 23:24:37 +02:00
|
|
|
%if %{with test}
|
|
|
|
BuildRequires: %{python_module nbclassic = %{version}}
|
2021-02-03 13:35:36 +01:00
|
|
|
BuildRequires: %{python_module pytest-console-scripts}
|
2022-12-31 14:05:20 +01:00
|
|
|
BuildRequires: %{python_module pytest-jupyter}
|
2021-02-03 13:35:36 +01:00
|
|
|
BuildRequires: %{python_module pytest-tornasync}
|
|
|
|
BuildRequires: %{python_module pytest}
|
2022-08-02 23:24:37 +02:00
|
|
|
%endif
|
2021-02-03 13:35:36 +01:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
NBClassic runs the Jupyter Notebook frontend on the Jupyter Server backend.
|
|
|
|
|
|
|
|
This project prepares for a future where JupyterLab and other frontends switch
|
|
|
|
to Jupyter Server for their Python Web application backend. Using this package,
|
|
|
|
users can launch Jupyter Notebook, JupyterLab and other frontends side-by-side
|
|
|
|
on top of the new Python server backend.
|
|
|
|
|
|
|
|
%package -n jupyter-nbclassic
|
|
|
|
Summary: Jupyter Notebook as a Jupyter Server Extension
|
2022-10-01 21:22:26 +02:00
|
|
|
Requires: python3-nbclassic = %{version}
|
2021-02-03 13:35:36 +01:00
|
|
|
|
|
|
|
%description -n jupyter-nbclassic
|
|
|
|
NBClassic runs the Jupyter Notebook frontend on the Jupyter Server backend.
|
|
|
|
|
|
|
|
This project prepares for a future where JupyterLab and other frontends switch
|
|
|
|
to Jupyter Server for their Python Web application backend. Using this package,
|
|
|
|
users can launch Jupyter Notebook, JupyterLab and other frontends side-by-side
|
|
|
|
on top of the new Python server backend.
|
|
|
|
|
2022-08-02 23:24:37 +02:00
|
|
|
This package contains the jupyterlab server configuration and desktop files
|
|
|
|
|
2021-02-03 13:35:36 +01:00
|
|
|
%prep
|
|
|
|
%setup -q -n nbclassic-%{version}
|
|
|
|
|
|
|
|
%build
|
2022-08-02 23:24:37 +02:00
|
|
|
:
|
2021-02-03 13:35:36 +01:00
|
|
|
|
2022-08-02 23:24:37 +02:00
|
|
|
%if !%{with test}
|
2021-02-03 13:35:36 +01:00
|
|
|
%install
|
2022-08-02 23:24:37 +02:00
|
|
|
%pyproject_install %{SOURCE1}
|
2022-10-01 21:17:45 +02:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/jupyter-nbclassic
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/jupyter-nbclassic-bundlerextension
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/jupyter-nbclassic-extension
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/jupyter-nbclassic-serverextension
|
2022-08-02 23:24:37 +02:00
|
|
|
%{python_expand #
|
|
|
|
rm %{buildroot}%{$python_sitelib}/nbclassic/bundler/tests/resources/subdir/subsubdir/.gitkeep
|
|
|
|
|
|
|
|
%fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
# the locale structure is not compatible with (python_)find_lang. Roll our own.
|
|
|
|
echo '%%dir %{$python_sitelib}/nbclassic' > %{$python_prefix}-nbclassic.files
|
|
|
|
find %{buildroot}%{$python_sitelib}/nbclassic -mindepth 1 -maxdepth 1 -not -name i18n > non-lang-files
|
|
|
|
sed 's:%{buildroot}::' >> %{$python_prefix}-nbclassic.files < non-lang-files
|
|
|
|
find %{buildroot}%{$python_sitelib}/nbclassic/i18n -type f -o -type l > lang-files
|
|
|
|
sed -E '
|
|
|
|
s:%{buildroot}::
|
|
|
|
s:(.*/nbclassic/i18n/)([^/_]+)(.*(mo|po|json)$):%lang(\2) \1\2\3:
|
|
|
|
' >> %{$python_prefix}-nbclassic.files < lang-files
|
|
|
|
find %{buildroot}%{$python_sitelib}/nbclassic/i18n -type d > lang-dirs
|
|
|
|
sed -E '
|
|
|
|
s:%{buildroot}::
|
|
|
|
s:(.*):%%dir \1:
|
|
|
|
' >> %{$python_prefix}-nbclassic.files < lang-dirs
|
|
|
|
}
|
|
|
|
|
|
|
|
%suse_update_desktop_file jupyter-nbclassic
|
|
|
|
%endif
|
2021-02-03 13:35:36 +01:00
|
|
|
|
2021-10-27 13:52:16 +02:00
|
|
|
%pre
|
2022-08-02 23:24:37 +02:00
|
|
|
# Remove old update-alternatives entry for transition to libalternatives
|
2021-10-27 13:52:16 +02:00
|
|
|
%python_libalternatives_reset_alternative jupyter-nbclassic
|
|
|
|
|
2022-08-02 23:24:37 +02:00
|
|
|
%if %{with test}
|
2021-02-03 13:35:36 +01:00
|
|
|
%check
|
2022-06-05 20:31:11 +02:00
|
|
|
%pytest
|
2022-08-02 23:24:37 +02:00
|
|
|
%endif
|
2021-02-03 13:35:36 +01:00
|
|
|
|
2022-08-02 23:24:37 +02:00
|
|
|
%if !%{with test}
|
|
|
|
%files %{python_files} -f %{python_prefix}-nbclassic.files
|
2021-02-03 13:35:36 +01:00
|
|
|
%doc README.md
|
|
|
|
%license LICENSE
|
|
|
|
%python_alternative %{_bindir}/jupyter-nbclassic
|
2022-10-01 21:17:45 +02:00
|
|
|
%python_alternative %{_bindir}/jupyter-nbclassic-bundlerextension
|
|
|
|
%python_alternative %{_bindir}/jupyter-nbclassic-extension
|
|
|
|
%python_alternative %{_bindir}/jupyter-nbclassic-serverextension
|
2021-11-14 18:41:44 +01:00
|
|
|
%{python_sitelib}/nbclassic-%{version}*-info
|
2021-02-03 13:35:36 +01:00
|
|
|
|
|
|
|
%files -n jupyter-nbclassic
|
|
|
|
%license LICENSE
|
2022-10-01 10:03:24 +02:00
|
|
|
%{_jupyter_config} %{_jupyter_server_confdir}/nbclassic.json
|
2022-08-02 23:24:37 +02:00
|
|
|
%{_datadir}/icons/hicolor/*/apps/nbclassic.svg
|
|
|
|
%{_datadir}/applications/jupyter-nbclassic.desktop
|
|
|
|
%endif
|
2021-02-03 13:35:36 +01:00
|
|
|
|
|
|
|
%changelog
|