From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pyflakes/files/, dev-python/pyflakes/
Date: Tue, 4 Jul 2023 19:09:48 +0000 (UTC) [thread overview]
Message-ID: <1688497758.8fc4bbcac9baad028098db14f1c4ee99666fdf2c.sam@gentoo> (raw)
commit: 8fc4bbcac9baad028098db14f1c4ee99666fdf2c
Author: Ninpo <ninpo <AT> qap <DOT> la>
AuthorDate: Tue Jul 4 18:57:58 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jul 4 19:09:18 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8fc4bbca
dev-python/pyflakes: backport Python 3.11 fix
Closes: https://bugs.gentoo.org/909554
Signed-off-by: Ninpo <ninpo <AT> qap.la>
Closes: https://github.com/gentoo/gentoo/pull/31742
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../pyflakes/files/pyflakes-3.0.1-python3.11.patch | 46 ++++++++++++++++++++++
dev-python/pyflakes/pyflakes-3.0.1-r1.ebuild | 23 +++++++++++
2 files changed, 69 insertions(+)
diff --git a/dev-python/pyflakes/files/pyflakes-3.0.1-python3.11.patch b/dev-python/pyflakes/files/pyflakes-3.0.1-python3.11.patch
new file mode 100644
index 000000000000..b2e7f57b2bad
--- /dev/null
+++ b/dev-python/pyflakes/files/pyflakes-3.0.1-python3.11.patch
@@ -0,0 +1,46 @@
+https://github.com/PyCQA/pyflakes/commit/836631f2f73d45baa4021453d89fc9fd6f52be58
+https://bugs.gentoo.org/909554
+From 836631f2f73d45baa4021453d89fc9fd6f52be58 Mon Sep 17 00:00:00 2001
+From: Anthony Sottile <asottile@umich.edu>
+Date: Mon, 12 Jun 2023 21:00:45 -0400
+Subject: [PATCH] fix error reporter and testsuite in 3.11.4+ (#775)
+
+---
+ pyflakes/reporter.py | 3 ++-
+ pyflakes/test/test_api.py | 8 ++++++--
+ 2 files changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/pyflakes/reporter.py b/pyflakes/reporter.py
+index af834d1c..65ed4d8e 100644
+--- a/pyflakes/reporter.py
++++ b/pyflakes/reporter.py
+@@ -56,8 +56,9 @@ def syntaxError(self, filename, msg, lineno, offset, text):
+ else:
+ line = text.splitlines()[-1]
+
++ # lineno might be None if the error was during tokenization
+ # lineno might be 0 if the error came from stdin
+- lineno = max(lineno, 1)
++ lineno = max(lineno or 0, 1)
+
+ if offset is not None:
+ # some versions of python emit an offset of -1 for certain encoding errors
+diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py
+index 5c1879c1..13e8f685 100644
+--- a/pyflakes/test/test_api.py
++++ b/pyflakes/test/test_api.py
+@@ -621,8 +621,12 @@ def test_misencodedFileUTF16(self):
+ x = "%s"
+ """ % SNOWMAN).encode('utf-16')
+ with self.makeTempFile(source) as sourcePath:
+- self.assertHasErrors(
+- sourcePath, [f"{sourcePath}: problem decoding source\n"])
++ if sys.version_info < (3, 11, 4):
++ expected = f"{sourcePath}: problem decoding source\n"
++ else:
++ expected = f"{sourcePath}:1: source code string cannot contain null bytes\n" # noqa: E501
++
++ self.assertHasErrors(sourcePath, [expected])
+
+ def test_checkRecursive(self):
+ """
diff --git a/dev-python/pyflakes/pyflakes-3.0.1-r1.ebuild b/dev-python/pyflakes/pyflakes-3.0.1-r1.ebuild
new file mode 100644
index 000000000000..2e8999e03a38
--- /dev/null
+++ b/dev-python/pyflakes/pyflakes-3.0.1-r1.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{9..11} pypy3 )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Passive checker for Python programs"
+HOMEPAGE="
+ https://github.com/PyCQA/pyflakes/
+ https://pypi.org/project/pyflakes/
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
+PATCHES=(
+ "${FILESDIR}"/${P}-python3.11.patch
+)
+distutils_enable_tests unittest
next reply other threads:[~2023-07-04 19:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-04 19:09 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-09-20 9:36 [gentoo-commits] repo/gentoo:master commit in: dev-python/pyflakes/files/, dev-python/pyflakes/ Michał Górny
2020-01-26 20:52 Andreas Sturmlechner
2019-11-29 19:56 Patrick McLean
2015-11-22 10:32 Ian Delaney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1688497758.8fc4bbcac9baad028098db14f1c4ee99666fdf2c.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox