- 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/package/show/devel:languages:python:jupyter/python-nbformat?expand=0&rev=52
This commit is contained in:
Matej Cepl 2023-10-26 18:18:01 +00:00 committed by Git OBS Bridge
parent 48e8cce0b4
commit d73edaf06a
4 changed files with 83 additions and 3 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]

38
no-pep440.patch Normal file
View File

@ -0,0 +1,38 @@
---
pyproject.toml | 3 +--
tests/test_api.py | 5 -----
2 files changed, 1 insertion(+), 7 deletions(-)
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -51,8 +51,7 @@ docs = [
test = [
"testpath",
"pytest",
- "pre-commit",
- "pep440"
+ "pre-commit"
]
[project.scripts]
--- a/tests/test_api.py
+++ b/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,11 @@
-------------------------------------------------------------------
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>

View File

@ -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 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 hatch_nodejs_version}
BuildRequires: %{python_module hatchling >= 1.5}
BuildRequires: %{python_module pip}
BuildRequires: fdupes
@ -65,8 +70,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