Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:redwil:15.4
python-setuptools_scm
setuptools-scm-issue1038-git-2-45-0.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File setuptools-scm-issue1038-git-2-45-0.patch of Package python-setuptools_scm
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(
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor