!32 Fix linting error

From: @zhang-liang-pengkun 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
This commit is contained in:
openeuler-ci-bot 2023-01-09 10:12:09 +00:00 committed by Gitee
commit eab9bd640b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 51 additions and 2 deletions

44
Fix-linting-error.patch Normal file
View File

@ -0,0 +1,44 @@
From 8ddbad9ccdc176b9d57a4aff0076c1c58c455318 Mon Sep 17 00:00:00 2001
From: DailyDreaming <lblauvel@ucsc.edu>
Date: Mon, 2 May 2022 07:46:09 -0700
Subject: [PATCH] Fix linting error.
Suppress mypy.
Suppress mypy error.
Suppress mypy error.
---
src/flask/cli.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/flask/cli.py b/src/flask/cli.py
index 36c4f1b6..efcc0f99 100644
--- a/src/flask/cli.py
+++ b/src/flask/cli.py
@@ -9,6 +9,8 @@ from functools import update_wrapper
from operator import attrgetter
from threading import Lock
from threading import Thread
+from typing import Any
+from typing import TYPE_CHECKING
import click
from werkzeug.utils import import_string
@@ -36,7 +38,12 @@ else:
# We technically have importlib.metadata on 3.8+,
# but the API changed in 3.10, so use the backport
# for consistency.
- import importlib_metadata as metadata # type: ignore
+ if TYPE_CHECKING:
+ metadata: Any
+ else:
+ # we do this to avoid a version dependent mypy error
+ # because importlib_metadata is not installed in python3.10+
+ import importlib_metadata as metadata
class NoAppException(click.UsageError):
--
2.39.0.windows.2

View File

@ -1,11 +1,13 @@
Name: python-flask
Version: 2.1.2
Release: 1
Release: 2
Epoch: 1
Summary: A lightweight WSGI web application framework
License: BSD-3-Clause
URL: https://palletsprojects.com/p/flask/
Source0: https://files.pythonhosted.org/packages/source/F/Flask/Flask-%{version}.tar.gz
Patch0: Fix-linting-error.patch
BuildArch: noarch
BuildRequires: python3-devel python3-setuptools python3-pytest python3-jinja2 python3-werkzeug python3-itsdangerous python3-click
@ -26,7 +28,7 @@ Requires: python3-jinja2 python3-werkzeug python3-itsdangerous python3-cl
Python-flask for python 3 version
%prep
%autosetup -n Flask-%{version}
%autosetup -n Flask-%{version} -p1
%build
%py3_build
@ -51,6 +53,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -v || :
%{python3_sitelib}/*
%changelog
* Mon Jan 9 2023 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 1:2.1.2-2
- Fix linting error.
* Thu Jun 23 2022 houyingchao <houyingchao@h-partners.com> - 1:2.1.2-1
- Upgrade to 2.1.2 version