Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-unearth for openSUSE:Factory 
checked in at 2026-02-09 11:43:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-unearth (Old)
 and      /work/SRC/openSUSE:Factory/.python-unearth.new.1670 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-unearth"

Mon Feb  9 11:43:59 2026 rev:12 rq:1331928 version:0.18.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-unearth/python-unearth.changes    
2025-05-20 09:37:40.120248000 +0200
+++ /work/SRC/openSUSE:Factory/.python-unearth.new.1670/python-unearth.changes  
2026-02-09 11:44:19.812195987 +0100
@@ -1,0 +2,13 @@
+Mon Feb  9 05:17:29 UTC 2026 - Steve Kowalik <[email protected]>
+
+- Update to 0.18.2:
+  ## Features
+  * Support Python 3.14 and drop support for Python 3.8
+  ## Bug Fixes
+  * Allow again branches in git URLs
+  * Ensure repository is reset to the correct revision during fetch
+  * Support git urls with refs
+- Add patch support-packaging-26.patch:
+  * Support changes required by packaging 26.0.
+
+-------------------------------------------------------------------

Old:
----
  unearth-0.17.5.tar.gz

New:
----
  support-packaging-26.patch
  unearth-0.18.2.tar.gz

----------(New B)----------
  New:  * Support git urls with refs
- Add patch support-packaging-26.patch:
  * Support changes required by packaging 26.0.
----------(New E)----------

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

Other differences:
------------------
++++++ python-unearth.spec ++++++
--- /var/tmp/diff_new_pack.3pNF5t/_old  2026-02-09 11:44:20.276215509 +0100
+++ /var/tmp/diff_new_pack.3pNF5t/_new  2026-02-09 11:44:20.276215509 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-unearth
 #
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,13 +18,15 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-unearth
-Version:        0.17.5
+Version:        0.18.2
 Release:        0
 Summary:        A utility to fetch and download python packages
 License:        MIT
 URL:            https://unearth.readthedocs.io/
 Source:         
https://files.pythonhosted.org/packages/source/u/unearth/unearth-%{version}.tar.gz
-BuildRequires:  %{python_module base >= 3.8}
+# PATCH-FIX-UPSTREAM gh#frostming/unearth#176
+Patch0:         support-packaging-26.patch
+BuildRequires:  %{python_module base >= 3.9}
 BuildRequires:  %{python_module packaging >= 20}
 BuildRequires:  %{python_module pdm-backend}
 BuildRequires:  %{python_module pip}
@@ -57,7 +59,7 @@
 They provide all the low-level functionalities that are needed to resolve and 
install packages.
 
 %prep
-%setup -q -n unearth-%{version}
+%autosetup -p1 -n unearth-%{version}
 
 %build
 %pyproject_wheel

++++++ support-packaging-26.patch ++++++
>From 0385a1807ae292a916485fd06770594afad1f04f Mon Sep 17 00:00:00 2001
From: Steve Kowalik <[email protected]>
Date: Mon, 9 Feb 2026 15:38:14 +1100
Subject: [PATCH] fix: support packaging 26.0 changes

packaging 26.0 changed how Specifier.contains() behaves with
prereleases=None[0], so call it with False explicitly in the two
tests that fail without it.

0: https://github.com/pypa/packaging/issues/895

Signed-off-by: Steve Kowalik <[email protected]>
---
 tests/test_evaluator.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test_evaluator.py b/tests/test_evaluator.py
index 0412eb7..4b89d8c 100644
--- a/tests/test_evaluator.py
+++ b/tests/test_evaluator.py
@@ -251,9 +251,9 @@ def test_evaluate_compatibility_tags(link, expected, 
ignore_compatibility):
         ("8.1.3", ">=8.0", None, True),
         ("7.1", ">=8.0", None, False),
         ("8.0.0a0", ">=8.0.0dev0", None, True),
-        ("8.0.0dev0", ">=7", None, False),
+        ("8.0.0dev0", ">=7", False, False),
         ("8.0.0dev0", ">=7", True, True),
-        ("8.0.0a0", "", None, False),
+        ("8.0.0a0", "", False, False),
         ("8.0.0a0", ">=8.0.0dev0", False, False),
     ],
 )

++++++ unearth-0.17.5.tar.gz -> unearth-0.18.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unearth-0.17.5/PKG-INFO new/unearth-0.18.2/PKG-INFO
--- old/unearth-0.17.5/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
+++ new/unearth-0.18.2/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
@@ -1,22 +1,24 @@
-Metadata-Version: 2.1
+Metadata-Version: 2.4
 Name: unearth
