15
0

Accepting request 1277022 from devel:languages:python

- Add patch support-click-8.2.patch:
  * Support click 8.2+.

OBS-URL: https://build.opensuse.org/request/show/1277022
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-flasgger?expand=0&rev=11
This commit is contained in:
2025-05-23 12:27:07 +00:00
committed by Git OBS Bridge
3 changed files with 47 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue May 13 06:49:59 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-click-8.2.patch:
* Support click 8.2+.
-------------------------------------------------------------------
Thu Jan 23 03:51:17 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>

View File

@@ -35,6 +35,8 @@ URL: https://github.com/flasgger/flasgger/
Source: https://files.pythonhosted.org/packages/source/f/flasgger/flasgger-%{version}.tar.gz
# PATCH-FIX-UPSTREAM Based on gh#flasgger/flasgger#629
Patch0: remove-six.patch
# PATCH-FIX-UPSTREAM gh#flasgger/flasgger#633
Patch1: support-click-8.2.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}

39
support-click-8.2.patch Normal file
View File

@@ -0,0 +1,39 @@
From 08591b60e988c0002fcf1b1e9f98b78e041d2732 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Tue, 4 Mar 2025 10:13:55 +0000
Subject: [PATCH] Fix tests with Click 8.2
https://github.com/pallets/click/pull/2523 introduced changes to
`click.testing` that broke a few unit tests in Flasgger:
`mix_stderr=False` is now effectively the default and can no longer be
specified explicitly. Although this Click version hasn't been fully
released yet, this adjusts Flasgger to work with both old and new
versions.
---
tests/conftest.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tests/conftest.py b/tests/conftest.py
index bb83d682..5acb4923 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,7 +1,9 @@
+import inspect
import json
import random
import pytest
+from click.testing import CliRunner
from flasgger import Swagger
from flasgger.utils import get_examples
@@ -99,4 +101,8 @@ def app():
@pytest.fixture(scope="function")
def cli_runner(app):
- yield app.test_cli_runner(mix_stderr=False)
+ kwargs = {}
+ if "mix_stderr" in inspect.signature(CliRunner).parameters:
+ # click < 8.2
+ kwargs["mix_stderr"] = False
+ yield app.test_cli_runner(**kwargs)