Accepting request 1072312 from devel:languages:python
- Add without_fish.patch which makes fish only optional BuildRequires (gh#kislyuk/argcomplete!410). OBS-URL: https://build.opensuse.org/request/show/1072312 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-argcomplete?expand=0&rev=21
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 16 09:32:50 UTC 2023 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
- 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 <dmueller@suse.com>
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python3-%{**}}
|
||||
%global skip_python2 1
|
||||
Name: python-argcomplete
|
||||
Version: 2.0.0
|
||||
@@ -29,12 +28,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 +58,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 +95,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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
26
without_fish.patch
Normal file
26
without_fish.patch
Normal file
@@ -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',
|
||||
Reference in New Issue
Block a user