public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pyflakes/files/, dev-python/pyflakes/
@ 2015-11-22 10:32 Ian Delaney
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Delaney @ 2015-11-22 10:32 UTC (permalink / raw
  To: gentoo-commits

commit:     ce41e3f54b1953c0a2d5946fa34a298cc0c8ab94
Author:     Ian Delaney <idella4 <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 22 10:31:24 2015 +0000
Commit:     Ian Delaney <idella4 <AT> gentoo <DOT> org>
CommitDate: Sun Nov 22 10:32:01 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce41e3f5

dev-python/pyflakes:  bump -> vn. 1.0.0

Re-add pypy support which never needed dropping, drop py3.3
and py3.5 support, add patch committed upstream fixing
test failures under pypy.

Pull request: https://github.com/pyflakes/pyflakes/pull/50
Upstream Commit: https://github.com/jayvdb/pyflakes/commit/3088ffbd6256521e0213b361bc2294c1e218e6fb

Package-Manager: portage-2.2.24

 dev-python/pyflakes/Manifest                       |   3 +-
 .../pyflakes/files/1.0.0-fix-pypy-tests.patch      | 282 +++++++++++++++++++++
 dev-python/pyflakes/pyflakes-0.7.3.ebuild          |  26 --
 ...pyflakes-0.9.2.ebuild => pyflakes-1.0.0.ebuild} |   4 +-
 4 files changed, 286 insertions(+), 29 deletions(-)

diff --git a/dev-python/pyflakes/Manifest b/dev-python/pyflakes/Manifest
index 66508b0..07ee9f4 100644
--- a/dev-python/pyflakes/Manifest
+++ b/dev-python/pyflakes/Manifest
@@ -1,4 +1,3 @@
 DIST pyflakes-0.7.2.tar.gz 30107 SHA256 e971804569e26a120ded70ca94882cbbf360390538fc3b5861f8ccecaf291178 SHA512 9f50c78ae47f55e30ed264b351325321f6c5d889ca6b2c7509d6c5cb029e27c230849cecc729bb18664cc2eb3d003a38a2e7a20f48563b6fa72c621a783bea64 WHIRLPOOL b23d09999a550784769444fdb1f3592dd54b1938b73e1ec40951eab5d3fad3dc80c0c79fbaa31e1544d74b5c8bcd96ca2f01ee83e0e79d8bfb6228308c20ae4c
-DIST pyflakes-0.7.3.tar.gz 30551 SHA256 dbd2c940a1030a4f811afc1a04017a44011c0cb54f8f384b66aa624097d9b5e3 SHA512 a77fc6a1ca1bdb8aaf31e3653389c7c9357433b8b64dbd3104068a4ce900a019d3dbba5bd23c313fc70398f6f2767a3639cf7b915d3edbc1e1d1e1a03932729d WHIRLPOOL 3ff8aa922f14676a530d51c9114cf7751c23cf92e6d3f88da263b1747343b9fba02f0f2a72123046206a4d22c734cc3f4296f70016d6a51b5ac599bc4bd29345
 DIST pyflakes-0.8.1.tar.gz 32981 SHA256 3fa80a10b36d51686bf7744f5dc99622cd5c98ce8ed64022e629868aafc17769 SHA512 b9843637891f3e82a8430121395ceb4ec5df48b5ba73b96a307ebcb4a393e8cebee1681e094ee1f71a85b58bd2f32562b78fbd61d3fa85634f3ac448b1244637 WHIRLPOOL 0939b6ded3659e53316e6707ca5bf57a6702073c376df611a6a473c43ada36ee8822c9bbf2e106cc1836b46f04ce90612f4ebc73c6cb2d557aa6edb89d0eb949
-DIST pyflakes-0.9.2.tar.gz 34785 SHA256 02691c23ce699f252874b7c27f14cf26e3d4e82b58e5d584f000b7ab5be36a5f SHA512 f412ab8dfabce8378edc7632f448071fc396bd4d76dc0a091df357ed0283151040be9aa51b59dbf28451b6043388f83d82004f1df1cf761df487df40da0f9294 WHIRLPOOL ba473958555ba513b18bd8947f9bc4d361bc51be3984fb39d11be823bf232e748964406b90eca1d01f01b10f3d0ba99f906f0618531e2c75579994afe10c08cb
+DIST pyflakes-1.0.0.tar.gz 35365 SHA256 f39e33a4c03beead8774f005bd3ecf0c3f2f264fa0201de965fce0aff1d34263 SHA512 89a9ee2e5be87d32d5c259c0cb88bbeadb96d27a3bc5eb3cf6f86afa51907ea01107a5336decbf003679b7de65ed9a16d7fbf55a457e0c9bbb1b53500f719bcb WHIRLPOOL c4700fcb9f9a62ed8e38db5c2fb7376b1d03e85b1e1f9fb7d570eb905249337f204664fd87a94b32701c0c67fa8624749d36b64721cb0425bad36ded5da26cdb

