Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-setuptools_scm for openSUSE:Factory checked in at 2024-05-07 18:02:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-setuptools_scm (Old) and /work/SRC/openSUSE:Factory/.python-setuptools_scm.new.1880 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-setuptools_scm" Tue May 7 18:02:07 2024 rev:36 rq:1172052 version:8.0.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-setuptools_scm/python-setuptools_scm.changes 2024-02-02 15:45:27.524755135 +0100 +++ /work/SRC/openSUSE:Factory/.python-setuptools_scm.new.1880/python-setuptools_scm.changes 2024-05-07 18:02:08.575756220 +0200 @@ -1,0 +2,6 @@ +Fri May 3 17:19:17 UTC 2024 - Andreas Stieger <andreas.stie...@gmx.de> + +- fix tests with git 2.45.0 (boo#1223839) + adding setuptools-scm-issue1038-git-2-45-0.patch + +------------------------------------------------------------------- New: ---- setuptools-scm-issue1038-git-2-45-0.patch BETA DEBUG BEGIN: New:- fix tests with git 2.45.0 (boo#1223839) adding setuptools-scm-issue1038-git-2-45-0.patch BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-setuptools_scm.spec ++++++ --- /var/tmp/diff_new_pack.SEckvY/_old 2024-05-07 18:02:09.995807855 +0200 +++ /var/tmp/diff_new_pack.SEckvY/_new 2024-05-07 18:02:10.011808437 +0200 @@ -1,7 +1,8 @@ # -# spec file +# spec file for package python-setuptools_scm # # Copyright (c) 2024 SUSE LLC +# Copyright (c) 2024 Andreas Stieger <andreas.stie...@gmx.de> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,17 +25,18 @@ %define psuffix %{nil} %bcond_with test %endif - %{?sle15_python_module_pythons} Name: python-setuptools_scm%{psuffix} Version: 8.0.4 Release: 0 Summary: Python setuptools handler for SCM tags License: MIT -URL: https://github.com/pypa/setuptools_scm +URL: https://github.com/pypa/setuptools_scm/ Source: https://files.pythonhosted.org/packages/source/s/setuptools-scm/setuptools-scm-%{version}.tar.gz # PATCH-FEATURE-OPENSUSE setuptools-scm-issue953-nowarn.patch gh#pypa/setuptools_scm#953 -- don't warn if setuptools_scm is present but not directly used Patch0: setuptools-scm-issue953-nowarn.patch +# PATCH-FIX-UPSTREAM setuptools-scm-issue1038-git-2-45-0.patch gp#pypa/setuptools_scm#1038 -- fix build with git 2.45.0 +Patch1: setuptools-scm-issue1038-git-2-45-0.patch BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 61} @@ -45,10 +47,10 @@ Requires: python-packaging >= 20.0 Requires: python-setuptools Requires: python-typing-extensions +BuildArch: noarch %if 0%{?python_version_nodots} < 311 Requires: python-tomli >= 1 %endif -BuildArch: noarch %if %{with test} # Testing requirements BuildRequires: %{python_module build} ++++++ setuptools-scm-issue1038-git-2-45-0.patch ++++++ Index: setuptools-scm-8.0.4/testing/test_git.py =================================================================== --- setuptools-scm-8.0.4.orig/testing/test_git.py +++ setuptools-scm-8.0.4/testing/test_git.py @@ -494,6 +494,22 @@ def test_git_getdate_badgit( assert git_wd.get_head_date() is None +def test_git_getdate_git_2_45_0_plus( + wd: WorkDir, caplog: pytest.LogCaptureFixture, monkeypatch: pytest.MonkeyPatch +) -> None: + wd.commit_testfile() + git_wd = git.GitWorkdir(wd.cwd) + fake_date_result = CompletedProcess( + args=[], stdout="2024-04-30T22:33:10Z", stderr="", returncode=0 + ) + with patch.object( + git, + "run_git", + Mock(return_value=fake_date_result), + ): + assert git_wd.get_head_date() == date(2024, 4, 30) + + @pytest.fixture() def signed_commit_wd(monkeypatch: pytest.MonkeyPatch, wd: WorkDir) -> WorkDir: if not has_command("gpg", args=["--version"], warn=False): Index: setuptools-scm-8.0.4/src/setuptools_scm/git.py =================================================================== --- setuptools-scm-8.0.4.orig/src/setuptools_scm/git.py +++ setuptools-scm-8.0.4/src/setuptools_scm/git.py @@ -5,6 +5,7 @@ import logging import os import re import shlex +import sys import warnings from datetime import date from datetime import datetime @@ -118,6 +119,8 @@ class GitWorkdir(Workdir): if "%c" in timestamp_text: log.warning("git too old -> timestamp is %r", timestamp_text) return None + if sys.version_info < (3, 11) and timestamp_text.endswith("Z"): + timestamp_text = timestamp_text[:-1] + "+00:00" return datetime.fromisoformat(timestamp_text).date() res = run_git(