Accepting request 1120632 from devel:languages:python:jupyter

- Actually remove pep440 from test requirements

- 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.

OBS-URL: https://build.opensuse.org/request/show/1120632
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nbformat?expand=0&rev=22
This commit is contained in:
Ana Guerrero 2023-10-27 20:28:17 +00:00 committed by Git OBS Bridge
commit a75f0db23b
4 changed files with 90 additions and 4 deletions

View File

@ -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]

40
no-pep440.patch Normal file
View File

@ -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

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Thu Oct 26 18:38:02 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Actually remove pep440 from test requirements
-------------------------------------------------------------------
Thu Oct 26 18:09:45 UTC 2023 - Matej Cepl <mcepl@cepl.eu>
- 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 <arun@gmx.de> Sat Aug 5 16:29:03 UTC 2023 - Arun Persaud <arun@gmx.de>

View File

@ -25,8 +25,13 @@ License: BSD-3-Clause
Group: Development/Languages/Python Group: Development/Languages/Python
URL: https://github.com/jupyter/nbformat URL: https://github.com/jupyter/nbformat
Source: https://github.com/jupyter/nbformat/releases/download/v%{version}/nbformat-%{version}.tar.gz 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 dont need hatch-nodejs-version dependency
Patch0: no-hatch-nodejs-version.patch
# PATCH-FEATURE-OPENSUSE no-pep440.patch mcepl@suse.com
# We dont need pep440 check either
Patch1: no-pep440.patch
BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module hatch_nodejs_version}
BuildRequires: %{python_module hatchling >= 1.5} BuildRequires: %{python_module hatchling >= 1.5}
BuildRequires: %{python_module pip} BuildRequires: %{python_module pip}
BuildRequires: fdupes BuildRequires: fdupes
@ -50,7 +55,6 @@ Requires(postun):update-alternatives
BuildRequires: %{python_module fastjsonschema} BuildRequires: %{python_module fastjsonschema}
BuildRequires: %{python_module jsonschema > 2.6} BuildRequires: %{python_module jsonschema > 2.6}
BuildRequires: %{python_module jupyter_core} BuildRequires: %{python_module jupyter_core}
BuildRequires: %{python_module pep440}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module testpath} BuildRequires: %{python_module testpath}
BuildRequires: %{python_module traitlets >= 5.1} BuildRequires: %{python_module traitlets >= 5.1}
@ -65,8 +69,8 @@ and Python APIs for working with notebooks.
This package provides the python interface. This package provides the python interface.
%prep %prep
%setup -q -n nbformat-%{version} %autosetup -p1 -n nbformat-%{version}
sed -i 's/--color=yes//' pyproject.toml sed -i -e 's/--color=yes//' -e 's/\@\@\@/%{version}/' pyproject.toml
%build %build
%pyproject_wheel %pyproject_wheel