diff --git a/dev-python/pyflakes/files/1.0.0-fix-pypy-tests.patch b/dev-python/pyflakes/files/1.0.0-fix-pypy-tests.patch
new file mode 100644
index 0000000..41d1fa8
--- /dev/null
+++ b/dev-python/pyflakes/files/1.0.0-fix-pypy-tests.patch
@@ -0,0 +1,282 @@
+#https://github.com/jayvdb/pyflakes/commit/3088ffbd6256521e0213b361bc2294c1e218e6fb
+diff --git a/pyflakes/api.py b/pyflakes/api.py  #index 3bc2330..2a46a0d 100644
+--- a/pyflakes/api.py
++++ b/pyflakes/api.py
+@@ -41,6 +41,18 @@ def check(codeString, filename, reporter=None):
+
+         (lineno, offset, text) = value.lineno, value.offset, value.text
+ 
++        if checker.PYPY:
++            if text is None:
++                lines = codeString.splitlines()
++                if len(lines) >= lineno:
++                    text = lines[lineno - 1]
++                    if sys.version_info >= (3, ) and isinstance(text, bytes):
++                        try:
++                            text = text.decode('ascii')
++                        except UnicodeDecodeError:
++                            text = None
++            offset -= 1
++
+         # If there's an encoding problem with the file, the text is None.
+         if text is None:
+             # Avoid using msg, since for the only known case, it contains a
+diff --git a/pyflakes/checker.py b/pyflakes/checker.py
+index 753fa9b..f538d3f 100644
+--- a/pyflakes/checker.py
++++ b/pyflakes/checker.py
+@@ -11,6 +11,12 @@
+ PY2 = sys.version_info < (3, 0)
+ PY32 = sys.version_info < (3, 3)    # Python 2.5 to 3.2
+ PY33 = sys.version_info < (3, 4)    # Python 2.5 to 3.3
++try:
++    sys.pypy_version_info
++    PYPY = True
++except AttributeError:
++    PYPY = False
++
+ builtin_vars = dir(__import__('__builtin__' if PY2 else 'builtins'))
+ 
+ try:
+@@ -594,8 +600,13 @@ def getDocstring(self, node):
+             node = node.value
+         if not isinstance(node, ast.Str):
+             return (None, None)
+-        # Computed incorrectly if the docstring has backslash
+-        doctest_lineno = node.lineno - node.s.count('\n') - 1
++
++        if PYPY:
++            doctest_lineno = node.lineno - 1
++        else:
++            # Computed incorrectly if the docstring has backslash
++            doctest_lineno = node.lineno - node.s.count('\n') - 1
++
+         return (node.s, doctest_lineno)
+ 
+     def handleNode(self, node, parent):
+@@ -642,6 +653,8 @@ def handleDoctests(self, node):
+                 tree = compile(example.source, "<doctest>", "exec", ast.PyCF_ONLY_AST)
+             except SyntaxError:
+                 e = sys.exc_info()[1]
++                if PYPY:
++                    e.offset += 1
+                 position = (node_lineno + example.lineno + e.lineno,
+                             example.indent + 4 + (e.offset or 0))
+                 self.report(messages.DoctestSyntaxError, node, position)
+diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py
+index 34a59bc..d2a5036 100644
+--- a/pyflakes/test/test_api.py
++++ b/pyflakes/test/test_api.py
+@@ -23,6 +23,14 @@
+     from io import StringIO
+     unichr = chr
+ 
++try:
++    sys.pypy_version_info
++    PYPY = True
++except AttributeError:
++    PYPY = False
++
++ERROR_HAS_COL_NUM = ERROR_HAS_LAST_LINE = sys.version_info >= (3, 2) or PYPY
++
+ 
+ def withStderrTo(stderr, f, *args, **kwargs):
+     """
+@@ -312,18 +320,25 @@ def evaluate(source):
+             evaluate(source)
+         except SyntaxError:
+             e = sys.exc_info()[1]
+-            self.assertTrue(e.text.count('\n') > 1)
++            if not PYPY:
++                self.assertTrue(e.text.count('\n') > 1)
+         else:
+             self.fail()
+ 
+         sourcePath = self.makeTempFile(source)
++
++        if PYPY:
++            message = 'EOF while scanning triple-quoted string literal'
++        else:
++            message = 'invalid syntax'
++
+         self.assertHasErrors(
+             sourcePath,
+             ["""\
+-%s:8:11: invalid syntax
++%s:8:11: %s
+     '''quux'''
+           ^
+-""" % (sourcePath,)])
++""" % (sourcePath, message)])
+ 
+     def test_eofSyntaxError(self):
+         """
+@@ -331,13 +346,22 @@ def test_eofSyntaxError(self):
+         syntax error reflects the cause for the syntax error.
+         """
+         sourcePath = self.makeTempFile("def foo(")
+-        self.assertHasErrors(
+-            sourcePath,
+-            ["""\
++        if PYPY:
++            result = """\
++%s:1:7: parenthesis is never closed
++def foo(
++      ^
++""" % (sourcePath,)
++        else:
++            result = """\
+ %s:1:9: unexpected EOF while parsing
+ def foo(
+         ^
+-""" % (sourcePath,)])
++""" % (sourcePath,)
++
++        self.assertHasErrors(
++            sourcePath,
++            [result])
+ 
+     def test_eofSyntaxErrorWithTab(self):
+         """
+@@ -345,13 +369,16 @@ def test_eofSyntaxErrorWithTab(self):
+         syntax error reflects the cause for the syntax error.
+         """
+         sourcePath = self.makeTempFile("if True:\n\tfoo =")
++        column = 5 if PYPY else 7
++        last_line = '\t   ^' if PYPY else '\t     ^'
++
+         self.assertHasErrors(
+             sourcePath,
+             ["""\
+-%s:2:7: invalid syntax
++%s:2:%s: invalid syntax
+ \tfoo =
+-\t     ^
+-""" % (sourcePath,)])
++%s
++""" % (sourcePath, column, last_line)])
+ 
+     def test_nonDefaultFollowsDefaultSyntaxError(self):
+         """
+@@ -364,8 +391,8 @@ def foo(bar=baz, bax):
+     pass
+ """
+         sourcePath = self.makeTempFile(source)
+-        last_line = '       ^\n' if sys.version_info >= (3, 2) else ''
+-        column = '8:' if sys.version_info >= (3, 2) else ''
++        last_line = '       ^\n' if ERROR_HAS_LAST_LINE else ''
++        column = '8:' if ERROR_HAS_COL_NUM else ''
+         self.assertHasErrors(
+             sourcePath,
+             ["""\
+@@ -383,8 +410,8 @@ def test_nonKeywordAfterKeywordSyntaxError(self):
+ foo(bar=baz, bax)
+ """
+         sourcePath = self.makeTempFile(source)
+-        last_line = '            ^\n' if sys.version_info >= (3, 2) else ''
+-        column = '13:' if sys.version_info >= (3, 2) else ''
++        last_line = '            ^\n' if ERROR_HAS_LAST_LINE else ''
++        column = '13:' if ERROR_HAS_COL_NUM or PYPY else ''
+ 
+         if sys.version_info >= (3, 5):
+             message = 'positional argument follows keyword argument'
+@@ -407,8 +434,15 @@ def test_invalidEscape(self):
+         sourcePath = self.makeTempFile(r"foo = '\xyz'")
+         if ver < (3,):
+             decoding_error = "%s: problem decoding source\n" % (sourcePath,)
++        elif PYPY:
++            # pypy3 only
++            decoding_error = """\
++%s:1:6: %s: ('unicodeescape', b'\\\\xyz', 0, 2, 'truncated \\\\xXX escape')
++foo = '\\xyz'
++     ^
++""" % (sourcePath, 'UnicodeDecodeError')
+         else:
+-            last_line = '      ^\n' if ver >= (3, 2) else ''
++            last_line = '      ^\n' if ERROR_HAS_LAST_LINE else ''
+             # Column has been "fixed" since 3.2.4 and 3.3.1
+             col = 1 if ver >= (3, 3, 1) or ((3, 2, 4) <= ver < (3, 3)) else 2
+             decoding_error = """\
+@@ -474,8 +508,21 @@ def test_misencodedFileUTF8(self):
+ x = "%s"
+ """ % SNOWMAN).encode('utf-8')
+         sourcePath = self.makeTempFile(source)
++
++        if PYPY and sys.version_info < (3, ):
++            message = ('\'ascii\' codec can\'t decode byte 0xe2 '
++                       'in position 21: ordinal not in range(128)')
++            result = """\
++%s:0:0: %s
++x = "\xe2\x98\x83"
++        ^\n""" % (sourcePath, message)
++
++        else:
++            message = 'problem decoding source'
++            result = "%s: problem decoding source\n" % (sourcePath,)
++
+         self.assertHasErrors(
+-            sourcePath, ["%s: problem decoding source\n" % (sourcePath,)])
++            sourcePath, [result])
+ 
+     def test_misencodedFileUTF16(self):
+         """
+diff --git a/pyflakes/test/test_doctests.py b/pyflakes/test/test_doctests.py
+index f15acb8..6793da9 100644
+--- a/pyflakes/test/test_doctests.py
++++ b/pyflakes/test/test_doctests.py
+@@ -1,3 +1,4 @@
++import sys
+ import textwrap
+ 
+ from pyflakes import messages as m
+@@ -11,6 +12,12 @@
+ from pyflakes.test.test_undefined_names import Test as TestUndefinedNames
+ from pyflakes.test.harness import TestCase, skip
+ 
++try:
++    sys.pypy_version_info
++    PYPY = True
++except AttributeError:
++    PYPY = False
++
+ 
+ class _DoctestMixin(object):
+ 
+@@ -273,12 +280,22 @@ def doctest_stuff():
+         exc = exceptions[0]
+         self.assertEqual(exc.lineno, 4)
+         self.assertEqual(exc.col, 26)
++
++        # PyPy error column offset is 0,
++        # for the second and third line of the doctest
++        # i.e. at the beginning of the line
+         exc = exceptions[1]
+         self.assertEqual(exc.lineno, 5)
+-        self.assertEqual(exc.col, 16)
++        if PYPY:
++            self.assertEqual(exc.col, 13)
++        else:
++            self.assertEqual(exc.col, 16)
+         exc = exceptions[2]
+         self.assertEqual(exc.lineno, 6)
+-        self.assertEqual(exc.col, 18)
++        if PYPY:
++            self.assertEqual(exc.col, 13)
++        else:
++            self.assertEqual(exc.col, 18)
+ 
+     def test_indentationErrorInDoctest(self):
+         exc = self.flakes('''
+@@ -289,7 +306,10 @@ def doctest_stuff():
+             """
+         ''', m.DoctestSyntaxError).messages[0]
+         self.assertEqual(exc.lineno, 5)
+-        self.assertEqual(exc.col, 16)
++        if PYPY:
++            self.assertEqual(exc.col, 13)
++        else:
++            self.assertEqual(exc.col, 16)
+ 
+     def test_offsetWithMultiLineArgs(self):
+         (exc1, exc2) = self.flakes(
+

diff --git a/dev-python/pyflakes/pyflakes-0.7.3.ebuild b/dev-python/pyflakes/pyflakes-0.7.3.ebuild
deleted file mode 100644
index 0924bb9..0000000
--- a/dev-python/pyflakes/pyflakes-0.7.3.ebuild
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-PYTHON_COMPAT=(python{2_7,3_3} )  # not 3.4 yet
-
-inherit distutils-r1
-
-DESCRIPTION="Passive checker for Python programs"
-HOMEPAGE="https://launchpad.net/pyflakes https://pypi.python.org/pypi/pyflakes"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="amd64 ~ppc ~ppc64 x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
-IUSE=""
-
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
-RDEPEND="${DEPEND}"
-
-DOCS=(AUTHORS NEWS.txt README.rst)
-
-python_test() {
-	esetup.py test --quiet
-}

diff --git a/dev-python/pyflakes/pyflakes-0.9.2.ebuild b/dev-python/pyflakes/pyflakes-1.0.0.ebuild
similarity index 87%
rename from dev-python/pyflakes/pyflakes-0.9.2.ebuild
rename to dev-python/pyflakes/pyflakes-1.0.0.ebuild
index c870514..732586c 100644
--- a/dev-python/pyflakes/pyflakes-0.9.2.ebuild
+++ b/dev-python/pyflakes/pyflakes-1.0.0.ebuild
@@ -3,7 +3,7 @@
 # $Id$
 
 EAPI=5
-PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+PYTHON_COMPAT=( python{2_7,3_4,3_5} pypy )
 
 inherit distutils-r1
 
@@ -19,6 +19,8 @@ IUSE=""
 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
 RDEPEND="${DEPEND}"
 
+PATCHES=( "${FILESDIR}"/fix-pypy-tests.patch )
+
 python_test() {
 	esetup.py test --quiet
 }


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pyflakes/files/, dev-python/pyflakes/
@ 2019-11-29 19:56 Patrick McLean
  0 siblings, 0 replies; 5+ messages in thread
From: Patrick McLean @ 2019-11-29 19:56 UTC (permalink / raw
  To: gentoo-commits

commit:     3bad779f43274c480b0433cb8514c01a471370eb
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 29 01:02:17 2019 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Fri Nov 29 19:56:18 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3bad779f

dev-python/pyflakes-2.1.1: bump, add py38

Package-Manager: Portage-2.3.80, Repoman-2.3.19
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 dev-python/pyflakes/Manifest                       |   1 +
 .../pyflakes/files/pyflakes-2.1.1-py38.patch       |  42 +++++
 .../pyflakes/files/pyflakes-2.1.1-tests.patch      | 207 +++++++++++++++++++++
 dev-python/pyflakes/pyflakes-2.1.1.ebuild          |  25 +++
 4 files changed, 275 insertions(+)

diff --git a/dev-python/pyflakes/Manifest b/dev-python/pyflakes/Manifest
index 71ef0fbef3a..36f7f86dfd0 100644
--- a/dev-python/pyflakes/Manifest
+++ b/dev-python/pyflakes/Manifest
@@ -3,3 +3,4 @@ DIST pyflakes-1.0.0.tar.gz 35365 BLAKE2B 7b0f676fcb1f77f85a4fa85f02dd26f181f7d80
 DIST pyflakes-1.2.3.tar.gz 44776 BLAKE2B 9effec80b58ebac140a6a8b2f5f31a32c4fdf9e842d3fbd2858a3e74f33920925f10b6377300d962d1e2b1931efe8bb5318b97ef51c99aeb003a3434d08810db SHA512 e0b49b4cd388b39c4f4f5ab836520cfc2ee940ce24de084fbeca0a2f13beca23b3ca89741e297a6f450d211ec27ebd91a7d23a80105e50d14960a3888d7693f2
 DIST pyflakes-1.6.0.tar.gz 48184 BLAKE2B a5762c23521aa68ea92537fbc2903bb7af64faf8d1fafc97e48e003f529f8c16ae8dca444c9122fc5c50618fec7120b2f2b2e6682e1d86e502ab49096cb42bfc SHA512 7e9c2aad6ebed638a1354cef51c7e1f68b25e59f8caf4694997a9afecd7cd8baa629a9363297ac0d961430f007fd22dcae7dae1bcbd7838a3b5d4285063bc7c5
 DIST pyflakes-2.0.0.tar.gz 49002 BLAKE2B 146d1108b7cf9aca3316d33ad2ac3a0d1627af525b5def8c6140787fb4d1f47bb45c3c9ec9cb755e51e7ca4e947346e5e9de9b4a1b461389ff1bc4521371a684 SHA512 4961ebb8372f51783416681e79342d6be94318ecd007190e5c27f46c48f8f163c7a5f49cbe3025789ff1d9cd37c465b2f3baa219059779163545f9828a766f71
+DIST pyflakes-2.1.1.tar.gz 58072 BLAKE2B 68dccddae2a9dc77f2d1f1251c80e2552935281b6b79e55fd2a0805cb30bf5e1c227b60a7e1f55f5f92ac42dfd18a69eb0b76ce06f43ac1c48dde3921817a271 SHA512 7ebf5843b38146305c1063e070480fea8ec3b47fa1be546b1fafaeb242a688a5a001f978e7257fd71d5905b9a338b466ef17c7330725191587e9c40ba632c3f8

diff --git a/dev-python/pyflakes/files/pyflakes-2.1.1-py38.patch b/dev-python/pyflakes/files/pyflakes-2.1.1-py38.patch
new file mode 100644
index 00000000000..f9f00b895f5
--- /dev/null
+++ b/dev-python/pyflakes/files/pyflakes-2.1.1-py38.patch
@@ -0,0 +1,42 @@
+commit 1911c203a13826d2eb03d582d60874b91e36f4fc
+Author: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
+Date:   Sun Nov 3 22:51:27 2019 +0300
+
+    Allow continue inside finally in 3.8+ (#476)
+
+diff --git a/pyflakes/checker.py b/pyflakes/checker.py
+index eca2002..c8ccf56 100644
+--- a/pyflakes/checker.py
++++ b/pyflakes/checker.py
+@@ -1738,7 +1738,7 @@ class Checker(object):
+                 break
+             # Handle Try/TryFinally difference in Python < and >= 3.3
+             if hasattr(n, 'finalbody') and isinstance(node, ast.Continue):
+-                if n_child in n.finalbody:
++                if n_child in n.finalbody and not PY38_PLUS:
+                     self.report(messages.ContinueInFinally, node)
+                     return
+         if isinstance(node, ast.Continue):
+diff --git a/pyflakes/test/test_other.py b/pyflakes/test/test_other.py
+index df2f790..282accb 100644
+--- a/pyflakes/test/test_other.py
++++ b/pyflakes/test/test_other.py
+@@ -493,8 +493,10 @@ class Test(TestCase):
+                     continue
+         ''')
+ 
++    @skipIf(version_info > (3, 8), "Python <= 3.8 only")
+     def test_continueInFinally(self):
+         # 'continue' inside 'finally' is a special syntax error
++        # that is removed in 3.8
+         self.flakes('''
+         while True:
+             try:
+@@ -2003,6 +2005,7 @@ class TestAsyncStatements(TestCase):
+         ''', m.BreakOutsideLoop)
+ 
+     @skipIf(version_info < (3, 5), 'new in Python 3.5')
++    @skipIf(version_info > (3, 8), "Python <= 3.8 only")
+     def test_continueInAsyncForFinally(self):
+         self.flakes('''
+         async def read_data(db):

diff --git a/dev-python/pyflakes/files/pyflakes-2.1.1-tests.patch b/dev-python/pyflakes/files/pyflakes-2.1.1-tests.patch
new file mode 100644
index 00000000000..5e1a445e161
--- /dev/null
+++ b/dev-python/pyflakes/files/pyflakes-2.1.1-tests.patch
@@ -0,0 +1,207 @@
+diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py
+index ee205f9..e295bd9 100644
+--- a/pyflakes/test/test_api.py
++++ b/pyflakes/test/test_api.py
+@@ -9,7 +9,6 @@ import shutil
+ import subprocess
+ import tempfile
+ 
+-from pyflakes.checker import PY2
+ from pyflakes.messages import UnusedImport
+ from pyflakes.reporter import Reporter
+ from pyflakes.api import (
+@@ -423,7 +422,7 @@ def baz():
+ 
+         with self.makeTempFile(source) as sourcePath:
+             if PYPY:
+-                message = 'EOF while scanning triple-quoted string literal'
++                message = 'end of file (EOF) while scanning triple-quoted string literal'
+             else:
+                 message = 'invalid syntax'
+ 
+@@ -465,8 +464,8 @@ def foo(
+         syntax error reflects the cause for the syntax error.
+         """
+         with self.makeTempFile("if True:\n\tfoo =") as sourcePath:
+-            column = 5 if PYPY else 7
+-            last_line = '\t   ^' if PYPY else '\t     ^'
++            column = 6 if PYPY else 7
++            last_line = '\t    ^' if PYPY else '\t     ^'
+ 
+             self.assertHasErrors(
+                 sourcePath,
+@@ -476,6 +475,7 @@ def foo(
+ %s
+ """ % (sourcePath, column, last_line)])
+ 
++    @skipIf(PYPY, "Broken on pypy")
+     def test_nonDefaultFollowsDefaultSyntaxError(self):
+         """
+         Source which has a non-default argument following a default argument
+@@ -488,7 +488,12 @@ def foo(bar=baz, bax):
+ """
+         with self.makeTempFile(source) as sourcePath:
+             if ERROR_HAS_LAST_LINE:
+-                column = 9 if sys.version_info >= (3, 8) else 8
++                if PYPY and sys.version_info >= (3,):
++                    column = 7
++                elif sys.version_info >= (3, 8):
++                    column = 9
++                else:
++                    column = 8
+                 last_line = ' ' * (column - 1) + '^\n'
+                 columnstr = '%d:' % column
+             else:
+@@ -500,6 +505,7 @@ def foo(bar=baz, bax):
+ def foo(bar=baz, bax):
+ %s""" % (sourcePath, columnstr, last_line)])
+ 
++    @skipIf(PYPY, "Broken on pypy")
+     def test_nonKeywordAfterKeywordSyntaxError(self):
+         """
+         Source which has a non-keyword argument after a keyword argument should
+@@ -511,7 +517,12 @@ foo(bar=baz, bax)
+ """
+         with self.makeTempFile(source) as sourcePath:
+             if ERROR_HAS_LAST_LINE:
+-                column = 14 if sys.version_info >= (3, 8) else 13
++                if PYPY and sys.version_info >= (3,):
++                    column = 12
++                elif sys.version_info >= (3, 8):
++                    column = 14
++                else:
++                    column = 13
+                 last_line = ' ' * (column - 1) + '^\n'
+                 columnstr = '%d:' % column
+             else:
+@@ -529,6 +540,7 @@ foo(bar=baz, bax)
+ foo(bar=baz, bax)
+ %s""" % (sourcePath, columnstr, message, last_line)])
+ 
++    @skipIf(PYPY and sys.hexversion < 0x3080000, "broken on pypy3")
+     def test_invalidEscape(self):
+         """
+         The invalid escape syntax raises ValueError in Python 2
+@@ -681,6 +693,12 @@ class IntegrationTests(TestCase):
+     Tests of the pyflakes script that actually spawn the script.
+     """
+ 
++    # https://bitbucket.org/pypy/pypy/issues/3069/pypy36-on-windows-incorrect-line-separator
++    if PYPY and sys.version_info >= (3,) and WIN:
++        LINESEP = '\n'
++    else:
++        LINESEP = os.linesep
++
+     def setUp(self):
+         self.tempdir = tempfile.mkdtemp()
+         self.tempfilepath = os.path.join(self.tempdir, 'temp')
+@@ -721,9 +739,6 @@ class IntegrationTests(TestCase):
+         if sys.version_info >= (3,):
+             stdout = stdout.decode('utf-8')
+             stderr = stderr.decode('utf-8')
+-        # Workaround https://bitbucket.org/pypy/pypy/issues/2350
+-        if PYPY and PY2 and WIN:
+-            stderr = stderr.replace('\r\r\n', '\r\n')
+         return (stdout, stderr, rv)
+ 
+     def test_goodFile(self):
+@@ -744,7 +759,7 @@ class IntegrationTests(TestCase):
+             fd.write("import contraband\n".encode('ascii'))
+         d = self.runPyflakes([self.tempfilepath])
+         expected = UnusedImport(self.tempfilepath, Node(1), 'contraband')
+-        self.assertEqual(d, ("%s%s" % (expected, os.linesep), '', 1))
++        self.assertEqual(d, ("%s%s" % (expected, self.LINESEP), '', 1))
+ 
+     def test_errors_io(self):
+         """
+@@ -754,7 +769,7 @@ class IntegrationTests(TestCase):
+         """
+         d = self.runPyflakes([self.tempfilepath])
+         error_msg = '%s: No such file or directory%s' % (self.tempfilepath,
+-                                                         os.linesep)
++                                                         self.LINESEP)
+         self.assertEqual(d, ('', error_msg, 1))
+ 
+     def test_errors_syntax(self):
+@@ -766,8 +781,8 @@ class IntegrationTests(TestCase):
+         with open(self.tempfilepath, 'wb') as fd:
+             fd.write("import".encode('ascii'))
+         d = self.runPyflakes([self.tempfilepath])
+-        error_msg = '{0}:1:{2}: invalid syntax{1}import{1}    {3}^{1}'.format(
+-            self.tempfilepath, os.linesep, 5 if PYPY else 7, '' if PYPY else '  ')
++        error_msg = '{0}:1:{2}: invalid syntax{1}import{1}     {3}^{1}'.format(
++            self.tempfilepath, self.LINESEP, 6 if PYPY else 7, '' if PYPY else ' ')
+         self.assertEqual(d, ('', error_msg, 1))
+ 
+     def test_readFromStdin(self):
+@@ -776,13 +791,14 @@ class IntegrationTests(TestCase):
+         """
+         d = self.runPyflakes([], stdin='import contraband')
+         expected = UnusedImport('<stdin>', Node(1), 'contraband')
+-        self.assertEqual(d, ("%s%s" % (expected, os.linesep), '', 1))
++        self.assertEqual(d, ("%s%s" % (expected, self.LINESEP), '', 1))
+ 
+ 
+ class TestMain(IntegrationTests):
+     """
+     Tests of the pyflakes main function.
+     """
++    LINESEP = os.linesep
+ 
+     def runPyflakes(self, paths, stdin=None):
+         try:
+diff --git a/pyflakes/test/test_doctests.py b/pyflakes/test/test_doctests.py
+index 0825ffe..a474bb1 100644
+--- a/pyflakes/test/test_doctests.py
++++ b/pyflakes/test/test_doctests.py
+@@ -328,7 +328,9 @@ class Test(TestCase):
+             m.DoctestSyntaxError).messages
+         exc = exceptions[0]
+         self.assertEqual(exc.lineno, 4)
+-        if sys.version_info >= (3, 8):
++        if PYPY:
++            self.assertEqual(exc.col, 27)
++        elif sys.version_info >= (3, 8):
+             self.assertEqual(exc.col, 18)
+         else:
+             self.assertEqual(exc.col, 26)
+@@ -339,12 +341,14 @@ class Test(TestCase):
+         exc = exceptions[1]
+         self.assertEqual(exc.lineno, 5)
+         if PYPY:
+-            self.assertEqual(exc.col, 13)
++            self.assertEqual(exc.col, 14)
+         else:
+             self.assertEqual(exc.col, 16)
+         exc = exceptions[2]
+         self.assertEqual(exc.lineno, 6)
+-        if PYPY or sys.version_info >= (3, 8):
++        if PYPY:
++            self.assertEqual(exc.col, 14)
++        elif sys.version_info >= (3, 8):
+             self.assertEqual(exc.col, 13)
+         else:
+             self.assertEqual(exc.col, 18)
+@@ -358,7 +362,9 @@ class Test(TestCase):
+             """
+         ''', m.DoctestSyntaxError).messages[0]
+         self.assertEqual(exc.lineno, 5)
+-        if PYPY or sys.version_info >= (3, 8):
++        if PYPY:
++            self.assertEqual(exc.col, 14)
++        elif sys.version_info >= (3, 8):
+             self.assertEqual(exc.col, 13)
+         else:
+             self.assertEqual(exc.col, 16)
+@@ -377,7 +383,10 @@ class Test(TestCase):
+             m.DoctestSyntaxError,
+             m.UndefinedName).messages
+         self.assertEqual(exc1.lineno, 6)
+-        self.assertEqual(exc1.col, 19)
++        if PYPY:
++            self.assertEqual(exc1.col, 20)
++        else:
++            self.assertEqual(exc1.col, 19)
+         self.assertEqual(exc2.lineno, 7)
+         self.assertEqual(exc2.col, 12)
+ 

diff --git a/dev-python/pyflakes/pyflakes-2.1.1.ebuild b/dev-python/pyflakes/pyflakes-2.1.1.ebuild
new file mode 100644
index 00000000000..f6e2a0f4ae2
--- /dev/null
+++ b/dev-python/pyflakes/pyflakes-2.1.1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} pypy{,3} )
+
+inherit distutils-r1
+
+DESCRIPTION="Passive checker for Python programs"
+HOMEPAGE="https://github.com/PyCQA/pyflakes https://pypi.org/project/pyflakes/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+
+BDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+RDEPEND="${BDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/pyflakes-2.1.1-tests.patch"
+	"${FILESDIR}/pyflakes-2.1.1-py38.patch"
+)
+
+distutils_enable_tests unittest


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pyflakes/files/, dev-python/pyflakes/
@ 2020-01-26 20:52 Andreas Sturmlechner
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Sturmlechner @ 2020-01-26 20:52 UTC (permalink / raw
  To: gentoo-commits

commit:     288672be5196696c63bf4e1e94a9d80c85cb6dd0
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 26 00:59:31 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Jan 26 20:52:22 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=288672be

dev-python/pyflakes: Drop 1.0.0, 1.2.3, 2.0.0

Package-Manager: Portage-2.3.85, Repoman-2.3.20
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 dev-python/pyflakes/Manifest                       |   3 -
 .../pyflakes/files/1.0.0-fix-pypy-tests.patch      | 282 ---------------------
 dev-python/pyflakes/pyflakes-1.0.0.ebuild          |  25 --
 dev-python/pyflakes/pyflakes-1.2.3.ebuild          |  23 --
 dev-python/pyflakes/pyflakes-2.0.0.ebuild          |  22 --
 5 files changed, 355 deletions(-)

diff --git a/dev-python/pyflakes/Manifest b/dev-python/pyflakes/Manifest
index 36f7f86dfd0..35c9f7b1285 100644
--- a/dev-python/pyflakes/Manifest
+++ b/dev-python/pyflakes/Manifest
@@ -1,6 +1,3 @@
 DIST pyflakes-0.8.1.tar.gz 32981 BLAKE2B a4d02202e5cc9e1174d9296834edae7bc2c3d66e0081979438ceaa80dab9dcf41710b23015f8fcabea062d7dbb249ffc7521657d0860fd115cf58b441721b778 SHA512 b9843637891f3e82a8430121395ceb4ec5df48b5ba73b96a307ebcb4a393e8cebee1681e094ee1f71a85b58bd2f32562b78fbd61d3fa85634f3ac448b1244637
-DIST pyflakes-1.0.0.tar.gz 35365 BLAKE2B 7b0f676fcb1f77f85a4fa85f02dd26f181f7d8085ef3226cd06b3f1d33b9b235384c7da835b07b8128ac5ba56e8b5e4f0cb5736b25e18bd50c76c6ace9491368 SHA512 89a9ee2e5be87d32d5c259c0cb88bbeadb96d27a3bc5eb3cf6f86afa51907ea01107a5336decbf003679b7de65ed9a16d7fbf55a457e0c9bbb1b53500f719bcb
-DIST pyflakes-1.2.3.tar.gz 44776 BLAKE2B 9effec80b58ebac140a6a8b2f5f31a32c4fdf9e842d3fbd2858a3e74f33920925f10b6377300d962d1e2b1931efe8bb5318b97ef51c99aeb003a3434d08810db SHA512 e0b49b4cd388b39c4f4f5ab836520cfc2ee940ce24de084fbeca0a2f13beca23b3ca89741e297a6f450d211ec27ebd91a7d23a80105e50d14960a3888d7693f2
 DIST pyflakes-1.6.0.tar.gz 48184 BLAKE2B a5762c23521aa68ea92537fbc2903bb7af64faf8d1fafc97e48e003f529f8c16ae8dca444c9122fc5c50618fec7120b2f2b2e6682e1d86e502ab49096cb42bfc SHA512 7e9c2aad6ebed638a1354cef51c7e1f68b25e59f8caf4694997a9afecd7cd8baa629a9363297ac0d961430f007fd22dcae7dae1bcbd7838a3b5d4285063bc7c5
-DIST pyflakes-2.0.0.tar.gz 49002 BLAKE2B 146d1108b7cf9aca3316d33ad2ac3a0d1627af525b5def8c6140787fb4d1f47bb45c3c9ec9cb755e51e7ca4e947346e5e9de9b4a1b461389ff1bc4521371a684 SHA512 4961ebb8372f51783416681e79342d6be94318ecd007190e5c27f46c48f8f163c7a5f49cbe3025789ff1d9cd37c465b2f3baa219059779163545f9828a766f71
 DIST pyflakes-2.1.1.tar.gz 58072 BLAKE2B 68dccddae2a9dc77f2d1f1251c80e2552935281b6b79e55fd2a0805cb30bf5e1c227b60a7e1f55f5f92ac42dfd18a69eb0b76ce06f43ac1c48dde3921817a271 SHA512 7ebf5843b38146305c1063e070480fea8ec3b47fa1be546b1fafaeb242a688a5a001f978e7257fd71d5905b9a338b466ef17c7330725191587e9c40ba632c3f8

diff --git a/dev-python/pyflakes/files/1.0.0-fix-pypy-tests.patch b/dev-python/pyflakes/files/1.0.0-fix-pypy-tests.patch
deleted file mode 100644
index 41d1fa8ca86..00000000000
--- a/dev-python/pyflakes/files/1.0.0-fix-pypy-tests.patch
+++ /dev/null
@@ -1,282 +0,0 @@
-#https://github.com/jayvdb/pyflakes/commit/3088ffbd6256521e0213b361bc2294c1e218e6fb
-diff --git a/pyflakes/api.py b/pyflakes/api.py  #index 3bc2330..2a46a0d 100644
---- a/pyflakes/api.py
-+++ b/pyflakes/api.py
-@@ -41,6 +41,18 @@ def check(codeString, filename, reporter=None):
-
-         (lineno, offset, text) = value.lineno, value.offset, value.text
- 
-+        if checker.PYPY:
-+            if text is None:
-+                lines = codeString.splitlines()
-+                if len(lines) >= lineno:
-+                    text = lines[lineno - 1]
-+                    if sys.version_info >= (3, ) and isinstance(text, bytes):
-+                        try:
-+                            text = text.decode('ascii')
-+                        except UnicodeDecodeError:
-+                            text = None
-+            offset -= 1
-+
-         # If there's an encoding problem with the file, the text is None.
-         if text is None:
-             # Avoid using msg, since for the only known case, it contains a
-diff --git a/pyflakes/checker.py b/pyflakes/checker.py
-index 753fa9b..f538d3f 100644
---- a/pyflakes/checker.py
-+++ b/pyflakes/checker.py
-@@ -11,6 +11,12 @@
- PY2 = sys.version_info < (3, 0)
- PY32 = sys.version_info < (3, 3)    # Python 2.5 to 3.2
- PY33 = sys.version_info < (3, 4)    # Python 2.5 to 3.3
-+try:
-+    sys.pypy_version_info
-+    PYPY = True
-+except AttributeError:
-+    PYPY = False
-+
- builtin_vars = dir(__import__('__builtin__' if PY2 else 'builtins'))
- 
- try:
-@@ -594,8 +600,13 @@ def getDocstring(self, node):
-             node = node.value
-         if not isinstance(node, ast.Str):
-             return (None, None)
--        # Computed incorrectly if the docstring has backslash
--        doctest_lineno = node.lineno - node.s.count('\n') - 1
-+
-+        if PYPY:
-+            doctest_lineno = node.lineno - 1
-+        else:
-+            # Computed incorrectly if the docstring has backslash
-+            doctest_lineno = node.lineno - node.s.count('\n') - 1
-+
-         return (node.s, doctest_lineno)
- 
-     def handleNode(self, node, parent):
-@@ -642,6 +653,8 @@ def handleDoctests(self, node):
-                 tree = compile(example.source, "<doctest>", "exec", ast.PyCF_ONLY_AST)
-             except SyntaxError:
-                 e = sys.exc_info()[1]
-+                if PYPY:
-+                    e.offset += 1
-                 position = (node_lineno + example.lineno + e.lineno,
-                             example.indent + 4 + (e.offset or 0))
-                 self.report(messages.DoctestSyntaxError, node, position)
-diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py
-index 34a59bc..d2a5036 100644
---- a/pyflakes/test/test_api.py
-+++ b/pyflakes/test/test_api.py
-@@ -23,6 +23,14 @@
-     from io import StringIO
-     unichr = chr
- 
-+try:
-+    sys.pypy_version_info
-+    PYPY = True
-+except AttributeError:
-+    PYPY = False
-+
-+ERROR_HAS_COL_NUM = ERROR_HAS_LAST_LINE = sys.version_info >= (3, 2) or PYPY
-+
- 
- def withStderrTo(stderr, f, *args, **kwargs):
-     """
-@@ -312,18 +320,25 @@ def evaluate(source):
-             evaluate(source)
-         except SyntaxError:
-             e = sys.exc_info()[1]
--            self.assertTrue(e.text.count('\n') > 1)
-+            if not PYPY:
-+                self.assertTrue(e.text.count('\n') > 1)
-         else:
-             self.fail()
- 
-         sourcePath = self.makeTempFile(source)
-+
-+        if PYPY:
-+            message = 'EOF while scanning triple-quoted string literal'
-+        else:
-+            message = 'invalid syntax'
-+
-         self.assertHasErrors(
-             sourcePath,
-             ["""\
--%s:8:11: invalid syntax
-+%s:8:11: %s
-     '''quux'''
-           ^
--""" % (sourcePath,)])
-+""" % (sourcePath, message)])
- 
-     def test_eofSyntaxError(self):
-         """
-@@ -331,13 +346,22 @@ def test_eofSyntaxError(self):
-         syntax error reflects the cause for the syntax error.
-         """
-         sourcePath = self.makeTempFile("def foo(")
--        self.assertHasErrors(
--            sourcePath,
--            ["""\
-+        if PYPY:
-+            result = """\
-+%s:1:7: parenthesis is never closed
-+def foo(
-+      ^
-+""" % (sourcePath,)
-+        else:
-+            result = """\
- %s:1:9: unexpected EOF while parsing
- def foo(
-         ^
--""" % (sourcePath,)])
-+""" % (sourcePath,)
-+
-+        self.assertHasErrors(
-+            sourcePath,
-+            [result])
- 
-     def test_eofSyntaxErrorWithTab(self):
-         """
-@@ -345,13 +369,16 @@ def test_eofSyntaxErrorWithTab(self):
-         syntax error reflects the cause for the syntax error.
-         """
-         sourcePath = self.makeTempFile("if True:\n\tfoo =")
-+        column = 5 if PYPY else 7
-+        last_line = '\t   ^' if PYPY else '\t     ^'
-+
-         self.assertHasErrors(
-             sourcePath,
-             ["""\
--%s:2:7: invalid syntax
-+%s:2:%s: invalid syntax
- \tfoo =
--\t     ^
--""" % (sourcePath,)])
-+%s
-+""" % (sourcePath, column, last_line)])
- 
-     def test_nonDefaultFollowsDefaultSyntaxError(self):
-         """
-@@ -364,8 +391,8 @@ def foo(bar=baz, bax):
-     pass
- """
-         sourcePath = self.makeTempFile(source)
--        last_line = '       ^\n' if sys.version_info >= (3, 2) else ''
--        column = '8:' if sys.version_info >= (3, 2) else ''
-+        last_line = '       ^\n' if ERROR_HAS_LAST_LINE else ''
-+        column = '8:' if ERROR_HAS_COL_NUM else ''
-         self.assertHasErrors(
-             sourcePath,
-             ["""\
-@@ -383,8 +410,8 @@ def test_nonKeywordAfterKeywordSyntaxError(self):
- foo(bar=baz, bax)
- """
-         sourcePath = self.makeTempFile(source)
--        last_line = '            ^\n' if sys.version_info >= (3, 2) else ''
--        column = '13:' if sys.version_info >= (3, 2) else ''
-+        last_line = '            ^\n' if ERROR_HAS_LAST_LINE else ''
-+        column = '13:' if ERROR_HAS_COL_NUM or PYPY else ''
- 
-         if sys.version_info >= (3, 5):
-             message = 'positional argument follows keyword argument'
-@@ -407,8 +434,15 @@ def test_invalidEscape(self):
-         sourcePath = self.makeTempFile(r"foo = '\xyz'")
-         if ver < (3,):
-             decoding_error = "%s: problem decoding source\n" % (sourcePath,)
-+        elif PYPY:
-+            # pypy3 only
-+            decoding_error = """\
-+%s:1:6: %s: ('unicodeescape', b'\\\\xyz', 0, 2, 'truncated \\\\xXX escape')
-+foo = '\\xyz'
-+     ^
-+""" % (sourcePath, 'UnicodeDecodeError')
-         else:
--            last_line = '      ^\n' if ver >= (3, 2) else ''
-+            last_line = '      ^\n' if ERROR_HAS_LAST_LINE else ''
-             # Column has been "fixed" since 3.2.4 and 3.3.1
-             col = 1 if ver >= (3, 3, 1) or ((3, 2, 4) <= ver < (3, 3)) else 2
-             decoding_error = """\
-@@ -474,8 +508,21 @@ def test_misencodedFileUTF8(self):
- x = "%s"
- """ % SNOWMAN).encode('utf-8')
-         sourcePath = self.makeTempFile(source)
-+
-+        if PYPY and sys.version_info < (3, ):
-+            message = ('\'ascii\' codec can\'t decode byte 0xe2 '
-+                       'in position 21: ordinal not in range(128)')
-+            result = """\
-+%s:0:0: %s
-+x = "\xe2\x98\x83"
-+        ^\n""" % (sourcePath, message)
-+
-+        else:
-+            message = 'problem decoding source'
-+            result = "%s: problem decoding source\n" % (sourcePath,)
-+
-         self.assertHasErrors(
--            sourcePath, ["%s: problem decoding source\n" % (sourcePath,)])
-+            sourcePath, [result])
- 
-     def test_misencodedFileUTF16(self):
-         """
-diff --git a/pyflakes/test/test_doctests.py b/pyflakes/test/test_doctests.py
-index f15acb8..6793da9 100644
---- a/pyflakes/test/test_doctests.py
-+++ b/pyflakes/test/test_doctests.py
-@@ -1,3 +1,4 @@
-+import sys
- import textwrap
- 
- from pyflakes import messages as m
-@@ -11,6 +12,12 @@
- from pyflakes.test.test_undefined_names import Test as TestUndefinedNames
- from pyflakes.test.harness import TestCase, skip
- 
-+try:
-+    sys.pypy_version_info
-+    PYPY = True
-+except AttributeError:
-+    PYPY = False
-+
- 
- class _DoctestMixin(object):
- 
-@@ -273,12 +280,22 @@ def doctest_stuff():
-         exc = exceptions[0]
-         self.assertEqual(exc.lineno, 4)
-         self.assertEqual(exc.col, 26)
-+
-+        # PyPy error column offset is 0,
-+        # for the second and third line of the doctest
-+        # i.e. at the beginning of the line
-         exc = exceptions[1]
-         self.assertEqual(exc.lineno, 5)
--        self.assertEqual(exc.col, 16)
-+        if PYPY:
-+            self.assertEqual(exc.col, 13)
-+        else:
-+            self.assertEqual(exc.col, 16)
-         exc = exceptions[2]
-         self.assertEqual(exc.lineno, 6)
--        self.assertEqual(exc.col, 18)
-+        if PYPY:
-+            self.assertEqual(exc.col, 13)
-+        else:
-+            self.assertEqual(exc.col, 18)
- 
-     def test_indentationErrorInDoctest(self):
-         exc = self.flakes('''
-@@ -289,7 +306,10 @@ def doctest_stuff():
-             """
-         ''', m.DoctestSyntaxError).messages[0]
-         self.assertEqual(exc.lineno, 5)
--        self.assertEqual(exc.col, 16)
-+        if PYPY:
-+            self.assertEqual(exc.col, 13)
-+        else:
-+            self.assertEqual(exc.col, 16)
- 
-     def test_offsetWithMultiLineArgs(self):
-         (exc1, exc2) = self.flakes(
-

diff --git a/dev-python/pyflakes/pyflakes-1.0.0.ebuild b/dev-python/pyflakes/pyflakes-1.0.0.ebuild
deleted file mode 100644
index 6dd529e80c4..00000000000
--- a/dev-python/pyflakes/pyflakes-1.0.0.ebuild
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-PYTHON_COMPAT=( python2_7 python3_{6,7} )
-
-inherit distutils-r1
-
-DESCRIPTION="Passive checker for Python programs"
-HOMEPAGE="https://launchpad.net/pyflakes https://pypi.org/project/pyflakes/"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE=""
-
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
-RDEPEND="${DEPEND}"
-
-PATCHES=( "${FILESDIR}"/${PV}-fix-pypy-tests.patch )
-
-python_test() {
-	esetup.py test --quiet
-}

diff --git a/dev-python/pyflakes/pyflakes-1.2.3.ebuild b/dev-python/pyflakes/pyflakes-1.2.3.ebuild
deleted file mode 100644
index a147fbfc164..00000000000
--- a/dev-python/pyflakes/pyflakes-1.2.3.ebuild
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python2_7 python3_6 pypy3 )
-
-inherit distutils-r1
-
-DESCRIPTION="Passive checker for Python programs"
-HOMEPAGE="https://launchpad.net/pyflakes https://pypi.org/project/pyflakes/"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE=""
-
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
-RDEPEND="${DEPEND}"
-
-python_test() {
-	esetup.py test --quiet
-}

diff --git a/dev-python/pyflakes/pyflakes-2.0.0.ebuild b/dev-python/pyflakes/pyflakes-2.0.0.ebuild
deleted file mode 100644
index 896bceee4a8..00000000000
--- a/dev-python/pyflakes/pyflakes-2.0.0.ebuild
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python2_7 python3_{6,7} pypy3 )
-
-inherit distutils-r1
-
-DESCRIPTION="Passive checker for Python programs"
-HOMEPAGE="https://github.com/PyCQA/pyflakes https://pypi.org/project/pyflakes/"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
-RDEPEND="${DEPEND}"
-
-python_test() {
-	esetup.py test
-}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pyflakes/files/, dev-python/pyflakes/
@ 2020-09-20  9:36 Michał Górny
  0 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2020-09-20  9:36 UTC (permalink / raw
  To: gentoo-commits

commit:     4011fd63774c33092af2547228a4016f86a86fc8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 20 09:10:48 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 09:36:19 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4011fd63

dev-python/pyflakes: Remove old

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pyflakes/Manifest                       |   1 -
 .../pyflakes/files/pyflakes-2.1.1-py38.patch       |  42 -----
 .../pyflakes/files/pyflakes-2.1.1-tests.patch      | 207 ---------------------
 dev-python/pyflakes/pyflakes-2.1.1.ebuild          |  25 ---
 4 files changed, 275 deletions(-)

diff --git a/dev-python/pyflakes/Manifest b/dev-python/pyflakes/Manifest
index 743563948f6..b3bb3b6bc03 100644
--- a/dev-python/pyflakes/Manifest
+++ b/dev-python/pyflakes/Manifest
@@ -1,2 +1 @@
-DIST pyflakes-2.1.1.tar.gz 58072 BLAKE2B 68dccddae2a9dc77f2d1f1251c80e2552935281b6b79e55fd2a0805cb30bf5e1c227b60a7e1f55f5f92ac42dfd18a69eb0b76ce06f43ac1c48dde3921817a271 SHA512 7ebf5843b38146305c1063e070480fea8ec3b47fa1be546b1fafaeb242a688a5a001f978e7257fd71d5905b9a338b466ef17c7330725191587e9c40ba632c3f8
 DIST pyflakes-2.2.0.tar.gz 65307 BLAKE2B e48e0cb0497f90b6482c0fd08c182d766ab50755fe348352df510841f4ad43f7c1d6486753ce774603a3624f49c9b0165ad930bb1451ef30cf2e828d732e0652 SHA512 6a411efef261874c216b71bcb095412448a8cbeefdf7fa5577d4f4edd48a4a740a4433665e87e5dda2c08fd9ee3bfb7f134f56c7523e1303243edfa92b0ccb35

diff --git a/dev-python/pyflakes/files/pyflakes-2.1.1-py38.patch b/dev-python/pyflakes/files/pyflakes-2.1.1-py38.patch
deleted file mode 100644
index f9f00b895f5..00000000000
--- a/dev-python/pyflakes/files/pyflakes-2.1.1-py38.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-commit 1911c203a13826d2eb03d582d60874b91e36f4fc
-Author: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
-Date:   Sun Nov 3 22:51:27 2019 +0300
-
-    Allow continue inside finally in 3.8+ (#476)
-
-diff --git a/pyflakes/checker.py b/pyflakes/checker.py
-index eca2002..c8ccf56 100644
---- a/pyflakes/checker.py
-+++ b/pyflakes/checker.py
-@@ -1738,7 +1738,7 @@ class Checker(object):
-                 break
-             # Handle Try/TryFinally difference in Python < and >= 3.3
-             if hasattr(n, 'finalbody') and isinstance(node, ast.Continue):
--                if n_child in n.finalbody:
-+                if n_child in n.finalbody and not PY38_PLUS:
-                     self.report(messages.ContinueInFinally, node)
-                     return
-         if isinstance(node, ast.Continue):
-diff --git a/pyflakes/test/test_other.py b/pyflakes/test/test_other.py
-index df2f790..282accb 100644
---- a/pyflakes/test/test_other.py
-+++ b/pyflakes/test/test_other.py
-@@ -493,8 +493,10 @@ class Test(TestCase):
-                     continue
-         ''')
- 
-+    @skipIf(version_info > (3, 8), "Python <= 3.8 only")
-     def test_continueInFinally(self):
-         # 'continue' inside 'finally' is a special syntax error
-+        # that is removed in 3.8
-         self.flakes('''
-         while True:
-             try:
-@@ -2003,6 +2005,7 @@ class TestAsyncStatements(TestCase):
-         ''', m.BreakOutsideLoop)
- 
-     @skipIf(version_info < (3, 5), 'new in Python 3.5')
-+    @skipIf(version_info > (3, 8), "Python <= 3.8 only")
-     def test_continueInAsyncForFinally(self):
-         self.flakes('''
-         async def read_data(db):

diff --git a/dev-python/pyflakes/files/pyflakes-2.1.1-tests.patch b/dev-python/pyflakes/files/pyflakes-2.1.1-tests.patch
deleted file mode 100644
index 5e1a445e161..00000000000
--- a/dev-python/pyflakes/files/pyflakes-2.1.1-tests.patch
+++ /dev/null
@@ -1,207 +0,0 @@
-diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py
-index ee205f9..e295bd9 100644
---- a/pyflakes/test/test_api.py
-+++ b/pyflakes/test/test_api.py
-@@ -9,7 +9,6 @@ import shutil
- import subprocess
- import tempfile
- 
--from pyflakes.checker import PY2
- from pyflakes.messages import UnusedImport
- from pyflakes.reporter import Reporter
- from pyflakes.api import (
-@@ -423,7 +422,7 @@ def baz():
- 
-         with self.makeTempFile(source) as sourcePath:
-             if PYPY:
--                message = 'EOF while scanning triple-quoted string literal'
-+                message = 'end of file (EOF) while scanning triple-quoted string literal'
-             else:
-                 message = 'invalid syntax'
- 
-@@ -465,8 +464,8 @@ def foo(
-         syntax error reflects the cause for the syntax error.
-         """
-         with self.makeTempFile("if True:\n\tfoo =") as sourcePath:
--            column = 5 if PYPY else 7
--            last_line = '\t   ^' if PYPY else '\t     ^'
-+            column = 6 if PYPY else 7
-+            last_line = '\t    ^' if PYPY else '\t     ^'
- 
-             self.assertHasErrors(
-                 sourcePath,
-@@ -476,6 +475,7 @@ def foo(
- %s
- """ % (sourcePath, column, last_line)])
- 
-+    @skipIf(PYPY, "Broken on pypy")
-     def test_nonDefaultFollowsDefaultSyntaxError(self):
-         """
-         Source which has a non-default argument following a default argument
-@@ -488,7 +488,12 @@ def foo(bar=baz, bax):
- """
-         with self.makeTempFile(source) as sourcePath:
-             if ERROR_HAS_LAST_LINE:
--                column = 9 if sys.version_info >= (3, 8) else 8
-+                if PYPY and sys.version_info >= (3,):
-+                    column = 7
-+                elif sys.version_info >= (3, 8):
-+                    column = 9
-+                else:
-+                    column = 8
-                 last_line = ' ' * (column - 1) + '^\n'
-                 columnstr = '%d:' % column
-             else:
-@@ -500,6 +505,7 @@ def foo(bar=baz, bax):
- def foo(bar=baz, bax):
- %s""" % (sourcePath, columnstr, last_line)])
- 
-+    @skipIf(PYPY, "Broken on pypy")
-     def test_nonKeywordAfterKeywordSyntaxError(self):
-         """
-         Source which has a non-keyword argument after a keyword argument should
-@@ -511,7 +517,12 @@ foo(bar=baz, bax)
- """
-         with self.makeTempFile(source) as sourcePath:
-             if ERROR_HAS_LAST_LINE:
--                column = 14 if sys.version_info >= (3, 8) else 13
-+                if PYPY and sys.version_info >= (3,):
-+                    column = 12
-+                elif sys.version_info >= (3, 8):
-+                    column = 14
-+                else:
-+                    column = 13
-                 last_line = ' ' * (column - 1) + '^\n'
-                 columnstr = '%d:' % column
-             else:
-@@ -529,6 +540,7 @@ foo(bar=baz, bax)
- foo(bar=baz, bax)
- %s""" % (sourcePath, columnstr, message, last_line)])
- 
-+    @skipIf(PYPY and sys.hexversion < 0x3080000, "broken on pypy3")
-     def test_invalidEscape(self):
-         """
-         The invalid escape syntax raises ValueError in Python 2
-@@ -681,6 +693,12 @@ class IntegrationTests(TestCase):
-     Tests of the pyflakes script that actually spawn the script.
-     """
- 
-+    # https://bitbucket.org/pypy/pypy/issues/3069/pypy36-on-windows-incorrect-line-separator
-+    if PYPY and sys.version_info >= (3,) and WIN:
-+        LINESEP = '\n'
-+    else:
-+        LINESEP = os.linesep
-+
-     def setUp(self):
-         self.tempdir = tempfile.mkdtemp()
-         self.tempfilepath = os.path.join(self.tempdir, 'temp')
-@@ -721,9 +739,6 @@ class IntegrationTests(TestCase):
-         if sys.version_info >= (3,):
-             stdout = stdout.decode('utf-8')
-             stderr = stderr.decode('utf-8')
--        # Workaround https://bitbucket.org/pypy/pypy/issues/2350
--        if PYPY and PY2 and WIN:
--            stderr = stderr.replace('\r\r\n', '\r\n')
-         return (stdout, stderr, rv)
- 
-     def test_goodFile(self):
-@@ -744,7 +759,7 @@ class IntegrationTests(TestCase):
-             fd.write("import contraband\n".encode('ascii'))
-         d = self.runPyflakes([self.tempfilepath])
-         expected = UnusedImport(self.tempfilepath, Node(1), 'contraband')
--        self.assertEqual(d, ("%s%s" % (expected, os.linesep), '', 1))
-+        self.assertEqual(d, ("%s%s" % (expected, self.LINESEP), '', 1))
- 
-     def test_errors_io(self):
-         """
-@@ -754,7 +769,7 @@ class IntegrationTests(TestCase):
-         """
-         d = self.runPyflakes([self.tempfilepath])
-         error_msg = '%s: No such file or directory%s' % (self.tempfilepath,
--                                                         os.linesep)
-+                                                         self.LINESEP)
-         self.assertEqual(d, ('', error_msg, 1))
- 
-     def test_errors_syntax(self):
-@@ -766,8 +781,8 @@ class IntegrationTests(TestCase):
-         with open(self.tempfilepath, 'wb') as fd:
-             fd.write("import".encode('ascii'))
-         d = self.runPyflakes([self.tempfilepath])
--        error_msg = '{0}:1:{2}: invalid syntax{1}import{1}    {3}^{1}'.format(
--            self.tempfilepath, os.linesep, 5 if PYPY else 7, '' if PYPY else '  ')
-+        error_msg = '{0}:1:{2}: invalid syntax{1}import{1}     {3}^{1}'.format(
-+            self.tempfilepath, self.LINESEP, 6 if PYPY else 7, '' if PYPY else ' ')
-         self.assertEqual(d, ('', error_msg, 1))
- 
-     def test_readFromStdin(self):
-@@ -776,13 +791,14 @@ class IntegrationTests(TestCase):
-         """
-         d = self.runPyflakes([], stdin='import contraband')
-         expected = UnusedImport('<stdin>', Node(1), 'contraband')
--        self.assertEqual(d, ("%s%s" % (expected, os.linesep), '', 1))
-+        self.assertEqual(d, ("%s%s" % (expected, self.LINESEP), '', 1))
- 
- 
- class TestMain(IntegrationTests):
-     """
-     Tests of the pyflakes main function.
-     """
-+    LINESEP = os.linesep
- 
-     def runPyflakes(self, paths, stdin=None):
-         try:
-diff --git a/pyflakes/test/test_doctests.py b/pyflakes/test/test_doctests.py
-index 0825ffe..a474bb1 100644
---- a/pyflakes/test/test_doctests.py
-+++ b/pyflakes/test/test_doctests.py
-@@ -328,7 +328,9 @@ class Test(TestCase):
-             m.DoctestSyntaxError).messages
-         exc = exceptions[0]
-         self.assertEqual(exc.lineno, 4)
--        if sys.version_info >= (3, 8):
-+        if PYPY:
-+            self.assertEqual(exc.col, 27)
-+        elif sys.version_info >= (3, 8):
-             self.assertEqual(exc.col, 18)
-         else:
-             self.assertEqual(exc.col, 26)
-@@ -339,12 +341,14 @@ class Test(TestCase):
-         exc = exceptions[1]
-         self.assertEqual(exc.lineno, 5)
-         if PYPY:
--            self.assertEqual(exc.col, 13)
-+            self.assertEqual(exc.col, 14)
-         else:
-             self.assertEqual(exc.col, 16)
-         exc = exceptions[2]
-         self.assertEqual(exc.lineno, 6)
--        if PYPY or sys.version_info >= (3, 8):
-+        if PYPY:
-+            self.assertEqual(exc.col, 14)
-+        elif sys.version_info >= (3, 8):
-             self.assertEqual(exc.col, 13)
-         else:
-             self.assertEqual(exc.col, 18)
-@@ -358,7 +362,9 @@ class Test(TestCase):
-             """
-         ''', m.DoctestSyntaxError).messages[0]
-         self.assertEqual(exc.lineno, 5)
--        if PYPY or sys.version_info >= (3, 8):
-+        if PYPY:
-+            self.assertEqual(exc.col, 14)
-+        elif sys.version_info >= (3, 8):
-             self.assertEqual(exc.col, 13)
-         else:
-             self.assertEqual(exc.col, 16)
-@@ -377,7 +383,10 @@ class Test(TestCase):
-             m.DoctestSyntaxError,
-             m.UndefinedName).messages
-         self.assertEqual(exc1.lineno, 6)
--        self.assertEqual(exc1.col, 19)
-+        if PYPY:
-+            self.assertEqual(exc1.col, 20)
-+        else:
-+            self.assertEqual(exc1.col, 19)
-         self.assertEqual(exc2.lineno, 7)
-         self.assertEqual(exc2.col, 12)
- 

diff --git a/dev-python/pyflakes/pyflakes-2.1.1.ebuild b/dev-python/pyflakes/pyflakes-2.1.1.ebuild
deleted file mode 100644
index aa1cda4d90e..00000000000
--- a/dev-python/pyflakes/pyflakes-2.1.1.ebuild
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 )
-
-inherit distutils-r1
-
-DESCRIPTION="Passive checker for Python programs"
-HOMEPAGE="https://github.com/PyCQA/pyflakes https://pypi.org/project/pyflakes/"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-
-BDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
-RDEPEND="${BDEPEND}"
-
-PATCHES=(
-	"${FILESDIR}/pyflakes-2.1.1-tests.patch"
-	"${FILESDIR}/pyflakes-2.1.1-py38.patch"
-)
-
-distutils_enable_tests unittest


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pyflakes/files/, dev-python/pyflakes/
@ 2023-07-04 19:09 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2023-07-04 19:09 UTC (permalink / raw
  To: gentoo-commits

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-04 19:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-26 20:52 [gentoo-commits] repo/gentoo:master commit in: dev-python/pyflakes/files/, dev-python/pyflakes/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2023-07-04 19:09 Sam James
2020-09-20  9:36 Michał Górny
2019-11-29 19:56 Patrick McLean
2015-11-22 10:32 Ian Delaney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox