diff --git a/python-pysubs2.changes b/python-pysubs2.changes index cab83d0..f3df1ec 100644 --- a/python-pysubs2.changes +++ b/python-pysubs2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Feb 20 13:51:37 UTC 2025 - Matej Cepl + +- Add python_executable.patch (from gh#tkarabela/pysubs2!104) to + use different filenames of Python executable. + ------------------------------------------------------------------- Thu Feb 20 12:37:39 UTC 2025 - John Paul Adrian Glaubitz diff --git a/python-pysubs2.spec b/python-pysubs2.spec index 599254a..82b9cf2 100644 --- a/python-pysubs2.spec +++ b/python-pysubs2.spec @@ -25,7 +25,11 @@ License: MIT Group: Development/Languages/Python URL: https://pysubs2.readthedocs.io Source0: https://files.pythonhosted.org/packages/source/p/pysubs2/pysubs2-%{version}.tar.gz +# PATCH-FIX-UPSTREAM python_executable.patch gh#tkarabela/pysubs2!104 mcepl@suse.com +# don't hardcode python executable name +Patch0: python_executable.patch BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: fdupes @@ -60,7 +64,7 @@ There is a small CLI tool for batch conversion and retiming. %python_uninstall_alternative pysubs2 %check -# online tests only +%pytest %files %{python_files} %license LICENSE.txt diff --git a/python_executable.patch b/python_executable.patch new file mode 100644 index 0000000..adfbaf4 --- /dev/null +++ b/python_executable.patch @@ -0,0 +1,45 @@ +From 42655812b75c21e527dabd6460ea463f34ae23fa Mon Sep 17 00:00:00 2001 +From: Alexandre Detiste +Date: Sat, 15 Feb 2025 16:16:40 +0100 +Subject: [PATCH] python is "python3" on Debian (and others ?) + +--- + tests/test_cli.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +Index: pysubs2-1.8.0/tests/test_cli.py +=================================================================== +--- pysubs2-1.8.0.orig/tests/test_cli.py 2024-12-24 12:52:36.000000000 +0100 ++++ pysubs2-1.8.0/tests/test_cli.py 2025-02-20 14:51:01.920439196 +0100 +@@ -1,3 +1,4 @@ ++import sys + from typing import Any + + import pysubs2 +@@ -49,7 +50,7 @@ + + + def test_srt_to_microdvd_subprocess_pipe() -> None: +- cmd = ["python", "-m", "pysubs2", "--to", "microdvd", "--fps", "1000"] ++ cmd = [sys.executable, "-m", "pysubs2", "--to", "microdvd", "--fps", "1000"] + output = subprocess.check_output(cmd, input=TEST_SRT_FILE, text=True) + assert output.strip() == TEST_MICRODVD_FILE.strip() + +@@ -410,7 +411,7 @@ + with tempfile.TemporaryDirectory() as temp_dir: + path = op.join(temp_dir, "test.srt") + with open(path, "w+") as in_fp: +- cmd = ["python", "-m", "pysubs2"] ++ cmd = [sys.executable, "-m", "pysubs2"] + p = subprocess.run(cmd, stdin=in_fp, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) + assert p.returncode == 1 + assert not p.stdout.startswith("usage: pysubs2") +@@ -427,7 +428,7 @@ + with open(input_path, "wb") as fp: + fp.write(input_bytes_win1250) + +- cmd = ["python", "-m", "pysubs2", "-o", output_dir, input_path] ++ cmd = [sys.executable, "-m", "pysubs2", "-o", output_dir, input_path] + subprocess.check_call(cmd) + + with open(output_path, "rb") as fp: