Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-hatchling for 
openSUSE:Factory checked in at 2026-09-04 12:35:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-hatchling (Old)
 and      /work/SRC/openSUSE:Factory/.python-hatchling.new.1265 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-hatchling"

Fri Sep  4 12:35:57 2026 rev:37 rq:1375111 version:1.32.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-hatchling/python-hatchling.changes        
2026-07-10 17:34:27.247063016 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-hatchling.new.1265/python-hatchling.changes  
    2026-09-04 12:36:02.867392351 +0200
@@ -1,0 +2,20 @@
+Tue Aug 18 19:21:10 UTC 2026 - BenoĆ®t Monin <[email protected]>
+
+- update to version 1.32.0
+  * Changed:
+    + Bump default core metadata version to 2.5
+    + Add tomlkit as a runtime dependency, which is required
+      to rewrite pyproject.toml when setting a static version
+  * Added:
+    + The version command can now set a version that is statically
+      defined by the project.version field, updating pyproject.toml
+      in place. Pass --force to allow an explicit downgrade
+  * Fixed:
+    + Allow the ; private annotation on project.import-names
+      and project.import-namespaces entries rather than rejecting
+      them as invalid import names.
+    + Reject project.readme paths that are absolute or resolve
+      outside of the project directory.
+- add python-tomlkit as a dependency
+
+-------------------------------------------------------------------

Old:
----
  hatchling-1.31.0.tar.gz

New:
----
  hatchling-1.32.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-hatchling.spec ++++++
--- /var/tmp/diff_new_pack.ZGkBby/_old  2026-09-04 12:36:04.277441858 +0200
+++ /var/tmp/diff_new_pack.ZGkBby/_new  2026-09-04 12:36:04.280441963 +0200
@@ -24,7 +24,7 @@
 %{?pythons_for_pypi}
 %{?sle15_python_module_pythons}
 Name:           python-hatchling
-Version:        1.31.0
+Version:        1.32.0
 Release:        0
 Summary:        Build backend used by Hatch
 License:        MIT
@@ -36,12 +36,14 @@
 BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module pluggy >= 1.0.0}
 BuildRequires:  %{python_module tomli >= 1.2.2 if %python-base < 3.11}
+BuildRequires:  %{python_module tomlkit >= 0.11.1}
 BuildRequires:  %{python_module trove-classifiers}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 Requires:       python-packaging >= 21.3
 Requires:       python-pathspec >= 0.10.1
 Requires:       python-pluggy >= 1.0.0
+Requires:       python-tomlkit >= 0.11.1
 Requires:       python-trove-classifiers
 Requires:       (python-tomli >= 1.2.2 if python-base < 3.11)
 BuildArch:      noarch

++++++ hatchling-1.31.0.tar.gz -> hatchling-1.32.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.31.0/PKG-INFO 
new/hatchling-1.32.0/PKG-INFO
--- old/hatchling-1.31.0/PKG-INFO       2020-02-02 01:00:00.000000000 +0100
+++ new/hatchling-1.32.0/PKG-INFO       2020-02-02 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
-Metadata-Version: 2.4
+Metadata-Version: 2.5
 Name: hatchling
-Version: 1.31.0
+Version: 1.32.0
 Summary: Modern, extensible Python build backend
 Project-URL: Homepage, https://hatch.pypa.io/latest/
 Project-URL: Sponsor, https://github.com/sponsors/ofek
@@ -29,6 +29,7 @@
 Requires-Dist: pathspec>=0.10.1
 Requires-Dist: pluggy>=1.0.0
 Requires-Dist: tomli>=1.2.2; python_version < '3.11'
+Requires-Dist: tomlkit>=0.11.1
 Requires-Dist: trove-classifiers
 Description-Content-Type: text/markdown
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.31.0/pyproject.toml 
new/hatchling-1.32.0/pyproject.toml
--- old/hatchling-1.31.0/pyproject.toml 2020-02-02 01:00:00.000000000 +0100
+++ new/hatchling-1.32.0/pyproject.toml 2020-02-02 01:00:00.000000000 +0100
@@ -38,6 +38,7 @@
   "packaging>=24.2",
   "pathspec>=0.10.1",
   "pluggy>=1.0.0",
+  "tomlkit>=0.11.1",
   "tomli>=1.2.2; python_version < '3.11'",
   "trove-classifiers",
 ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.31.0/src/hatchling/__about__.py 
new/hatchling-1.32.0/src/hatchling/__about__.py
--- old/hatchling-1.31.0/src/hatchling/__about__.py     2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.32.0/src/hatchling/__about__.py     2020-02-02 
01:00:00.000000000 +0100
@@ -1 +1 @@
-__version__ = "1.31.0"
+__version__ = "1.32.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/hatchling-1.31.0/src/hatchling/builders/hooks/plugin/hooks.py 
new/hatchling-1.32.0/src/hatchling/builders/hooks/plugin/hooks.py
--- old/hatchling-1.31.0/src/hatchling/builders/hooks/plugin/hooks.py   
2020-02-02 01:00:00.000000000 +0100
+++ new/hatchling-1.32.0/src/hatchling/builders/hooks/plugin/hooks.py   
2020-02-02 01:00:00.000000000 +0100
@@ -12,4 +12,5 @@
 
 @hookimpl
 def hatch_register_build_hook() -> list[type[BuildHookInterface]]:
