From b0abaac7076f67d6037d209db8fabd7c749a622b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20K=C5=82oczko?= Date: Wed, 26 Jun 2024 13:13:07 +0000 Subject: [PATCH 1/2] drop python<3=3.7 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to https://endoflife.date/python python 3.7 has been EOSed 27 Jun 2023. Filter all code over `pyupgracde --py38-plus`. Signed-off-by: Tomasz Kłoczko --- specfile/changelog.py | 10 ++++------ tests/unit/test_guess_packager.py | 9 +++------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/specfile/changelog.py b/specfile/changelog.py index 506a6f4e..89c3d463 100644 --- a/specfile/changelog.py +++ b/specfile/changelog.py @@ -400,15 +400,13 @@ def guess_packager() -> str: if shutil.which("git"): email = subprocess.run( ["git", "config", "user.email"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - universal_newlines=True, + capture_output=True, + text=True, ).stdout.strip() fullname = subprocess.run( ["git", "config", "user.name"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - universal_newlines=True, + capture_output=True, + text=True, ).stdout.strip() if not fullname: fullname = _getent_name() diff --git a/tests/unit/test_guess_packager.py b/tests/unit/test_guess_packager.py index 5327aaf8..152bae28 100644 --- a/tests/unit/test_guess_packager.py +++ b/tests/unit/test_guess_packager.py @@ -45,19 +45,16 @@ def set_packager_git(monkeypatch: MonkeyPatch, tmp_path: Path) -> str: monkeypatch.chdir(tmp_path) subprocess.run( - ["git", "init", "."], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) + ["git", "init", "."], check=True, capture_output=True) subprocess.run( ["git", "config", "user.name", "Packager, Patty"], check=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, ) subprocess.run( ["git", "config", "user.email", "packager@patty.dev"], check=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, ) return packager From e046953c8b8c0521fffe78197c6dfc5526d6863c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 13:16:41 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/unit/test_guess_packager.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/unit/test_guess_packager.py b/tests/unit/test_guess_packager.py index 152bae28..e5d78797 100644 --- a/tests/unit/test_guess_packager.py +++ b/tests/unit/test_guess_packager.py @@ -44,8 +44,7 @@ def set_packager_git(monkeypatch: MonkeyPatch, tmp_path: Path) -> str: packager = "Packager, Patty " monkeypatch.chdir(tmp_path) - subprocess.run( - ["git", "init", "."], check=True, capture_output=True) + subprocess.run(["git", "init", "."], check=True, capture_output=True) subprocess.run( ["git", "config", "user.name", "Packager, Patty"], check=True,