2019-05-01 15:37:05 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-pythreejs
|
|
|
|
|
#
|
2024-03-08 13:44:25 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2019-05-01 15:37:05 +00: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/
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
2024-03-08 13:44:25 +00:00
|
|
|
%define skip_python39 1
|
2022-08-28 21:48:08 +00:00
|
|
|
%define mainver 2.4.1
|
2023-08-26 15:43:03 +00:00
|
|
|
%define shortver 2.4.1
|
2022-08-28 21:48:08 +00:00
|
|
|
%define jupver 2.4.0
|
2019-05-01 15:37:05 +00:00
|
|
|
Name: python-pythreejs
|
|
|
|
|
Version: %{mainver}
|
|
|
|
|
Release: 0
|
|
|
|
|
Summary: A Python/ThreeJS bridge utilizing the Jupyter widget infrastructure
|
|
|
|
|
License: BSD-3-Clause
|
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
|
URL: https://github.com/jupyter-widgets/pythreejs
|
2021-02-03 12:44:02 +00:00
|
|
|
# Get examples for testing from GitHub
|
|
|
|
|
Source0: https://github.com/jupyter-widgets/pythreejs/archive/%{version}.tar.gz#/pythreejs-%{version}-gh.tar.gz
|
2023-08-26 15:43:03 +00:00
|
|
|
# but install from wheel for bundled js stuff
|
2022-08-28 21:48:08 +00:00
|
|
|
Source1: https://files.pythonhosted.org/packages/py3/p/pythreejs/pythreejs-%{version}-py3-none-any.whl
|
|
|
|
|
BuildRequires: %{python_module base >= 3.7}
|
2019-05-01 15:37:05 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
|
|
|
|
BuildRequires: fdupes
|
2023-08-26 15:43:03 +00:00
|
|
|
BuildRequires: jupyter-rpm-macros
|
2019-05-01 15:37:05 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2022-08-28 21:48:08 +00:00
|
|
|
Recommends: jupyter-threejs-jupyterlab = %{jupver}
|
|
|
|
|
Requires: jupyter-threejs = %{jupver}
|
2019-05-01 15:37:05 +00:00
|
|
|
Requires: python-ipydatawidgets >= 1.1.1
|
2021-02-03 12:44:02 +00:00
|
|
|
Requires: python-ipywidgets >= 7.2.1
|
2019-05-01 15:37:05 +00:00
|
|
|
Requires: python-numpy >= 1.14
|
2022-08-28 21:48:08 +00:00
|
|
|
Requires: python-traitlets
|
2019-05-01 15:37:05 +00:00
|
|
|
BuildArch: noarch
|
2021-04-12 09:30:32 +00:00
|
|
|
# SECTION test requirements
|
2023-08-26 15:43:03 +00:00
|
|
|
BuildRequires: %{python_module nbclassic}
|
2019-05-01 15:37:05 +00:00
|
|
|
BuildRequires: %{python_module ipydatawidgets >= 1.1.1}
|
2021-02-03 12:44:02 +00:00
|
|
|
BuildRequires: %{python_module ipywebrtc}
|
|
|
|
|
BuildRequires: %{python_module ipywidgets >= 7.2.1}
|
2023-08-29 17:19:43 +00:00
|
|
|
BuildRequires: %{python_module jupyterlab}
|
2021-04-12 09:30:32 +00:00
|
|
|
BuildRequires: %{python_module matplotlib}
|
2019-05-01 15:37:05 +00:00
|
|
|
BuildRequires: %{python_module nbval}
|
2021-04-12 09:30:32 +00:00
|
|
|
BuildRequires: %{python_module numpy >= 1.14}
|
2019-05-01 15:37:05 +00:00
|
|
|
BuildRequires: %{python_module pytest-check-links}
|
2021-04-12 09:30:32 +00:00
|
|
|
BuildRequires: %{python_module scikit-image}
|
|
|
|
|
BuildRequires: %{python_module scipy}
|
2022-08-28 21:48:08 +00:00
|
|
|
BuildRequires: %{python_module traitlets}
|
2019-05-01 15:37:05 +00:00
|
|
|
# /SECTION
|
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Interactive 3d graphics for the Jupyter notebook,
|
|
|
|
|
using Three.js from Jupyter interactive widgets.
|
|
|
|
|
|
|
|
|
|
This package provides the python interface.
|
|
|
|
|
|
2022-08-28 21:48:08 +00:00
|
|
|
%package -n jupyter-threejs
|
|
|
|
|
Version: %{jupver}
|
2019-05-01 15:37:05 +00:00
|
|
|
Summary: A Python/ThreeJS bridge utilizing the Jupyter widget infrastructure
|
2021-02-03 12:44:02 +00:00
|
|
|
Group: Development/Languages/Python
|
2019-05-01 15:37:05 +00:00
|
|
|
Requires: jupyter-ipydatawidgets >= 1.1.1
|
2021-02-03 12:44:02 +00:00
|
|
|
Requires: jupyter-ipywidgets >= 7.2.1
|
2023-08-26 15:43:03 +00:00
|
|
|
Requires: (jupyter-notebook < 7 or jupyter-nbclassic)
|
|
|
|
|
Requires: python3dist(pythreejs) = %{shortver}
|
|
|
|
|
Suggests: python3-pythreejs
|
2022-08-28 21:48:08 +00:00
|
|
|
Provides: jupyter-pythreejs = %{jupver}-%{release}
|
|
|
|
|
Obsoletes: jupyter-pythreejs < %{jupver}-%{release}
|
2019-05-01 15:37:05 +00:00
|
|
|
|
2022-08-28 21:48:08 +00:00
|
|
|
%description -n jupyter-threejs
|
2019-05-01 15:37:05 +00:00
|
|
|
Interactive 3d graphics for the Jupyter notebook,
|
|
|
|
|
using Three.js from Jupyter interactive widgets.
|
|
|
|
|
|
|
|
|
|
This package provides the jupyter notebook extension.
|
|
|
|
|
|
2022-08-28 21:48:08 +00:00
|
|
|
%package -n jupyter-threejs-jupyterlab
|
2019-05-01 15:37:05 +00:00
|
|
|
Summary: A Python/ThreeJS bridge utilizing the Jupyter widget infrastructure
|
2021-02-03 12:44:02 +00:00
|
|
|
Group: Development/Languages/Python
|
2022-08-28 21:48:08 +00:00
|
|
|
Version: %{jupver}
|
2021-02-03 12:44:02 +00:00
|
|
|
Release: 0
|
2019-05-01 15:37:05 +00:00
|
|
|
Requires: jupyter-ipydatawidgets-jupyterlab >= 1.1.1
|
|
|
|
|
Requires: jupyter-jupyterlab
|
2023-08-26 15:43:03 +00:00
|
|
|
Requires: python3dist(pythreejs) = %{shortver}
|
|
|
|
|
Suggests: python3-pythreejs
|
2022-08-28 21:48:08 +00:00
|
|
|
Provides: jupyter-pythreejs-jupyterlab = %{jupver}-%{release}
|
|
|
|
|
Obsoletes: jupyter-pythreejs-jupyterlab < %{jupver}-%{release}
|
2019-05-01 15:37:05 +00:00
|
|
|
|
2022-08-28 21:48:08 +00:00
|
|
|
%description -n jupyter-threejs-jupyterlab
|
2019-05-01 15:37:05 +00:00
|
|
|
Interactive 3d graphics for the Jupyter notebook,
|
|
|
|
|
using Three.js from Jupyter interactive widgets.
|
|
|
|
|
|
|
|
|
|
This package provides the JupyterLab extension.
|
|
|
|
|
|
|
|
|
|
%prep
|
2021-02-03 12:44:02 +00:00
|
|
|
%setup -q -n pythreejs-%{mainver}
|
2019-05-01 15:37:05 +00:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
# Not Needed
|
|
|
|
|
|
|
|
|
|
%install
|
2021-02-03 12:44:02 +00:00
|
|
|
%{python_expand mkdir -p build/; cp -a %{SOURCE1} build/}
|
2020-01-15 14:45:20 +00:00
|
|
|
%pyproject_install
|
2019-05-01 15:37:05 +00:00
|
|
|
%python_expand sed -i 's/\r$//' %{buildroot}%{$python_sitelib}/pythreejs/*.py
|
|
|
|
|
%python_expand sed -i -e '/^#!\//, 1d' %{buildroot}%{$python_sitelib}/pythreejs/*.py
|
2021-02-03 12:44:02 +00:00
|
|
|
%python_compileall
|
2019-05-01 15:37:05 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
2021-02-03 12:44:02 +00:00
|
|
|
%jupyter_move_config
|
2019-08-15 20:50:45 +00:00
|
|
|
cp %{buildroot}%{python3_sitelib}/pythreejs-%{mainver}.dist-info/LICENSE .
|
2021-02-03 12:44:02 +00:00
|
|
|
%fdupes %{buildroot}%{_jupyter_prefix} %{buildroot}%{python3_sitelib}
|
|
|
|
|
|
|
|
|
|
%check
|
2022-08-28 21:48:08 +00:00
|
|
|
%pytest -l --nbval-lax --current-env examples
|
2023-08-26 15:43:03 +00:00
|
|
|
export JUPYTER_PATH=%{buildroot}%{_jupyter_prefix}
|
2024-03-08 14:03:20 +00:00
|
|
|
cp -r %{buildroot}%{_jupyter_confdir} myconf
|
|
|
|
|
export JUPYTER_CONFIG_DIR=$PWD/myconf
|
2023-08-26 15:43:03 +00:00
|
|
|
%{python_expand # check extensions
|
|
|
|
|
export PYTHONPATH=%{buildroot}%{$python_sitelib}
|
|
|
|
|
jupyter-%{$python_bin_suffix} nbclassic-extension list 2>&1 | grep 'threejs.*enabled'
|
2023-08-26 15:58:24 +00:00
|
|
|
jupyter-%{$python_bin_suffix} labextension list 2>&1 | grep 'threejs.*enabled'
|
2023-08-26 15:43:03 +00:00
|
|
|
}
|
2019-05-01 15:37:05 +00:00
|
|
|
|
|
|
|
|
%files %{python_files}
|
2021-02-03 12:44:02 +00:00
|
|
|
%license LICENSE
|
2019-05-01 15:37:05 +00:00
|
|
|
%{python_sitelib}/pythreejs/
|
|
|
|
|
%{python_sitelib}/pythreejs-%{mainver}.dist-info/
|
|
|
|
|
|
2022-08-28 21:48:08 +00:00
|
|
|
%files -n jupyter-threejs
|
2019-08-15 20:50:45 +00:00
|
|
|
%license LICENSE
|
2022-08-28 21:48:08 +00:00
|
|
|
%_jupyter_config %{_jupyter_nb_notebook_confdir}/jupyter-threejs.json
|
2019-05-01 15:37:05 +00:00
|
|
|
%{_jupyter_nbextension_dir}/jupyter-threejs/
|
|
|
|
|
|
2022-08-28 21:48:08 +00:00
|
|
|
%files -n jupyter-threejs-jupyterlab
|
2019-08-15 20:50:45 +00:00
|
|
|
%license LICENSE
|
2022-08-28 21:48:08 +00:00
|
|
|
%{_jupyter_labextensions_dir}/jupyter-threejs-%{jupver}.tgz
|
|
|
|
|
%{_jupyter_labextensions_dir3}/jupyter-threejs/
|
2019-05-01 15:37:05 +00:00
|
|
|
|
|
|
|
|
%changelog
|