diff --git a/no-hatch-nodejs-version.patch b/no-hatch-nodejs-version.patch new file mode 100644 index 0000000..4550c47 --- /dev/null +++ b/no-hatch-nodejs-version.patch @@ -0,0 +1,29 @@ +--- + pyproject.toml | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,10 +1,10 @@ + [build-system] +-requires = ["hatchling>=1.5", "hatch-nodejs-version"] ++requires = ["hatchling>=1.5"] + build-backend = "hatchling.build" + + [project] + name = "nbformat" +-dynamic = ["version"] ++version = "@@@" + description = "The Jupyter Notebook format" + license = { file = "LICENSE" } + keywords = ["Interactive", "Interpreter", "Shell", "Web"] +@@ -58,9 +58,6 @@ test = [ + [project.scripts] + jupyter-trust = "nbformat.sign:TrustNotebookApp.launch_instance" + +-[tool.hatch.version] +-source = "nodejs" +- + [tool.hatch.envs.docs] + features = ["docs"] + [tool.hatch.envs.docs.scripts] diff --git a/no-pep440.patch b/no-pep440.patch new file mode 100644 index 0000000..321f096 --- /dev/null +++ b/no-pep440.patch @@ -0,0 +1,40 @@ +--- + pyproject.toml | 3 +-- + tests/test_api.py | 5 ----- + 2 files changed, 1 insertion(+), 7 deletions(-) + +Index: nbformat-5.9.2/pyproject.toml +=================================================================== +--- nbformat-5.9.2.orig/pyproject.toml ++++ nbformat-5.9.2/pyproject.toml +@@ -52,7 +52,6 @@ test = [ + "testpath", + "pytest", + "pre-commit", +- "pep440" + ] + + [project.scripts] +Index: nbformat-5.9.2/tests/test_api.py +=================================================================== +--- nbformat-5.9.2.orig/tests/test_api.py ++++ nbformat-5.9.2/tests/test_api.py +@@ -10,7 +10,6 @@ from tempfile import TemporaryDirectory + from typing import Any, Dict + + from jsonschema import ValidationError +-from pep440 import is_canonical + + from nbformat import __version__ as nbf_version + from nbformat import current_nbformat, read, write, writes +@@ -20,10 +19,6 @@ from nbformat.validator import isvalid + from .base import TestsBase + + +-def test_canonical_version(): +- assert is_canonical(nbf_version) +- +- + class TestAPI(TestsBase): + def test_read(self): + """Can older notebooks be opened and automatically converted to the current diff --git a/python-nbformat.changes b/python-nbformat.changes index 95878bd..ca8795c 100644 --- a/python-nbformat.changes +++ b/python-nbformat.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Thu Oct 26 18:38:02 UTC 2023 - Ben Greiner + +- Actually remove pep440 from test requirements + +------------------------------------------------------------------- +Thu Oct 26 18:09:45 UTC 2023 - Matej Cepl + +- Add no-hatch-nodejs-version.patch to remove dependency on + hatch-nodejs-version +- Add no-pep440.patch to remove unnecessary checking for the + validity of the package version number. + ------------------------------------------------------------------- Sat Aug 5 16:29:03 UTC 2023 - Arun Persaud diff --git a/python-nbformat.spec b/python-nbformat.spec index e131948..7c9ea64 100644 --- a/python-nbformat.spec +++ b/python-nbformat.spec @@ -25,8 +25,13 @@ License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/jupyter/nbformat Source: https://github.com/jupyter/nbformat/releases/download/v%{version}/nbformat-%{version}.tar.gz +# PATCH-FEATURE-OPENSUSE no-hatch-nodejs-version.patch mcepl@suse.com +# We don’t need hatch-nodejs-version dependency +Patch0: no-hatch-nodejs-version.patch +# PATCH-FEATURE-OPENSUSE no-pep440.patch mcepl@suse.com +# We don’t need pep440 check either +Patch1: no-pep440.patch BuildRequires: %{python_module base >= 3.8} -BuildRequires: %{python_module hatch_nodejs_version} BuildRequires: %{python_module hatchling >= 1.5} BuildRequires: %{python_module pip} BuildRequires: fdupes @@ -50,7 +55,6 @@ Requires(postun):update-alternatives BuildRequires: %{python_module fastjsonschema} BuildRequires: %{python_module jsonschema > 2.6} BuildRequires: %{python_module jupyter_core} -BuildRequires: %{python_module pep440} BuildRequires: %{python_module pytest} BuildRequires: %{python_module testpath} BuildRequires: %{python_module traitlets >= 5.1} @@ -65,8 +69,8 @@ and Python APIs for working with notebooks. This package provides the python interface. %prep -%setup -q -n nbformat-%{version} -sed -i 's/--color=yes//' pyproject.toml +%autosetup -p1 -n nbformat-%{version} +sed -i -e 's/--color=yes//' -e 's/\@\@\@/%{version}/' pyproject.toml %build %pyproject_wheel