diff --git a/backport-fix-3.12-false-positive-when-fstring-chunk-is-a-keyword.patch b/backport-fix-3.12-false-positive-when-fstring-chunk-is-a-keyword.patch new file mode 100644 index 0000000000000000000000000000000000000000..0a713503820fbe7359dcb94dd33525a6160e9244 --- /dev/null +++ b/backport-fix-3.12-false-positive-when-fstring-chunk-is-a-keyword.patch @@ -0,0 +1,24 @@ +From 0c5e01a41d86ca30385622948252f350878921c1 Mon Sep 17 00:00:00 2001 +From: Anthony Sottile +Date: Thu, 12 Oct 2023 09:19:56 -0400 +Subject: [PATCH] fix 3.12 false positive when fstring chunk is a keyword + +Conflict:The testing/data/python36.py file does not exist and will not be modified. +Reference:https://github.com/PyCQA/pycodestyle/commit/0c5e01a41d86ca30385622948252f350878921c1#diff-f97de3466d61c869b314e6967b2d63815d3705e06363a9c6c866cc1855d080db + +--- + pycodestyle.py | 1 + + 1 files changed, 1 insertions(+) + +diff --git a/pycodestyle.py b/pycodestyle.py +index c492436b..18514f06 100755 +--- a/pycodestyle.py ++++ b/pycodestyle.py +@@ -490,6 +490,7 @@ def missing_whitespace_after_keyword(logical_line, tokens): + # appear e.g. as "if x is None:", and async/await, which were + # valid identifier names in old Python versions. + if (tok0.end == tok1.start and ++ tok0.type == tokenize.NAME and + keyword.iskeyword(tok0.string) and + tok0.string not in SINGLETONS and + not (tok0.string == 'except' and tok1.string == '*') and diff --git a/python-pycodestyle.spec b/python-pycodestyle.spec index 750da1d2ff558be2282a18fa3576cf06b87a9d96..9ec21ac1b2f5310fd54d8837177ed61cd682a5bb 100644 --- a/python-pycodestyle.spec +++ b/python-pycodestyle.spec @@ -1,12 +1,15 @@ %global _empty_manifest_terminate_build 0 Name: python-pycodestyle Version: 2.11.0 -Release: 1 +Release: 2 Summary: Python style guide checker License: MIT URL: https://pycodestyle.pycqa.org/ Source0: https://files.pythonhosted.org/packages/06/6b/5ca0d12ef7dcf7d20dfa35287d02297f3e0f9e515da5183654c03a9636ce/pycodestyle-2.11.0.tar.gz BuildArch: noarch + +Patch01: backport-fix-3.12-false-positive-when-fstring-chunk-is-a-keyword.patch + %description pycodestyle (formerly pep8) is a tool to check your Python code against some of the style conventions in PEP 8. @@ -29,7 +32,7 @@ Provides: python3-pycodestyle-doc pycodestyle (formerly pep8) is a tool to check your Python code against some of the style conventions in PEP 8. %prep -%autosetup -n pycodestyle-%{version} +%autosetup -n pycodestyle-%{version} -p1 %build %py3_build @@ -69,6 +72,9 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog +* Fri May 10 2024 zhangxingrong - 2.11.0-2 +- backport upstream patch + * Mon Jul 31 2023 sunhui - 2.11.0-1 - Update package to version 2.11.0