diff --git a/create_node_modules.sh b/create_node_modules.sh new file mode 100644 index 0000000..3346821 --- /dev/null +++ b/create_node_modules.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Script to create node_modules.tar.xz for the tests. +# Adapted from .github/workflows/test.yml +# Execute this in an extracted github archive/cloned repository +# Note: The pathname MUST NOT include any ':' as is common +# in checked out obs package directories. + +# requires: yarn, npm + +pushd javascript +yarn +yarn build +popd +pushd tests +npm install +popd + +tar cJf node_modules.tar.xz \ + yarn.lock \ + package-lock.json \ + node_modules \ + javascript/lib \ + javascript/node_modules \ + javascript/tsconfig.tsbuildinfo + \ No newline at end of file diff --git a/jupyter_ydoc-0.3.1.tar.gz b/jupyter_ydoc-0.3.1.tar.gz new file mode 100644 index 0000000..8be6d99 --- /dev/null +++ b/jupyter_ydoc-0.3.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23948daf60a0c3c0a4b3715a66cb6ccad2de56694864842534fb1b1564b9b56b +size 148355 diff --git a/node_modules.tar.xz b/node_modules.tar.xz new file mode 100644 index 0000000..f204de8 --- /dev/null +++ b/node_modules.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fca47a96125f721282d6026d9379d3d7bab7cc3520bebb1eee67ea991f67f53 +size 22739720 diff --git a/python-jupyter-ydoc.changes b/python-jupyter-ydoc.changes index 2339b5e..b272d59 100644 --- a/python-jupyter-ydoc.changes +++ b/python-jupyter-ydoc.changes @@ -3,3 +3,5 @@ Sun Feb 5 16:52:33 UTC 2023 - Ben Greiner - Initial specfile for v0.3.1 - Required by jupyterlab 3.6 +- Provide node_modules.tar.xz generated by create_node_modules.sh + for the tests. Those modules are not part of the python package diff --git a/python-jupyter-ydoc.spec b/python-jupyter-ydoc.spec index 692aad9..c717cd5 100644 --- a/python-jupyter-ydoc.spec +++ b/python-jupyter-ydoc.spec @@ -22,20 +22,31 @@ Release: 0 Summary: Document structures for collaborative editing using Ypy License: BSD-3-Clause URL: https://github.com/jupyter-server/jupyter_ydoc -Source: https://github.com/jupyter-server/jupyter_ydoc/archive/refs/tags/v%{version}.tar.gz#/jupyter_ydoc-%{version}-gh.tar.gz -BuildRequires: python-rpm-macros -BuildRequires: %{python_module pip} +# Versioned sdist +Source0: https://files.pythonhosted.org/packages/source/j/jupyter-ydoc/jupyter_ydoc-%{version}.tar.gz +# unversioned, but tests +Source1: https://github.com/jupyter-server/jupyter_ydoc/archive/refs/tags/v%{version}.tar.gz#/jupyter_ydoc-%{version}-gh.tar.gz +Source2: node_modules.tar.xz +# Execute this on every package update. See comments in the script. +Source3: create_node_modules.sh +BuildRequires: %{python_module base >= 3.7} +BuildRequires: %{python_module hatch_nodejs_version} BuildRequires: %{python_module hatchling} -BuildRequires: %{python_module hatch-nodejs-version} +BuildRequires: %{python_module pip} BuildRequires: fdupes +BuildRequires: python-rpm-macros Requires: (python-importlib-metadata if python-base < 3.10) Requires: (python-y-py >= 0.5.3 with python-y-py < 0.6.0) +BuildArch: noarch # SECTION test BuildRequires: %{python_module importlib-metadata if %python-base < 3.10} -BuildRequires: %{python_module y-py >= 0.5.3 with %python-y-py < 0.6.0} +BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest} +BuildRequires: %{python_module websockets >= 10.0} +BuildRequires: %{python_module y-py >= 0.5.3 with %python-y-py < 0.6.0} +BuildRequires: %{python_module ypy-websocket >= 0.3.1} +BuildRequires: nodejs # /SECTION -BuildArch: noarch %python_subpackages %description @@ -45,9 +56,8 @@ Built-in documents include: - `YUnicode`: a generic UTF8-encoded text document (`YFile` is an alias to `YUnicode`). - `YNotebook`: a Jupyter notebook document. - %prep -%setup -q -n jupyter-ydoc-%{version} +%setup -q -n jupyter_ydoc-%{version} -b1 -a2 %build %pyproject_wheel @@ -61,6 +71,6 @@ Built-in documents include: %files %{python_files} %{python_sitelib}/jupyter_ydoc -%{python_sitelib}/jupyter_ydoc-%{release}.dist-info +%{python_sitelib}/jupyter_ydoc-%{version}.dist-info %changelog