-Version: 0.17.5
+Version: 0.18.2
 Summary: A utility to fetch and download python packages
 Author-Email: Frost Ming <[email protected]>
-License: MIT
+License-Expression: MIT
+License-File: LICENSE
 Classifier: Development Status :: 3 - Alpha
 Classifier: Intended Audience :: Developers
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
 Classifier: Programming Language :: Python :: 3.10
 Classifier: Programming Language :: Python :: 3.11
 Classifier: Programming Language :: Python :: 3.12
+Classifier: Programming Language :: Python :: 3.13
+Classifier: Programming Language :: Python :: 3.14
 Classifier: Programming Language :: Python :: 3 :: Only
 Project-URL: Homepage, https://github.com/frostming/unearth
 Project-URL: Documentation, https://unearth.readthedocs.io
 Project-URL: Changelog, https://github.com/frostming/unearth/releases
-Requires-Python: >=3.8
+Requires-Python: >=3.9
 Requires-Dist: packaging>=20
 Requires-Dist: httpx<1,>=0.27.0
 Provides-Extra: keyring
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unearth-0.17.5/pyproject.toml 
new/unearth-0.18.2/pyproject.toml
--- old/unearth-0.17.5/pyproject.toml   2025-04-09 04:54:33.046518800 +0200
+++ new/unearth-0.18.2/pyproject.toml   2025-12-23 07:40:14.274020000 +0100
@@ -10,8 +10,12 @@
 authors = [
     { name = "Frost Ming", email = "[email protected]" },
 ]
+license = "MIT"
+license-files = [
+    "LICENSE",
+]
 readme = "README.md"
-requires-python = ">=3.8"
+requires-python = ">=3.9"
 dependencies = [
     "packaging>=20",
     "httpx>=0.27.0,<1",
@@ -21,17 +25,15 @@
     "Development Status :: 3 - Alpha",
     "Intended Audience :: Developers",
     "Programming Language :: Python :: 3",
-    "Programming Language :: Python :: 3.8",
     "Programming Language :: Python :: 3.9",
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
     "Programming Language :: Python :: 3.12",
+    "Programming Language :: Python :: 3.13",
+    "Programming Language :: Python :: 3.14",
     "Programming Language :: Python :: 3 :: Only",
 ]
-version = "0.17.5"
-
-[project.license]
-text = "MIT"
+version = "0.18.2"
 
 [project.urls]
 Homepage = "https://github.com/frostming/unearth";
@@ -79,7 +81,7 @@
 
 [tool.ruff]
 line-length = 88
-target-version = "py38"
+target-version = "py39"
 
 [tool.ruff.lint]
 extend-select = [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unearth-0.17.5/src/unearth/fetchers/sync.py 
new/unearth-0.18.2/src/unearth/fetchers/sync.py
--- old/unearth-0.17.5/src/unearth/fetchers/sync.py     2025-04-09 
04:54:25.928485200 +0200
+++ new/unearth-0.18.2/src/unearth/fetchers/sync.py     2025-12-23 
07:40:02.005991500 +0100
@@ -1,6 +1,6 @@
 from __future__ import annotations
 
-import email
+import email.utils
 import mimetypes
 import os
 from typing import TYPE_CHECKING
@@ -13,9 +13,12 @@
 from unearth.utils import parse_netloc
 
 if TYPE_CHECKING:
+    import ssl
     from typing import Any, ContextManager, Iterable, Mapping
 
-    from httpx._types import CertTypes, TimeoutTypes, VerifyTypes
+    from httpx._types import CertTypes, TimeoutTypes
+
+    VerifyTypes = ssl.SSLContext | bool | str
 
 
 def is_absolute_url(self) -> bool:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unearth-0.17.5/src/unearth/pep425tags.py 
new/unearth-0.18.2/src/unearth/pep425tags.py
--- old/unearth-0.17.5/src/unearth/pep425tags.py        2025-04-09 
04:54:25.928485200 +0200
+++ new/unearth-0.18.2/src/unearth/pep425tags.py        2025-12-23 
07:40:02.005991500 +0100
@@ -67,7 +67,7 @@
 
 
 def _get_custom_platforms(arch: str) -> list[str]:
-    arch_prefix, arch_sep, arch_suffix = arch.partition("_")
+    arch_prefix, *_ = arch.partition("_")
     if arch.startswith("macosx"):
         arches = _mac_platforms(arch)
     elif arch_prefix in ["manylinux2014", "manylinux2010"]:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unearth-0.17.5/src/unearth/vcs/git.py 
new/unearth-0.18.2/src/unearth/vcs/git.py
--- old/unearth-0.17.5/src/unearth/vcs/git.py   2025-04-09 04:54:25.929485300 
+0200
+++ new/unearth-0.18.2/src/unearth/vcs/git.py   2025-12-23 07:40:02.005991500 
+0100
@@ -11,6 +11,11 @@
 from unearth.vcs.base import HiddenText, VersionControl, vcs_support
 
 logger = logging.getLogger(__name__)
+HASH_REGEX = re.compile("^[a-fA-F0-9]{40}$")
+
+
+def looks_like_hash(sha: str) -> bool:
+    return bool(HASH_REGEX.match(sha))
 
 
 @vcs_support.register
@@ -55,9 +60,15 @@
             self.run_command(["clone", *flags, url, str(location)], 
extra_env=env)
 
         if rev is not None:
-            self.run_command(["checkout", rev], cwd=location)
-        revision = self.get_revision(location)
+            if self._should_fetch(location, rev):
+                self.run_command(["fetch", "-q", url, rev], cwd=location)
+                revision = self._resolve_revision(location, "FETCH_HEAD")
+            else:
+                revision = self._resolve_revision(location, rev)
+        else:
+            revision = self.get_revision(location)
         logger.info("Resolved %s to commit %s", url, revision)
+        self.run_command(["reset", "--hard", "-q", revision], cwd=location)
         self._update_submodules(location)
 
     def _update_submodules(self, location: Path) -> None:
@@ -67,13 +78,53 @@
             ["submodule", "update", "--init", "-q", "--recursive"], 
cwd=location
         )
 
