diff --git a/Fix-forcing-color-through-termcolor.patch b/Fix-forcing-color-through-termcolor.patch new file mode 100644 index 0000000000000000000000000000000000000000..99313d2be3b6e87815f64b4f30cf3b56ef8f4f0d --- /dev/null +++ b/Fix-forcing-color-through-termcolor.patch @@ -0,0 +1,37 @@ +From b391bcaf11f142135f549c1a69fd0c1560f3cff3 Mon Sep 17 00:00:00 2001 +From: Matthew Peveler +Date: Tue, 27 Dec 2022 09:48:42 -0500 +Subject: [PATCH] Fix forcing color through termcolor (#204) + +--- + tests/test_tldr.py | 3 ++- + tldr.py | 2 ++ + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tests/test_tldr.py b/tests/test_tldr.py +index 0ed0dd1..b49c3ed 100644 +--- a/tests/test_tldr.py ++++ b/tests/test_tldr.py +@@ -12,7 +12,8 @@ + + + @pytest.mark.parametrize("page_name", page_names) +-def test_whole_page(page_name): ++def test_whole_page(page_name, monkeypatch): ++ monkeypatch.setenv("FORCE_COLOR", "1") + with open(f"tests/data/{page_name}.md", "rb") as f_original: + with open(f"tests/data/{page_name}_rendered", "rb") as f_rendered: + old_stdout = sys.stdout +diff --git a/tldr.py b/tldr.py +index 7e96807..1ac6c39 100755 +--- a/tldr.py ++++ b/tldr.py +@@ -493,6 +493,8 @@ def main() -> None: + options = parser.parse_args() + + colorama.init(strip=options.color) ++ if options.color is False: ++ os.environ["FORCE_COLOR"] = "true" + + if options.update_cache: + update_cache(language=options.language) diff --git a/tldr.spec b/tldr.spec index 30a6459391fdb76f9c5fb384c013892d866d6178..e57a1cab6b14e34deba35a8a57c2a4a54054c1e9 100644 --- a/tldr.spec +++ b/tldr.spec @@ -1,11 +1,12 @@ Name: tldr Version: 3.1.0 -Release: 1 +Release: 2 Summary: Simplified and community-driven man pages License: MIT URL: https://github.com/tldr-pages/tldr-python-client Source0: https://github.com/tldr-pages/tldr-python-client/archive/%{version}/%{name}-%{version}.tar.gz +Patch0: Fix-forcing-color-through-termcolor.patch BuildArch: noarch BuildRequires: python3-colorama @@ -32,7 +33,7 @@ A Python command line client for tldr - Simplified and community-driven man pages http://tldr-pages.github.io/. %prep -%autosetup -n %{name}-python-client-%{version} +%autosetup -n %{name}-python-client-%{version} -p1 # Remove bundled egg-info rm -rf %{name}.egg-info @@ -58,6 +59,9 @@ pytest -k "not test_error_message" %{python3_sitelib}/%{name}-%{version}-py%{python3_version}.egg-info %changelog +* Fri May 05 2023 yaoxin - 3.1.0-2 +- Fix compilation errors due to python-termcolor update to 2.3.0 + * Fri Apr 21 2023 wulei - 3.1.0-1 - Upgrade package to version 3.1.0