From 365f2013824b2c536ce74676900917085af72622 Mon Sep 17 00:00:00 2001 From: wuzhaomin Date: Wed, 10 Jul 2024 15:04:53 +0800 Subject: [PATCH] Bakport commits from upstream --- Backport-Fix-linting-875.patch | 64 ++++++++++++++++++++++++++++++++++ python-typing.spec | 11 ++++-- 2 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 Backport-Fix-linting-875.patch diff --git a/Backport-Fix-linting-875.patch b/Backport-Fix-linting-875.patch new file mode 100644 index 0000000..48502df --- /dev/null +++ b/Backport-Fix-linting-875.patch @@ -0,0 +1,64 @@ +From 68e7cb7c90a1932e04fde6808a3ca9d3818fd64c Mon Sep 17 00:00:00 2001 +From: Sebastian Rittau +Date: Tue, 31 Aug 2021 00:06:04 +0200 +Subject: [PATCH] Fix linting (#875) + +* Split linting into two steps +* Fix an overly long line +* Run linter with Python 3.9 +* Ignore more errors in test linting +--- + .flake8-tests | 12 ++++++++++-- + typing_extensions/src_py3/typing_extensions.py | 4 +++- + 2 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/.flake8-tests b/.flake8-tests +index 06b437d..6af938e 100644 +--- a/.flake8-tests ++++ b/.flake8-tests +@@ -11,17 +11,25 @@ builtins = basestring, unicode + max-line-length = 100 + ignore = + # temporary ignores until we sort it out ++ B017, ++ E302, ++ E303, + E306, ++ E501, + E701, + E704, ++ F722, + F811, ++ F821, ++ F841, ++ W503, + # irrelevant plugins + B3, +- DW12 ++ DW12, + # consistency with mypy + W504 + exclude = + # This config is NOT for the main module. +- setup.py ++ setup.py, + python2/typing.py, + src/typing.py +diff --git a/typing_extensions/src_py3/typing_extensions.py b/typing_extensions/src_py3/typing_extensions.py +index f36bba3..184da0a 100644 +--- a/typing_extensions/src_py3/typing_extensions.py ++++ b/typing_extensions/src_py3/typing_extensions.py +@@ -2428,7 +2428,9 @@ if not hasattr(typing, 'Concatenate'): + + @property + def __parameters__(self): +- return tuple(tp for tp in self.__args__ if isinstance(tp, (TypeVar, ParamSpec))) ++ return tuple( ++ tp for tp in self.__args__ if isinstance(tp, (TypeVar, ParamSpec)) ++ ) + + if not PEP_560: + # Only required in 3.6 and lower. +-- +2.9.3.windows.1 + diff --git a/python-typing.spec b/python-typing.spec index eaf8248..deefedf 100644 --- a/python-typing.spec +++ b/python-typing.spec @@ -1,13 +1,13 @@ %global _empty_manifest_terminate_build 0 Name: python-typing Version: 3.10.0.2 -Release: 1 +Release: 2 Summary: Type Hints for Python License: Python-2.0 URL: https://github.com/python/typing Source0: https://github.com/python/typing/archive/%{version}/typing-%{version}.tar.gz BuildArch: noarch - +Patch1: Backport-Fix-linting-875.patch %description Python static typing home. @@ -67,6 +67,13 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog +* Wed Jul 10 2024 wuzhaomin - 3.10.0.2-2 +- Fix linting (#875): +- Split linting into two steps +- Fix an overly long line +- Run linter with Python 3.9 +- Ignore more errors in test linting + * Thu Apr 27 2023 yaoxin - 3.10.0.2-1 - Update to 3.10.0.2 -- Gitee