Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-jsonschema-path for
openSUSE:Factory checked in at 2026-04-29 19:18:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jsonschema-path (Old)
and /work/SRC/openSUSE:Factory/.python-jsonschema-path.new.30200 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jsonschema-path"
Wed Apr 29 19:18:28 2026 rev:5 rq:1349866 version:0.4.6
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-jsonschema-path/python-jsonschema-path.changes
2026-03-16 15:49:11.833967725 +0100
+++
/work/SRC/openSUSE:Factory/.python-jsonschema-path.new.30200/python-jsonschema-path.changes
2026-04-29 19:19:31.357207717 +0200
@@ -1,0 +2,6 @@
+Tue Apr 28 20:35:00 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 0.4.6:
+ * Fix YAML scientific notation parsing for floats #257
+
+-------------------------------------------------------------------
Old:
----
jsonschema-path-0.4.5.tar.gz
New:
----
jsonschema-path-0.4.6.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-jsonschema-path.spec ++++++
--- /var/tmp/diff_new_pack.NIHtFr/_old 2026-04-29 19:19:31.841227545 +0200
+++ /var/tmp/diff_new_pack.NIHtFr/_new 2026-04-29 19:19:31.841227545 +0200
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-jsonschema-path
-Version: 0.4.5
+Version: 0.4.6
Release: 0
Summary: JSONSchema Spec with object-oriented paths
License: Apache-2.0
++++++ jsonschema-path-0.4.5.tar.gz -> jsonschema-path-0.4.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonschema-path-0.4.5/jsonschema_path/__init__.py
new/jsonschema-path-0.4.6/jsonschema_path/__init__.py
--- old/jsonschema-path-0.4.5/jsonschema_path/__init__.py 2026-03-03
10:55:56.000000000 +0100
+++ new/jsonschema-path-0.4.6/jsonschema_path/__init__.py 2026-04-27
20:56:09.000000000 +0200
@@ -4,7 +4,7 @@
__author__ = "Artur Maciag"
__email__ = "[email protected]"
-__version__ = "0.4.5"
+__version__ = "0.4.6"
__url__ = "https://github.com/p1c2u/jsonschema-path"
__license__ = "Apache-2.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonschema-path-0.4.5/jsonschema_path/loaders.py
new/jsonschema-path-0.4.6/jsonschema_path/loaders.py
--- old/jsonschema-path-0.4.5/jsonschema_path/loaders.py 2026-03-03
10:55:56.000000000 +0100
+++ new/jsonschema-path-0.4.6/jsonschema_path/loaders.py 2026-04-27
20:56:09.000000000 +0200
@@ -1,7 +1,9 @@
# Use CSafeFile if available
+import re
from collections.abc import Iterable
from typing import TYPE_CHECKING
from typing import Any
+from typing import cast
if TYPE_CHECKING:
from yaml import SafeLoader
@@ -17,6 +19,24 @@
]
+SCIENTIFIC_FLOAT_RE = re.compile(
+ r"""
+ ^(?:
+ [-+]?
+ (?:
+ (?:0|[1-9][0-9]*)\.[0-9]*
+ |
+ \.[0-9]+
+ |
+ (?:0|[1-9][0-9]*)
+ )
+ [eE][-+]?[0-9]+
+ )$
+ """,
+ re.VERBOSE,
+)
+
+
class LimitedSafeLoader(type):
"""Meta YAML loader that skips the resolution of the specified YAML
tags."""
@@ -49,3 +69,10 @@
exclude_resolvers={"tag:yaml.org,2002:timestamp"},
):
"""A safe YAML loader that leaves timestamps as strings."""
+
+
+cast(type[SafeLoader], JsonschemaSafeLoader).add_implicit_resolver( # type:
ignore[no-untyped-call]
+ "tag:yaml.org,2002:float",
+ SCIENTIFIC_FLOAT_RE,
+ list("-+0123456789."),
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonschema-path-0.4.5/pyproject.toml
new/jsonschema-path-0.4.6/pyproject.toml
--- old/jsonschema-path-0.4.5/pyproject.toml 2026-03-03 10:55:56.000000000
+0100
+++ new/jsonschema-path-0.4.6/pyproject.toml 2026-04-27 20:56:09.000000000
+0200
@@ -19,7 +19,7 @@
[tool.poetry]
name = "jsonschema-path"
-version = "0.4.5"
+version = "0.4.6"
description = "JSONSchema Spec with object-oriented paths"
authors = ["Artur Maciag <[email protected]>"]
license = "Apache-2.0"
@@ -93,7 +93,7 @@
tag_template = "{new_version}"
[tool.tbump.version]
-current = "0.4.5"
+current = "0.4.6"
regex = '''
(?P<major>\d+)
\.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jsonschema-path-0.4.5/tests/unit/handlers/test_file.py
new/jsonschema-path-0.4.6/tests/unit/handlers/test_file.py
--- old/jsonschema-path-0.4.5/tests/unit/handlers/test_file.py 2026-03-03
10:55:56.000000000 +0100
+++ new/jsonschema-path-0.4.6/tests/unit/handlers/test_file.py 2026-04-27
20:56:09.000000000 +0200
@@ -1,10 +1,57 @@
+from io import StringIO
from pathlib import Path
import pytest
+from jsonschema_path.handlers.file import FileHandler
from jsonschema_path.handlers.file import FilePathHandler
+class TestFileHandler:
+ @pytest.mark.parametrize(
+ ("yaml_data", "expected"),
+ [
+ ("maximum: 1e2", 100.0),
+ ("maximum: 1e+2", 100.0),
+ ("maximum: 1e-2", 0.01),
+ ("maximum: -1e2", -100.0),
+ ("maximum: +1E2", 100.0),
+ ("maximum: 1.0e2", 100.0),
+ ("maximum: .1e2", 10.0),
+ ("maximum: 1.e2", 100.0),
+ ],
+ )
+ def test_scientific_notation_parses_as_float(self, yaml_data, expected):
+ result = FileHandler()(StringIO(yaml_data))
+
+ assert result["maximum"] == expected
+ assert type(result["maximum"]) is float
+
+ def test_quoted_scientific_notation_remains_string(self):
+ result = FileHandler()(StringIO('maximum: "1e2"'))
+
+ assert result["maximum"] == "1e2"
+ assert type(result["maximum"]) is str
+
+ def test_timestamp_remains_string(self):
+ result = FileHandler()(StringIO("created: 2024-01-01"))
+
+ assert result["created"] == "2024-01-01"
+ assert type(result["created"]) is str
+
+ def test_leading_zero_scientific_notation_remains_string(self):
+ result = FileHandler()(StringIO("maximum: 01e2"))
+
+ assert result["maximum"] == "01e2"
+ assert type(result["maximum"]) is str
+
+ def test_underscored_scientific_notation_remains_string(self):
+ result = FileHandler()(StringIO("maximum: 1_0e2"))
+
+ assert result["maximum"] == "1_0e2"
+ assert type(result["maximum"]) is str
+
+
class TestFilePathHandler:
def test_invalid_scheme(self):
uri = "invalid:///"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jsonschema-path-0.4.5/tests/unit/test_paths.py
new/jsonschema-path-0.4.6/tests/unit/test_paths.py
--- old/jsonschema-path-0.4.5/tests/unit/test_paths.py 2026-03-03
10:55:56.000000000 +0100
+++ new/jsonschema-path-0.4.6/tests/unit/test_paths.py 2026-04-27
20:56:09.000000000 +0200
@@ -1,4 +1,6 @@
+from io import StringIO
from pathlib import Path
+from tempfile import NamedTemporaryFile
from typing import Any
from typing import cast
from unittest import mock
@@ -151,6 +153,20 @@
resolved_cache_maxsize=-1,
)
+ @pytest.mark.parametrize(
+ ("yaml_data", "expected"),
+ [
+ ("maximum: 1e2", 100.0),
+ ("maximum: .1e2", 10.0),
+ ("maximum: 1.e2", 100.0),
+ ],
+ )
+ def test_parses_scientific_notation_as_float(self, yaml_data, expected):
+ sp = SchemaPath.from_file(StringIO(yaml_data))
+
+ assert (sp // "maximum").read_value() == expected
+ assert type((sp // "maximum").read_value()) is float
+
class TestSchemaPathFromPath:
def test_file_no_exist(self, create_file):
@@ -227,6 +243,19 @@
resolved_cache_maxsize=-1,
)
+ def test_parses_scientific_notation_as_float(self):
+ with NamedTemporaryFile("w", suffix=".yaml", delete=False) as tf:
+ tf.write("maximum: 1e2")
+ schema_file_path_str = tf.name
+
+ try:
+ sp = SchemaPath.from_file_path(schema_file_path_str)
+
+ assert (sp // "maximum").read_value() == 100.0
+ assert type((sp // "maximum").read_value()) is float
+ finally:
+ Path(schema_file_path_str).unlink()
+
class TestSchemaPathGetkey:
def test_returns_nested_value(self, create_file):