-    return [CustomBuildHook, VersionBuildHook]
+    # CustomBuildHook fakes its type via `__new__`; it is not a real subclass
+    return [CustomBuildHook, VersionBuildHook]  # type: ignore[list-item]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/hatchling-1.31.0/src/hatchling/cli/version/__init__.py 
new/hatchling-1.32.0/src/hatchling/cli/version/__init__.py
--- old/hatchling-1.31.0/src/hatchling/cli/version/__init__.py  2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.32.0/src/hatchling/cli/version/__init__.py  2020-02-02 
01:00:00.000000000 +0100
@@ -7,6 +7,7 @@
 def version_impl(
     *,
     called_by_app: bool,  # noqa: ARG001
+    force: bool,
     desired_version: str,
 ) -> None:
     import os
@@ -22,11 +23,30 @@
     metadata = ProjectMetadata(root, plugin_manager)
 
     if "version" in metadata.config.get("project", {}):
+        import tomlkit
+
+        project_file_path = os.path.join(root, "pyproject.toml")
+
+        with open(project_file_path, encoding="utf-8") as fr:
+            raw_config = tomlkit.parse(fr.read())
+        version = raw_config["project"]["version"]
+
         if desired_version:
-            app.abort("Cannot set version when it is statically defined by the 
`project.version` field")
+            from hatchling.version.scheme.standard import StandardScheme
+
+            scheme_config = {"validate-bump": False} if force else {}
+            scheme = StandardScheme(root, scheme_config)
+            updated_version = scheme.update(desired_version, version, {})
+            raw_config["project"]["version"] = updated_version
+
+            with open(project_file_path, "w", encoding="utf-8") as fw:
+                fw.write(tomlkit.dumps(raw_config))
+
+            app.display_info(f"Old: {version}")
+            app.display_info(f"New: {updated_version}")
         else:
-            app.display(metadata.core.version)
-            return
+            app.display(version)
+        return
 
     source = metadata.hatch.version.source
 
@@ -48,4 +68,5 @@
     parser = subparsers.add_parser("version")
     parser.add_argument("desired_version", default="", nargs="?", **defaults)
     parser.add_argument("--app", dest="called_by_app", action="store_true", 
help=argparse.SUPPRESS)
+    parser.add_argument("--force", action="store_true", help="Allow an 
explicit downgrading version to be given")
     parser.set_defaults(func=version_impl)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.31.0/src/hatchling/metadata/core.py 
new/hatchling-1.32.0/src/hatchling/metadata/core.py
--- old/hatchling-1.31.0/src/hatchling/metadata/core.py 2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.32.0/src/hatchling/metadata/core.py 2020-02-02 
01:00:00.000000000 +0100
@@ -8,6 +8,7 @@
 
 from hatchling.metadata.utils import (
     format_dependency,
+    is_valid_import_name,
     is_valid_project_name,
     normalize_project_name,
     normalize_requirement,
@@ -528,6 +529,9 @@
                     raise TypeError(message)
 
                 readme_path = os.path.normpath(os.path.join(self.root, readme))
+                if os.path.isabs(readme) or os.path.relpath(readme_path, 
self.root).startswith(".."):
+                    message = f"Readme path must be within the project 
directory: {readme}"
+                    raise ValueError(message)
                 if not os.path.isfile(readme_path):
                     message = f"Readme file does not exist: {readme}"
                     raise OSError(message)
@@ -565,6 +569,9 @@
                         raise TypeError(message)
 
                     path = os.path.normpath(os.path.join(self.root, 
relative_path))
+                    if os.path.isabs(relative_path) or os.path.relpath(path, 
self.root).startswith(".."):
+                        message = f"Readme path must be within the project 
directory: {relative_path}"
+                        raise ValueError(message)
                     if not os.path.isfile(path):
                         message = f"Readme file does not exist: 
{relative_path}"
                         raise OSError(message)
@@ -1361,7 +1368,7 @@
                 raise TypeError(message)
 
             for i, import_name in enumerate(import_names, 1):
-                if not isinstance(import_name, str) or not 
self.__import_name_is_valid(import_name):
+                if not isinstance(import_name, str) or not 
is_valid_import_name(import_name):
                     message = f"Import name #{i} of field 
`project.import-names` must be a valid import name"
                     raise TypeError(message)
 
@@ -1395,7 +1402,7 @@
                 raise TypeError(message)
 
             for i, import_namespace in enumerate(import_namespaces, 1):
-                if not isinstance(import_namespace, str) or not 
self.__import_name_is_valid(import_namespace):
+                if not isinstance(import_namespace, str) or not 
is_valid_import_name(import_namespace):
                     message = f"Import namespace #{i} of field 
`project.import-namespaces` must be a valid import name"
                     raise TypeError(message)
 
@@ -1440,10 +1447,6 @@
     def __classifier_is_private(classifier: str) -> bool:
         return classifier.lower().startswith("private ::")
 
-    @staticmethod
-    def __import_name_is_valid(import_name: str) -> bool:
-        return all(module.isidentifier() for module in import_name.split("."))
-
 
 class HatchMetadata(Generic[PluginManagerBound]):
     def __init__(self, root: str, config: dict[str, dict[str, Any]], 
plugin_manager: PluginManagerBound) -> None:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.31.0/src/hatchling/metadata/spec.py 
new/hatchling-1.32.0/src/hatchling/metadata/spec.py
--- old/hatchling-1.31.0/src/hatchling/metadata/spec.py 2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.32.0/src/hatchling/metadata/spec.py 2020-02-02 
01:00:00.000000000 +0100
@@ -2,12 +2,14 @@
 
 from typing import TYPE_CHECKING, Any
 
+from hatchling.metadata.utils import split_import_name_annotation
+
 if TYPE_CHECKING:
     from collections.abc import Callable
 
     from hatchling.metadata.core import ProjectMetadata
 
-DEFAULT_METADATA_VERSION = "2.4"
+DEFAULT_METADATA_VERSION = "2.5"
 LATEST_METADATA_VERSION = "2.5"
 CORE_METADATA_PROJECT_FIELDS = {
     "Author": ("authors",),
@@ -633,12 +635,14 @@
             metadata_file += "Import-Name\n"
 
         for import_name in metadata.core.import_names:
-            _name = f"{import_name}; private" if import_name.startswith("_") 
else import_name
+            name, private = split_import_name_annotation(import_name)
+            _name = f"{name}; private" if private or name.startswith("_") else 
name
             metadata_file += f"Import-Name: {_name}\n"
 
     if metadata.core.import_namespaces:
         for import_namespace in metadata.core.import_namespaces:
-            _name = f"{import_namespace}; private" if 
import_namespace.startswith("_") else import_namespace
+            name, private = split_import_name_annotation(import_namespace)
+            _name = f"{name}; private" if private or name.startswith("_") else 
name
             metadata_file += f"Import-Namespace: {_name}\n"
 
     if metadata.core.dynamic:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.31.0/src/hatchling/metadata/utils.py 
new/hatchling-1.32.0/src/hatchling/metadata/utils.py
--- old/hatchling-1.31.0/src/hatchling/metadata/utils.py        2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.32.0/src/hatchling/metadata/utils.py        2020-02-02 
01:00:00.000000000 +0100
@@ -21,6 +21,27 @@
     return re.sub(r"[-_.]+", "-", project_name).lower()
 
 
+def split_import_name_annotation(import_name: str) -> tuple[str, bool]:
+    # 
https://packaging.python.org/en/latest/specifications/pyproject-toml/#import-names
+    # 
https://packaging.python.org/en/latest/specifications/pyproject-toml/#import-namespaces
+    #
+    # An import name MAY be followed by `; private`, with any amount of 
whitespace surrounding
+    # the semicolon. Returns the bare name and whether it was annotated 
private.
+    if ";" not in import_name:
+        return import_name, False
+
+    name, annotation = import_name.split(";", 1)
+    return name.strip(), annotation.strip() == "private"
+
+
+def is_valid_import_name(import_name: str) -> bool:
+    name, annotated_private = split_import_name_annotation(import_name)
+    if ";" in import_name and not annotated_private:
+        return False
+
+    return all(module.isidentifier() for module in name.split("."))
+
+
 def normalize_requirement(requirement: Requirement) -> None:
     # Changes to this function affect reproducibility between versions
     from packaging.specifiers import SpecifierSet
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.31.0/src/hatchling/utils/context.py 
new/hatchling-1.32.0/src/hatchling/utils/context.py
--- old/hatchling-1.31.0/src/hatchling/utils/context.py 2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.32.0/src/hatchling/utils/context.py 2020-02-02 
01:00:00.000000000 +0100
@@ -14,6 +14,8 @@
 
 
 class ContextFormatter(ABC):
+    CONTEXT_NAME: str
+
     @abstractmethod
     def get_formatters(self) -> MutableMapping:
         """
@@ -109,7 +111,7 @@
     def format(self, *args: Any, **kwargs: Any) -> str:
         return self.__formatter.format(*args, **kwargs)
 
-    def add_context(self, context: DefaultContextFormatter) -> None:
+    def add_context(self, context: ContextFormatter) -> None:
         if context.CONTEXT_NAME in self.__configured_contexts:
             return
 
@@ -117,7 +119,7 @@
         self.__configured_contexts.add(context.CONTEXT_NAME)
 
     @contextmanager
-    def apply_context(self, context: DefaultContextFormatter) -> Iterator:
+    def apply_context(self, context: ContextFormatter) -> Iterator:
         self.__add_formatters(context.get_formatters())
         try:
             yield

Reply via email to