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@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2020-01-26 01:59:31 +01:00
parent 6d99d9592d
commit 288672be51
5 changed files with 0 additions and 355 deletions

View File

@@ -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

View File

@@ -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(

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}