forked from pool/python-click-plugins
Compare commits
3 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 17c36af7df | |||
| ef8940c592 | |||
| b9f226657e |
@@ -1,3 +1,16 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu May 29 11:14:07 UTC 2025 - Max Lin <mlin@suse.com>
|
||||||
|
|
||||||
|
- Fix Leap 16.0 build
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed May 14 04:08:19 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Add patch support-click-8.2.patch:
|
||||||
|
* Support click 8.2+ changes.
|
||||||
|
- Switch to autosetup and pyproject macros.
|
||||||
|
- No more greedy globs in %files.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Jun 11 13:45:26 UTC 2023 - ecsos <ecsos@opensuse.org>
|
Sun Jun 11 13:45:26 UTC 2023 - ecsos <ecsos@opensuse.org>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-click-plugins
|
# spec file for package python-click-plugins
|
||||||
#
|
#
|
||||||
# Copyright (c) 2021 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
||||||
%if 0%{?sle_version} == 150300
|
%if 0%{?sle_version} == 150300
|
||||||
# tests fail on python2 on Leap 15.3 and SLE 15 SP3
|
# tests fail on python2 on Leap 15.3 and SLE 15 SP3
|
||||||
%define skip_python2 1
|
%define skip_python2 1
|
||||||
@@ -27,12 +26,15 @@ Version: 1.1.1
|
|||||||
Release: 0
|
Release: 0
|
||||||
Summary: Click extension to register CLI commands via setuptools entry-points
|
Summary: Click extension to register CLI commands via setuptools entry-points
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
Group: Development/Languages/Python
|
|
||||||
URL: https://github.com/click-contrib/click-plugins
|
URL: https://github.com/click-contrib/click-plugins
|
||||||
Source: https://files.pythonhosted.org/packages/source/c/click-plugins/click-plugins-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/c/click-plugins/click-plugins-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-OPENSUSE https://github.com/click-contrib/click-plugins/issues/38
|
||||||
|
Patch0: support-click-8.2.patch
|
||||||
BuildRequires: %{python_module click >= 3.0}
|
BuildRequires: %{python_module click >= 3.0}
|
||||||
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-click >= 3.0
|
Requires: python-click >= 3.0
|
||||||
@@ -48,13 +50,13 @@ You could have all plugins register alongside the core commands,
|
|||||||
in a special sub-group, across multiple sub-groups, or some combination.
|
in a special sub-group, across multiple sub-groups, or some combination.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n click-plugins-%{version}
|
%autosetup -p1 -n click-plugins-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%python_install
|
%pyproject_install
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@@ -63,11 +65,8 @@ export LANG=en_US.UTF-8
|
|||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%doc AUTHORS.txt CHANGES.md README.rst
|
%doc AUTHORS.txt CHANGES.md README.rst
|
||||||
%if 0%{?leap_version} >= 420200 || 0%{?suse_version} > 1320
|
|
||||||
%%license LICENSE.txt
|
|
||||||
%else
|
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
%endif
|
%{python_sitelib}/click_plugins
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/click_plugins-%{version}.dist-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|||||||
78
support-click-8.2.patch
Normal file
78
support-click-8.2.patch
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
Index: click-plugins-1.1.1/tests/test_plugins.py
|
||||||
|
===================================================================
|
||||||
|
--- click-plugins-1.1.1.orig/tests/test_plugins.py
|
||||||
|
+++ click-plugins-1.1.1/tests/test_plugins.py
|
||||||
|
@@ -1,3 +1,6 @@
|
||||||
|
+import importlib.metadata
|
||||||
|
+
|
||||||
|
+from packaging.version import Version
|
||||||
|
from pkg_resources import EntryPoint
|
||||||
|
from pkg_resources import iter_entry_points
|
||||||
|
from pkg_resources import working_set
|
||||||
|
@@ -20,6 +23,12 @@ def cmd2(arg):
|
||||||
|
"""Test command 2"""
|
||||||
|
click.echo('passed')
|
||||||
|
|
||||||
|
+click_version = Version(importlib.metadata.version("click"))
|
||||||
|
+if click_version >= Version("8.2"):
|
||||||
|
+ expected_exit_code = 2
|
||||||
|
+else:
|
||||||
|
+ expected_exit_code = 0
|
||||||
|
+
|
||||||
|
|
||||||
|
# Manually register plugins in an entry point and put broken plugins in a
|
||||||
|
# different entry point.
|
||||||
|
@@ -78,7 +87,7 @@ def test_registered():
|
||||||
|
def test_register_and_run(runner):
|
||||||
|
|
||||||
|
result = runner.invoke(good_cli)
|
||||||
|
- assert result.exit_code == 0
|
||||||
|
+ assert result.exit_code == expected_exit_code
|
||||||
|
|
||||||
|
for ep in iter_entry_points('_test_click_plugins.test_plugins'):
|
||||||
|
cmd_result = runner.invoke(good_cli, [ep.name, 'something'])
|
||||||
|
@@ -89,7 +98,7 @@ def test_register_and_run(runner):
|
||||||
|
def test_broken_register_and_run(runner):
|
||||||
|
|
||||||
|
result = runner.invoke(broken_cli)
|
||||||
|
- assert result.exit_code == 0
|
||||||
|
+ assert result.exit_code == expected_exit_code
|
||||||
|
assert u'\U0001F4A9' in result.output or u'\u2020' in result.output
|
||||||
|
|
||||||
|
for ep in iter_entry_points('_test_click_plugins.broken_plugins'):
|
||||||
|
@@ -108,7 +117,7 @@ def test_group_chain(runner):
|
||||||
|
pass
|
||||||
|
|
||||||
|
result = runner.invoke(good_cli)
|
||||||
|
- assert result.exit_code == 0
|
||||||
|
+ assert result.exit_code == expected_exit_code
|
||||||
|
assert sub_cli.name in result.output
|
||||||
|
for ep in iter_entry_points('_test_click_plugins.test_plugins'):
|
||||||
|
assert ep.name in result.output
|
||||||
|
@@ -121,7 +130,7 @@ def test_group_chain(runner):
|
||||||
|
pass
|
||||||
|
|
||||||
|
result = runner.invoke(good_cli, ['sub-cli-plugins'])
|
||||||
|
- assert result.exit_code == 0
|
||||||
|
+ assert result.exit_code == expected_exit_code
|
||||||
|
for ep in iter_entry_points('_test_click_plugins.test_plugins'):
|
||||||
|
assert ep.name in result.output
|
||||||
|
|
||||||
|
@@ -142,7 +151,7 @@ def test_exception():
|
||||||
|
|
||||||
|
def test_broken_register_and_run_with_help(runner):
|
||||||
|
result = runner.invoke(broken_cli)
|
||||||
|
- assert result.exit_code == 0
|
||||||
|
+ assert result.exit_code == expected_exit_code
|
||||||
|
assert u'\U0001F4A9' in result.output or u'\u2020' in result.output
|
||||||
|
|
||||||
|
for ep in iter_entry_points('_test_click_plugins.broken_plugins'):
|
||||||
|
@@ -153,7 +162,7 @@ def test_broken_register_and_run_with_he
|
||||||
|
|
||||||
|
def test_broken_register_and_run_with_args(runner):
|
||||||
|
result = runner.invoke(broken_cli)
|
||||||
|
- assert result.exit_code == 0
|
||||||
|
+ assert result.exit_code == expected_exit_code
|
||||||
|
assert u'\U0001F4A9' in result.output or u'\u2020' in result.output
|
||||||
|
|
||||||
|
for ep in iter_entry_points('_test_click_plugins.broken_plugins'):
|
||||||
Reference in New Issue
Block a user