+    def _should_fetch(self, dest: Path, rev: str) -> bool:
+        """
+        Return true if rev is a ref or is a commit that we don't have locally.
+
+        Branches and tags are not considered in this method because they are
+        assumed to be always available locally (which is a normal outcome of
+        ``git clone`` and ``git fetch --tags``).
+        """
+        if rev.startswith("refs/"):
+            # Always fetch remote refs.
+            return True
+
+        if not looks_like_hash(rev):
+            # Git fetch would fail with abbreviated commits.
+            return False
+
+        if self.has_commit(dest, rev):
+            # Don't fetch if we have the commit locally.
+            return False
+
+        return True
+
+    def has_commit(self, location: Path, rev: str) -> bool:
+        """
+        Check if rev is a commit that is available in the local repository.
+        """
+        try:
+            self.run_command(
+                ["rev-parse", "-q", "--verify", f"sha^{rev}"],
+                cwd=location,
+            )
+        except UnpackError:
+            return False
+        else:
+            return True
+
     def update(
         self, location: Path, rev: str | None, args: list[str | HiddenText]
     ) -> None:
         self.run_command(["fetch", "-q", "--tags"], cwd=location)
         if rev is not None:
-            self.run_command(["checkout", rev], cwd=location)
-            resolved = self._resolve_revision(location, "HEAD")
+            if self._should_fetch(location, rev):
+                url = self.get_remote_url(location)
+                self.run_command(["fetch", "-q", url, rev], cwd=location)
+                resolved = self._resolve_revision(location, "FETCH_HEAD")
+            else:
+                resolved = self._resolve_revision(location, rev)
         else:
             try:
                 # try as if the rev is a branch name or HEAD
@@ -116,14 +167,24 @@
 
     def _resolve_revision(self, location: Path, rev: str | None) -> str:
         if rev is None:
-            rev = "HEAD"
-        result = self.run_command(
-            ["rev-parse", rev],
-            cwd=location,
-            stdout_only=True,
-            log_output=False,
-        )
-        return result.stdout.strip()
+            rev_alternatives = ["HEAD"]
+        else:
+            rev_alternatives = [rev, f"origin/{rev}"]
+        last_error = RuntimeError()
+        for check_rev in rev_alternatives:
+            try:
+                result = self.run_command(
+                    ["rev-parse", "--quiet", "--verify", 
f"{check_rev}^{{commit}}"],
+                    cwd=location,
+                    stdout_only=True,
+                    log_output=False,
+                )
+            except UnpackError as e:
+                last_error = e
+                continue
+            return result.stdout.strip()
+        logger.error("Unable to resolve: %s", rev)
+        raise last_error
 
     def get_revision(self, location: Path) -> str:
         return self._resolve_revision(location, None)

Reply via email to