From 8e3e111945f6bed64861959c15aa8cbe71251497fa39e81e89eb842479e092d0 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 16 Mar 2023 09:36:19 +0000 Subject: [PATCH] Accepting request 1072303 from home:dirkmueller:acdc:as_python3_module - Add without_fish.patch which makes fish only optional BuildRequires (gh#kislyuk/argcomplete!410). OBS-URL: https://build.opensuse.org/request/show/1072303 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-argcomplete?expand=0&rev=43 --- python-argcomplete.changes | 6 ++++++ python-argcomplete.spec | 11 ++++++----- skip_tcsh_tests.patch | 12 +++++++----- without_fish.patch | 26 ++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 without_fish.patch diff --git a/python-argcomplete.changes b/python-argcomplete.changes index 32fcedf..f3a2f91 100644 --- a/python-argcomplete.changes +++ b/python-argcomplete.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 16 09:32:50 UTC 2023 - Matej Cepl + +- Add without_fish.patch which makes fish only optional + BuildRequires (gh#kislyuk/argcomplete!410). + ------------------------------------------------------------------- Tue Jan 31 23:49:21 UTC 2023 - Dirk Müller diff --git a/python-argcomplete.spec b/python-argcomplete.spec index df12c55..eb0b9b4 100644 --- a/python-argcomplete.spec +++ b/python-argcomplete.spec @@ -17,8 +17,8 @@ # -%{?!python_module:%define python_module() python3-%{**}} %global skip_python2 1 +%global pythons python310 python311 Name: python-argcomplete Version: 2.0.0 Release: 0 @@ -29,12 +29,14 @@ URL: https://github.com/kislyuk/argcomplete Source: https://files.pythonhosted.org/packages/source/a/argcomplete/argcomplete-%{version}.tar.gz Patch0: skip_tcsh_tests.patch Patch1: trim-test-deps.patch +# PATCH-FIX-UPSTREAM without_fish.patch gh#kislyuk/argcomplete!410 mcepl@suse.com +# Don't fail the test suite when fish is not available +Patch2: without_fish.patch BuildRequires: %{python_module importlib-metadata >= 0.23} BuildRequires: %{python_module pexpect} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: fdupes -BuildRequires: fish BuildRequires: python-rpm-macros Requires: python-importlib-metadata >= 0.23 Requires(post): update-alternatives @@ -57,8 +59,7 @@ for your argument/option values (for example, if the user is browsing resources over the network). %prep -%setup -q -n argcomplete-%{version} -%autopatch -p1 +%autosetup -p1 -n argcomplete-%{version} %build %python_build @@ -95,7 +96,7 @@ export LANG=en_US.UTF-8 %files %{python_files} %doc README.rst %license LICENSE.rst -%{python_sitelib}/argcomplete-%{version}-py%{python_version}.egg-info +%{python_sitelib}/argcomplete-%{version}*-info %{python_sitelib}/argcomplete %python_alternative %{_bindir}/python-argcomplete-check-easy-install-script %python_alternative %{_bindir}/register-python-argcomplete diff --git a/skip_tcsh_tests.patch b/skip_tcsh_tests.patch index fc6ce84..30a3647 100644 --- a/skip_tcsh_tests.patch +++ b/skip_tcsh_tests.patch @@ -1,8 +1,10 @@ -Index: argcomplete-1.12.2/test/test.py -=================================================================== ---- argcomplete-1.12.2.orig/test/test.py -+++ argcomplete-1.12.2/test/test.py -@@ -1310,40 +1310,6 @@ class TestBashGlobal(TestBash): +--- + test/test.py | 34 ---------------------------------- + 1 file changed, 34 deletions(-) + +--- a/test/test.py ++++ b/test/test.py +@@ -1308,40 +1308,6 @@ class TestBashGlobal(TestBash): self._test_console_script(package=True, wheel=True) diff --git a/without_fish.patch b/without_fish.patch new file mode 100644 index 0000000..a280c20 --- /dev/null +++ b/without_fish.patch @@ -0,0 +1,26 @@ +--- + test/test.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/test/test.py ++++ b/test/test.py +@@ -30,7 +30,10 @@ COMP_WORDBREAKS = " \t\n\"'><=;|&(:" + + BASH_VERSION = subprocess.check_output(['bash', '-c', 'echo $BASH_VERSION']).decode() + BASH_MAJOR_VERSION = int(BASH_VERSION.split('.')[0]) +-FISH_VERSION_STR = subprocess.check_output(['fish', '-c', 'echo -n $version']).decode() ++try: ++ FISH_VERSION_STR = subprocess.check_output(['fish', '-c', 'echo -n $version']).decode() ++except FileNotFoundError: ++ FISH_VERSION_STR = "0.0.0" + FISH_VERSION_TUPLE = tuple(int(x) for x in FISH_VERSION_STR.split('.')) + + +@@ -1308,6 +1311,7 @@ class TestBashGlobal(TestBash): + self._test_console_script(package=True, wheel=True) + + ++@unittest.skipIf(FISH_VERSION_TUPLE == (0, 0, 0), "Fish is not available") + class TestFish(_TestSh, unittest.TestCase): + expected_failures = [ + 'test_parse_special_characters',