From 654c8d81e6abb204e5cee57911d98cb9ec8297ef854a8ff1dc08db8085f7c188 Mon Sep 17 00:00:00 2001 From: Benjamin Greiner Date: Thu, 6 Jan 2022 12:21:37 +0000 Subject: [PATCH 1/2] Accepting request 944225 from home:bnavigator:branches:devel:languages:python:jupyter - Add ipywidgets-pr3138-pr3194-packaging.patch for python310 packaging - Actually adds the JS files now OBS-URL: https://build.opensuse.org/request/show/944225 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-jupyterlab-widgets?expand=0&rev=3 --- ipywidgets-pr3138-pr3194-packaging.patch | 194 +++++++++++++++++++++++ python-jupyterlab-widgets.changes | 7 + python-jupyterlab-widgets.spec | 23 ++- 3 files changed, 220 insertions(+), 4 deletions(-) create mode 100644 ipywidgets-pr3138-pr3194-packaging.patch diff --git a/ipywidgets-pr3138-pr3194-packaging.patch b/ipywidgets-pr3138-pr3194-packaging.patch new file mode 100644 index 0000000..003ea6b --- /dev/null +++ b/ipywidgets-pr3138-pr3194-packaging.patch @@ -0,0 +1,194 @@ + +Index: jupyterlab_widgets-1.0.2/pyproject.toml +=================================================================== +--- jupyterlab_widgets-1.0.2.orig/pyproject.toml ++++ jupyterlab_widgets-1.0.2/pyproject.toml +@@ -1,3 +1,17 @@ + [build-system] +-requires = ["jupyter_packaging~=0.7.9", "jupyterlab~=3.0", "setuptools>=40.8.0", "wheel"] +-build-backend = "setuptools.build_meta" ++requires = ["jupyter_packaging~=0.10,<2", "jupyterlab~=3.0"] ++build-backend = "jupyter_packaging.build_api" ++ ++[tool.jupyter-packaging.options] ++skip-if-exists = ["jupyterlab_widgets/labextension/package.json"] ++ensured-targets = ["jupyterlab_widgets/labextension/package.json"] ++ ++[tool.jupyter-packaging.builder] ++factory = "jupyter_packaging.npm_builder" ++ ++[tool.jupyter-packaging.build-args] ++build_cmd = "build:prod" ++npm = ["jlpm"] ++ ++[tool.check-manifest] ++ignore = ["jupyterlab_widgets/labextension/**", "yarn.lock", ".*", "package-lock.json"] +\ No newline at end of file +Index: jupyterlab_widgets-1.0.2/setup.cfg +=================================================================== +--- jupyterlab_widgets-1.0.2.orig/setup.cfg ++++ jupyterlab_widgets-1.0.2/setup.cfg +@@ -1,4 +1,37 @@ +-[egg_info] +-tag_build = +-tag_date = 0 ++[metadata] ++name = jupyterlab_widgets ++version = attr: jupyterlab_widgets._version.__version__ ++author = Jupyter Development Team ++author_email = jupyter@googlegroups.com ++url = https://github.com/jupyter-widgets/ipywidgets ++description = Jupyter interactive widgets for JupyterLab ++long_description = file: README.md ++long_description_content_type = text/markdown ++license_file = LICENSE ++license = BSD-3-Clause ++platforms = Linux, Mac OS X, Windows ++keywords = Interactive, Interpreter, Shell, Web, notebook, widgets, Jupyter, JupyterLab, JupyterLab3 ++classifiers = ++ Intended Audience :: Developers ++ Intended Audience :: System Administrators ++ Intended Audience :: Science/Research ++ License :: OSI Approved :: BSD License ++ Programming Language :: Python ++ Programming Language :: Python :: 3 ++ Programming Language :: Python :: 3.6 ++ Programming Language :: Python :: 3.7 ++ Programming Language :: Python :: 3.8 ++ Programming Language :: Python :: 3.9 ++ Programming Language :: Python :: 3.10 ++ Programming Language :: Python :: 3 :: Only ++ Framework :: Jupyter ++ Framework :: Jupyter :: JupyterLab ++ Framework :: Jupyter :: JupyterLab :: 3 ++ Framework :: Jupyter :: JupyterLab :: Extensions ++ Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt + ++[options] ++python_requires = >=3.6 ++zip_safe=False ++include_package_data = True ++packages = find: +\ No newline at end of file +Index: jupyterlab_widgets-1.0.2/setup.py +=================================================================== +--- jupyterlab_widgets-1.0.2.orig/setup.py ++++ jupyterlab_widgets-1.0.2/setup.py +@@ -1,96 +1,38 @@ ++# Copyright (c) Jupyter Development Team. ++# Distributed under the terms of the Modified BSD License. ++ + """ + jupyterlab_widgets setup + """ +-import os +- + from jupyter_packaging import ( +- create_cmdclass, install_npm, ensure_targets, +- combine_commands, ensure_python, get_version, ++ wrap_installers, ++ npm_builder, ++ get_data_files + ) +-import setuptools ++from pathlib import Path ++from setuptools import setup + +-HERE = os.path.abspath(os.path.dirname(__file__)) ++HERE = Path(__file__).parent.resolve() ++IS_REPO = (HERE.parent / '.git').exists() ++LAB_PATH = HERE / "jupyterlab_widgets" / "labextension" + + # The name of the project + name = "jupyterlab_widgets" +- +-# Ensure a valid python version +-ensure_python(">=3.6") +- +-# Get our version +-version = get_version(os.path.join(name, "_version.py")) +- +-lab_path = os.path.join(HERE, name, "labextension") +- +-# Representative files that should exist after a successful build +-jstargets = [ +- os.path.join(lab_path, "package.json"), +-] +- +-package_data_spec = { +- name: [ +- "*" +- ] +-} +- + labext_name = "@jupyter-widgets/jupyterlab-manager" + + data_files_spec = [ +- ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), +- ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ++ (f"share/jupyter/labextensions/{labext_name}", LAB_PATH, "**"), ++ (f"share/jupyter/labextensions/{labext_name}", HERE, "install.json"), + ] + +-cmdclass = create_cmdclass( +- "jsdeps", +- package_data_spec=package_data_spec, +- data_files_spec=data_files_spec +-) +- +-# if the static assets already exist, do not invoke npm so we can make a wheel +-# from the sdist package, since the npm build really only works from this +-# repo. +-jsbuild = [] +-if all(os.path.exists(f) for f in jstargets): +- jsbuild.append(install_npm(HERE, build_cmd="build:prod", npm=["jlpm"])) +-jsbuild.append(ensure_targets(jstargets)) +- +-cmdclass["jsdeps"] = combine_commands(*jsbuild) +- +-with open("README.md", "r") as fh: +- long_description = fh.read() +- +-setup_args = dict( +- name=name, +- version=version, +- url="https://github.com/jupyter-widgets/ipywidgets", +- author="Jupyter Development Team", +- description="A JupyterLab extension.", +- long_description= long_description, +- long_description_content_type="text/markdown", +- cmdclass=cmdclass, +- packages=setuptools.find_packages(), +- install_requires=[], +- zip_safe=False, +- include_package_data=True, +- python_requires=">=3.6", +- license="BSD-3-Clause", +- platforms="Linux, Mac OS X, Windows", +- keywords=["Jupyter", "JupyterLab", "JupyterLab3"], +- classifiers=[ +- "License :: OSI Approved :: BSD License", +- "Programming Language :: Python", +- "Programming Language :: Python :: 3", +- "Programming Language :: Python :: 3.6", +- "Programming Language :: Python :: 3.7", +- "Programming Language :: Python :: 3.8", +- "Framework :: Jupyter", +- "Framework :: Jupyter :: JupyterLab", +- "Framework :: Jupyter :: JupyterLab :: 3", +- "Framework :: Jupyter :: JupyterLab :: Extensions", +- "Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt", +- ], ++post_develop = npm_builder( ++ build_cmd="install:extension", source_dir="src", build_dir=LAB_PATH + ) + ++cmdclass = wrap_installers(post_develop=post_develop) + + if __name__ == "__main__": +- setuptools.setup(**setup_args) ++ setup( ++ cmdclass=cmdclass, ++ data_files=get_data_files(data_files_spec), ++ ) +\ No newline at end of file diff --git a/python-jupyterlab-widgets.changes b/python-jupyterlab-widgets.changes index 3f4d77f..3077546 100644 --- a/python-jupyterlab-widgets.changes +++ b/python-jupyterlab-widgets.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jan 6 12:20:03 UTC 2022 - Ben Greiner + +- Add ipywidgets-pr3138-pr3194-packaging.patch for python310 + packaging +- Actually adds the JS files now + ------------------------------------------------------------------- Sun Oct 17 20:43:24 UTC 2021 - Ben Greiner diff --git a/python-jupyterlab-widgets.spec b/python-jupyterlab-widgets.spec index fa65a09..b06821c 100644 --- a/python-jupyterlab-widgets.spec +++ b/python-jupyterlab-widgets.spec @@ -1,7 +1,7 @@ # # spec file for package python-jupyterlab-widgets # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,11 +24,15 @@ Summary: A JupyterLab extension for Jupyter/IPython widgets License: BSD-3-Clause URL: https://github.com/jupyter-widgets/ipywidgets Source: https://files.pythonhosted.org/packages/source/j/jupyterlab_widgets/jupyterlab_widgets-%{version}.tar.gz +# PATCH-FIX-UPSTREAM ipywidgets-pr3138-pr3194-packaging.patch -- gh#jupyter-widgets/ipywidgets#3138 gh#jupyter-widgets/ipywidgets#3194 +Patch1: ipywidgets-pr3138-pr3194-packaging.patch Source99: python-jupyterlab-widgets-rpmlintrc -BuildRequires: python-rpm-macros -BuildRequires: %{python_module setuptools} BuildRequires: %{python_module jupyter_packaging} +BuildRequires: %{python_module setuptools} BuildRequires: fdupes +BuildRequires: jupyter-jupyterlab-filesystem +BuildRequires: python-rpm-macros +Requires: jupyter-jupyterlab-widgets BuildArch: noarch Provides: python-jupyterlab_widgets = %{version}-%{release} %python_subpackages @@ -36,8 +40,15 @@ Provides: python-jupyterlab_widgets = %{version}-%{release} %description A JupyterLab 3.0 extension for Jupyter/IPython widgets +%package -n jupyter-jupyterlab-widgets +Summary: A JupyterLab extension for Jupyter/IPython widgets - Jupyter JS files +Requires: jupyter-jupyterlab-filesystem + +%description -n jupyter-jupyterlab-widgets +A JupyterLab 3.0 extension for Jupyter/IPython widgets - Jupyter JS files + %prep -%setup -q -n jupyterlab_widgets-%{version} +%autosetup -p1 -n jupyterlab_widgets-%{version} %build %python_build @@ -57,4 +68,8 @@ $python -c 'import jupyterlab_widgets' %{python_sitelib}/jupyterlab_widgets %{python_sitelib}/jupyterlab_widgets-%{version}*-info +%files -n jupyter-jupyterlab-widgets +%license LICENSE +%{_jupyter_labextensions_dir3}/@jupyter-widgets + %changelog From 8f8f05cbf465ed322ea92869aabda2590f9b3d00ae92910d11c455c68e924678 Mon Sep 17 00:00:00 2001 From: Benjamin Greiner Date: Thu, 6 Jan 2022 12:50:39 +0000 Subject: [PATCH 2/2] Accepting request 944235 from home:bnavigator:branches:devel:languages:python:jupyter - Use the js version for the jupyter package OBS-URL: https://build.opensuse.org/request/show/944235 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-jupyterlab-widgets?expand=0&rev=4 --- python-jupyterlab-widgets.changes | 5 +++++ python-jupyterlab-widgets.spec | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/python-jupyterlab-widgets.changes b/python-jupyterlab-widgets.changes index 3077546..03356d2 100644 --- a/python-jupyterlab-widgets.changes +++ b/python-jupyterlab-widgets.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 6 12:49:05 UTC 2022 - Ben Greiner + +- Use the js version for the jupyter package + ------------------------------------------------------------------- Thu Jan 6 12:20:03 UTC 2022 - Ben Greiner diff --git a/python-jupyterlab-widgets.spec b/python-jupyterlab-widgets.spec index b06821c..cf05f83 100644 --- a/python-jupyterlab-widgets.spec +++ b/python-jupyterlab-widgets.spec @@ -17,13 +17,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define pyver 1.0.2 +%define jupver 3.0.1 Name: python-jupyterlab-widgets -Version: 1.0.2 +Version: %{pyver} Release: 0 Summary: A JupyterLab extension for Jupyter/IPython widgets License: BSD-3-Clause URL: https://github.com/jupyter-widgets/ipywidgets -Source: https://files.pythonhosted.org/packages/source/j/jupyterlab_widgets/jupyterlab_widgets-%{version}.tar.gz +Source: https://files.pythonhosted.org/packages/source/j/jupyterlab_widgets/jupyterlab_widgets-%{pyver}.tar.gz # PATCH-FIX-UPSTREAM ipywidgets-pr3138-pr3194-packaging.patch -- gh#jupyter-widgets/ipywidgets#3138 gh#jupyter-widgets/ipywidgets#3194 Patch1: ipywidgets-pr3138-pr3194-packaging.patch Source99: python-jupyterlab-widgets-rpmlintrc @@ -34,7 +36,7 @@ BuildRequires: jupyter-jupyterlab-filesystem BuildRequires: python-rpm-macros Requires: jupyter-jupyterlab-widgets BuildArch: noarch -Provides: python-jupyterlab_widgets = %{version}-%{release} +Provides: python-jupyterlab_widgets = %{pyver}-%{release} %python_subpackages %description @@ -42,13 +44,15 @@ A JupyterLab 3.0 extension for Jupyter/IPython widgets %package -n jupyter-jupyterlab-widgets Summary: A JupyterLab extension for Jupyter/IPython widgets - Jupyter JS files +Version: %{jupver} +Provides: jupyter-jupyterlab_widgets = %{jupver}-%{release} Requires: jupyter-jupyterlab-filesystem %description -n jupyter-jupyterlab-widgets A JupyterLab 3.0 extension for Jupyter/IPython widgets - Jupyter JS files %prep -%autosetup -p1 -n jupyterlab_widgets-%{version} +%autosetup -p1 -n jupyterlab_widgets-%{pyver} %build %python_build @@ -66,7 +70,7 @@ $python -c 'import jupyterlab_widgets' %doc README.md %license LICENSE %{python_sitelib}/jupyterlab_widgets -%{python_sitelib}/jupyterlab_widgets-%{version}*-info +%{python_sitelib}/jupyterlab_widgets-%{pyver}*-info %files -n jupyter-jupyterlab-widgets %license LICENSE