2019-04-26 22:02:20 +02:00
|
|
|
#
|
|
|
|
# spec file for package python-nbdime
|
|
|
|
#
|
2022-12-29 22:58:01 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2019-04-26 22:02:20 +02: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-12-29 22:58:01 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%bcond_without libalternatives
|
|
|
|
%else
|
|
|
|
%bcond_with libalternatives
|
|
|
|
%endif
|
|
|
|
|
2019-11-12 21:49:12 +01:00
|
|
|
%define skip_python2 1
|
2021-11-13 16:59:46 +01:00
|
|
|
%define mainver 3.1.1
|
|
|
|
%define jupver 6.1.2
|
|
|
|
%define labver 2.1.1
|
2022-12-29 22:58:01 +01:00
|
|
|
%define mainbins nbdime nbshow nbdiff nbdiff-web nbmerge nbmerge-web
|
|
|
|
%define gitbins git-nbdifftool git-nbmergetool git-nbdiffdriver git-nbmergedriver
|
|
|
|
%define hgbins hg-nbdiff hg-nbdiffweb hg-nbmerge hg-nbmergeweb
|
2019-04-26 22:02:20 +02:00
|
|
|
Name: python-nbdime
|
|
|
|
Version: %{mainver}
|
|
|
|
Release: 0
|
|
|
|
Summary: Tools for diffing and merging Jupyter Notebooks
|
|
|
|
License: BSD-3-Clause
|
|
|
|
URL: https://github.com/jupyter/nbdime
|
2022-12-29 22:58:01 +01:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/n/nbdime/nbdime-%{mainver}.tar.gz
|
2019-04-26 22:02:20 +02:00
|
|
|
BuildRequires: %{python_module GitPython >= 2.1.6}
|
|
|
|
BuildRequires: %{python_module Jinja2 >= 2.9}
|
2021-04-19 10:05:33 +02:00
|
|
|
BuildRequires: %{python_module Pygments}
|
2021-11-13 16:59:46 +01:00
|
|
|
BuildRequires: %{python_module base >= 3.6}
|
2019-04-26 22:02:20 +02:00
|
|
|
BuildRequires: %{python_module colorama}
|
2021-04-19 10:05:33 +02:00
|
|
|
BuildRequires: %{python_module jupyter-server-mathjax >= 0.2.2}
|
|
|
|
BuildRequires: %{python_module jupyter-server}
|
2019-04-26 22:02:20 +02:00
|
|
|
BuildRequires: %{python_module nbformat}
|
|
|
|
BuildRequires: %{python_module pip}
|
|
|
|
BuildRequires: %{python_module requests}
|
2022-12-29 22:58:01 +01:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-04-26 22:02:20 +02:00
|
|
|
BuildRequires: %{python_module tornado}
|
2022-12-29 22:58:01 +01:00
|
|
|
BuildRequires: %{python_module wheel}
|
2019-04-26 22:02:20 +02:00
|
|
|
BuildRequires: fdupes
|
2022-12-29 22:58:01 +01:00
|
|
|
BuildRequires: jupyter-rpm-macros
|
2019-04-26 22:02:20 +02:00
|
|
|
BuildRequires: python-rpm-macros
|
2021-11-13 16:59:46 +01:00
|
|
|
# SECTION test requirements
|
|
|
|
BuildRequires: %{python_module jupyter-server-test}
|
2021-02-05 10:29:12 +01:00
|
|
|
BuildRequires: %{python_module jsonschema}
|
2021-04-19 10:05:33 +02:00
|
|
|
BuildRequires: %{python_module notebook}
|
2021-11-13 16:59:46 +01:00
|
|
|
BuildRequires: %{python_module pytest >= 3.6}
|
2021-04-19 10:05:33 +02:00
|
|
|
BuildRequires: %{python_module pytest-mock}
|
2021-02-05 10:29:12 +01:00
|
|
|
BuildRequires: %{python_module pytest-timeout}
|
|
|
|
BuildRequires: %{python_module pytest-tornado}
|
2019-08-16 17:25:31 +02:00
|
|
|
# /SECTION
|
2021-04-19 10:05:33 +02:00
|
|
|
Requires: jupyter-nbdime = %{jupver}
|
2019-04-26 22:02:20 +02:00
|
|
|
Requires: python-GitPython >= 2.1.6
|
|
|
|
Requires: python-Jinja2 >= 2.9
|
2021-04-19 10:05:33 +02:00
|
|
|
Requires: python-Pygments
|
2019-04-26 22:02:20 +02:00
|
|
|
Requires: python-colorama
|
2021-04-19 10:05:33 +02:00
|
|
|
Requires: python-jupyter-server
|
|
|
|
Requires: python-jupyter-server-mathjax >= 0.2.2
|
2019-04-26 22:02:20 +02:00
|
|
|
Requires: python-nbformat
|
|
|
|
Requires: python-requests
|
|
|
|
Requires: python-tornado
|
2022-12-29 22:58:01 +01:00
|
|
|
%if %{with libalternatives}
|
|
|
|
BuildRequires: alts
|
|
|
|
Requires: alts
|
|
|
|
%else
|
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun):update-alternatives
|
|
|
|
%endif
|
2019-05-15 18:06:39 +02:00
|
|
|
Conflicts: python-jupyter_nbdime-git < 1.0.5
|
2021-04-19 10:05:33 +02:00
|
|
|
Conflicts: python-jupyter_nbdime-hg < 1.0.5
|
2019-04-26 22:02:20 +02:00
|
|
|
Recommends: python-tabulate
|
2021-04-19 10:05:33 +02:00
|
|
|
Suggests: python-notebook
|
2022-12-29 22:58:01 +01:00
|
|
|
Provides: python-jupyter_nbdime = %{mainver}-%{release}
|
|
|
|
Obsoletes: python-jupyter_nbdime < %{mainver}-%{release}
|
2019-04-26 22:02:20 +02:00
|
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
The nbdime package provides tools for diffing and merging of
|
|
|
|
Jupyter Notebooks.
|
|
|
|
|
|
|
|
This package provides the python interface.
|
|
|
|
|
|
|
|
%package -n jupyter-nbdime
|
2021-04-19 10:05:33 +02:00
|
|
|
Version: %{jupver}
|
2019-04-26 22:02:20 +02:00
|
|
|
Summary: A JupyterLab extension for showing Notebook diffs
|
2022-12-29 23:36:08 +01:00
|
|
|
Requires: (%(echo "%{python_module nbdime = %{mainver}@or@}" | sed "s/@or@/ or /g" | sed 's/ or\s*$//'))
|
2019-05-15 18:06:39 +02:00
|
|
|
Conflicts: python3-jupyter_nbdime < 1.0.5
|
2019-04-26 22:02:20 +02:00
|
|
|
|
|
|
|
%description -n jupyter-nbdime
|
|
|
|
The nbdime package provides tools for diffing and merging of
|
|
|
|
Jupyter Notebooks.
|
|
|
|
|
|
|
|
This package provides the tools and jupyter notebook extension.
|
|
|
|
|
2019-04-29 23:04:32 +02:00
|
|
|
%package -n jupyter-nbdime-jupyterlab
|
2019-04-26 22:02:20 +02:00
|
|
|
Version: %{labver}
|
2020-04-23 12:43:01 +02:00
|
|
|
Release: 0
|
2019-04-26 22:02:20 +02:00
|
|
|
Summary: A JupyterLab extension for showing Notebook diffs
|
|
|
|
Requires: jupyter-jupyterlab
|
2022-12-29 23:36:08 +01:00
|
|
|
Requires: (%(echo "%{python_module nbdime = %{mainver}@or@}" | sed "s/@or@/ or /g" | sed 's/ or\s*$//'))
|
2019-04-26 22:02:20 +02:00
|
|
|
|
|
|
|
%description -n jupyter-nbdime-jupyterlab
|
|
|
|
The nbdime package provides tools for diffing and merging of
|
|
|
|
Jupyter Notebooks.
|
|
|
|
|
|
|
|
This package provides the JupyterLab extension.
|
|
|
|
|
2022-12-29 22:58:01 +01:00
|
|
|
%package git
|
|
|
|
Version: %{mainver}
|
|
|
|
Summary: Git integration for python-nbdime
|
2020-04-23 12:43:01 +02:00
|
|
|
Requires: git-core
|
2022-12-29 22:58:01 +01:00
|
|
|
Requires: python-nbdime = %{mainver}
|
|
|
|
# python3-jupyter_nbdime-git = JUPVER (!) was provided by a jupyter-nbdime-git package until end of 2022
|
|
|
|
Provides: python-jupyter_nbdime-git = %{jupver}-%{release}
|
|
|
|
Obsoletes: python-jupyter_nbdime-git < %{jupver}-%{release}
|
|
|
|
%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3"
|
|
|
|
Provides: jupyter-nbdime-git = %{jupver}-%{release}
|
|
|
|
Obsoletes: jupyter-nbdime-git < %{jupver}-%{release}
|
2022-12-29 23:36:08 +01:00
|
|
|
%else
|
|
|
|
Conflicts: jupyter-nbdime-git < %{jupver}-%{release}
|
2022-12-29 22:58:01 +01:00
|
|
|
%endif
|
|
|
|
%if %{with libalternatives}
|
|
|
|
Requires: alts
|
|
|
|
%else
|
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun):update-alternatives
|
|
|
|
%endif
|
2019-04-26 22:02:20 +02:00
|
|
|
|
2022-12-29 22:58:01 +01:00
|
|
|
%description git
|
2019-04-26 22:02:20 +02:00
|
|
|
The nbdime package provides tools for diffing and merging of
|
|
|
|
Jupyter Notebooks.
|
|
|
|
|
|
|
|
This package provides git integration.
|
|
|
|
|
2022-12-29 22:58:01 +01:00
|
|
|
%package hg
|
|
|
|
Version: %{mainver}
|
|
|
|
Summary: Mercurial integration for python-nbdime
|
2019-04-26 22:02:20 +02:00
|
|
|
Requires: mercurial
|
2022-12-29 22:58:01 +01:00
|
|
|
Requires: python-nbdime = %{mainver}
|
|
|
|
# python3-jupyter_nbdime-hg = JUPVER (!) was provided by a jupyter-nbdime-git package until end of 2022
|
|
|
|
Provides: python-jupyter_nbdime-hg = %{jupver}-%{release}
|
|
|
|
Obsoletes: python-jupyter_nbdime-hg < %{jupver}-%{release}
|
|
|
|
%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3"
|
|
|
|
Provides: jupyter-nbdime-hg = %{jupver}-%{release}
|
|
|
|
Obsoletes: jupyter-nbdime-hg < %{jupver}-%{release}
|
2022-12-29 23:36:08 +01:00
|
|
|
%else
|
|
|
|
Conflicts: jupyter-nbdime-hg < %{jupver}-%{release}
|
2022-12-29 22:58:01 +01:00
|
|
|
%endif
|
|
|
|
%if %{with libalternatives}
|
|
|
|
Requires: alts
|
|
|
|
%else
|
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun):update-alternatives
|
|
|
|
%endif
|
2019-04-26 22:02:20 +02:00
|
|
|
|
2022-12-29 22:58:01 +01:00
|
|
|
%description hg
|
2019-04-26 22:02:20 +02:00
|
|
|
The nbdime package provides tools for diffing and merging of
|
|
|
|
Jupyter Notebooks.
|
|
|
|
|
2019-04-26 23:22:09 +02:00
|
|
|
This package provides mercurial integration.
|
2019-04-26 22:02:20 +02:00
|
|
|
|
|
|
|
%prep
|
2022-12-29 22:58:01 +01:00
|
|
|
%autosetup -p1 -n nbdime-%{mainver}
|
|
|
|
sed -i 's/^import mock/from unittest import mock/' nbdime/tests/test_*.py
|
|
|
|
find . -type f -name "*.py" -exec sed -i 's/\r$//' {} +
|
|
|
|
find . -type f -name "*.ipynb" -exec sed -i 's/\r$//' {} +
|
|
|
|
find ./nbdime/ -type f -name "*.py" -exec sed -i -e '/^#!\//, 1d' {} +
|
|
|
|
rm nbdime/labextension/schemas/nbdime-jupyterlab/package.json.orig
|
2019-04-26 22:02:20 +02:00
|
|
|
|
|
|
|
%build
|
2022-12-29 22:58:01 +01:00
|
|
|
%pyproject_wheel
|
2019-04-26 22:02:20 +02:00
|
|
|
|
|
|
|
%install
|
2022-12-29 22:58:01 +01:00
|
|
|
%pyproject_install
|
|
|
|
for b in %mainbins %gitbins %hgbins; do
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/$b
|
|
|
|
done
|
2019-04-26 22:02:20 +02:00
|
|
|
%{jupyter_move_config}
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2021-02-05 10:29:12 +01:00
|
|
|
%fdupes %{buildroot}%{_jupyter_prefix}
|
2019-04-26 22:02:20 +02:00
|
|
|
|
2019-08-16 17:25:31 +02:00
|
|
|
%check
|
2022-12-29 22:58:01 +01:00
|
|
|
# freshly to be install libalternatives commands are not yet flavorbinned automatically
|
|
|
|
%if %{with libalternatives}
|
|
|
|
%{python_expand mkdir -p build/flavorbin
|
|
|
|
for b in %mainbins %gitbins %hgbins; do
|
|
|
|
ln -s %{buildroot}%{_bindir}/$b-%{$python_bin_suffix} build/flavorbin/$b
|
|
|
|
done
|
|
|
|
}
|
|
|
|
%endif
|
2019-08-16 17:25:31 +02:00
|
|
|
git config --global user.email "test@test.com"
|
|
|
|
git config --global user.name "tester"
|
2022-12-29 22:58:01 +01:00
|
|
|
git config --global init.defaultBranch master
|
2021-02-05 10:29:12 +01:00
|
|
|
%pytest --pyargs nbdime
|
2019-08-16 17:25:31 +02:00
|
|
|
|
2022-12-29 22:58:01 +01:00
|
|
|
%pre
|
|
|
|
# remove any non-symlink bin before installing the alternative links
|
|
|
|
for b in %mainbins; do
|
|
|
|
[ -f %{_bindir}/$b -a ! -h %{_bindir}/$b ] && rm %{_bindir}/$b
|
|
|
|
done
|
|
|
|
%python_libalternatives_reset_alternative nbdime
|
|
|
|
|
|
|
|
%post
|
|
|
|
%python_install_alternative %mainbins
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative nbdime
|
|
|
|
|
|
|
|
%pre git
|
|
|
|
# remove any non-symlink bin before installing the alternative links
|
|
|
|
for b in %gitbins; do
|
|
|
|
[ -f %{_bindir}/$b -a ! -h %{_bindir}/$b ] && rm %{_bindir}/$b
|
|
|
|
done
|
|
|
|
%python_libalternatives_reset_alternative git-nbdifftool
|
|
|
|
|
|
|
|
%post git
|
|
|
|
%python_install_alternative %gitbins
|
|
|
|
|
|
|
|
%postun git
|
|
|
|
%python_uninstall_alternative git-nbdifftool
|
|
|
|
|
|
|
|
%pre hg
|
|
|
|
# remove any non-symlink bin before installing the alternative links
|
|
|
|
for b in %hgbins; do
|
|
|
|
[ -f %{_bindir}/$b -a ! -h %{_bindir}/$b ] && rm %{_bindir}/$b
|
|
|
|
done
|
|
|
|
%python_libalternatives_reset_alternative hg-nbdiff
|
|
|
|
|
|
|
|
%post hg
|
|
|
|
%python_install_alternative %hgbins
|
|
|
|
|
|
|
|
%postun hg
|
|
|
|
%python_uninstall_alternative hg-nbdiff
|
|
|
|
|
2019-04-26 22:02:20 +02:00
|
|
|
%files %{python_files}
|
2021-02-05 10:29:12 +01:00
|
|
|
%license LICENSE.md
|
2022-12-29 22:58:01 +01:00
|
|
|
%python_alternative %{_bindir}/nbdime
|
|
|
|
%python_alternative %{_bindir}/nbshow
|
|
|
|
%python_alternative %{_bindir}/nbdiff
|
|
|
|
%python_alternative %{_bindir}/nbdiff-web
|
|
|
|
%python_alternative %{_bindir}/nbmerge
|
|
|
|
%python_alternative %{_bindir}/nbmerge-web
|
2019-04-26 22:02:20 +02:00
|
|
|
%{python_sitelib}/nbdime/
|
|
|
|
%{python_sitelib}/nbdime-%{mainver}.dist-info/
|
|
|
|
|
2022-12-29 22:58:01 +01:00
|
|
|
%files %{python_files git}
|
2019-04-26 22:02:20 +02:00
|
|
|
%license LICENSE.md
|
2022-12-29 22:58:01 +01:00
|
|
|
%python_alternative %{_bindir}/git-nbdiffdriver
|
|
|
|
%python_alternative %{_bindir}/git-nbdifftool
|
|
|
|
%python_alternative %{_bindir}/git-nbmergedriver
|
|
|
|
%python_alternative %{_bindir}/git-nbmergetool
|
2019-04-26 22:02:20 +02:00
|
|
|
|
2022-12-29 22:58:01 +01:00
|
|
|
%files %{python_files hg}
|
2019-04-26 22:02:20 +02:00
|
|
|
%license LICENSE.md
|
2022-12-29 22:58:01 +01:00
|
|
|
%python_alternative %{_bindir}/hg-nbdiff
|
|
|
|
%python_alternative %{_bindir}/hg-nbdiffweb
|
|
|
|
%python_alternative %{_bindir}/hg-nbmerge
|
|
|
|
%python_alternative %{_bindir}/hg-nbmergeweb
|
2019-04-26 22:02:20 +02:00
|
|
|
|
2022-12-29 22:58:01 +01:00
|
|
|
%files -n jupyter-nbdime
|
2019-04-26 22:02:20 +02:00
|
|
|
%license LICENSE.md
|
2022-12-29 22:58:01 +01:00
|
|
|
%{_jupyter_nbextension_dir}/nbdime/
|
|
|
|
%_jupyter_config %{_jupyter_server_confdir}/nbdime.json
|
|
|
|
%_jupyter_config %{_jupyter_servextension_confdir}/nbdime.json
|
|
|
|
%_jupyter_config %{_jupyter_nb_notebook_confdir}/nbdime.json
|
2019-04-26 22:02:20 +02:00
|
|
|
|
2022-12-29 22:58:01 +01:00
|
|
|
%files -n jupyter-nbdime-jupyterlab
|
2019-04-26 22:02:20 +02:00
|
|
|
%license LICENSE.md
|
2022-12-29 22:58:01 +01:00
|
|
|
%dir %{_jupyter_prefix}/labextensions
|
|
|
|
%{_jupyter_labextensions_dir3}/nbdime-jupyterlab
|
|
|
|
%{_jupyter_labextensions_dir}/nbdime-jupyterlab-%{labver}.tgz
|
2019-04-26 22:02:20 +02:00
|
|
|
|
|
|
|
%changelog
|