From 7bc9c63c9da678a7e6fceb095d56c634afd22c56 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 15 Dec 2019 18:09:03 +0000 Subject: gentoo resync : 15.12.2019 --- dev-python/pyflakes/Manifest | 4 + .../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, 278 insertions(+) create mode 100644 dev-python/pyflakes/files/pyflakes-2.1.1-py38.patch create mode 100644 dev-python/pyflakes/files/pyflakes-2.1.1-tests.patch create mode 100644 dev-python/pyflakes/pyflakes-2.1.1.ebuild (limited to 'dev-python/pyflakes') diff --git a/dev-python/pyflakes/Manifest b/dev-python/pyflakes/Manifest index f416e7647c11..5236a559bcd3 100644 --- a/dev-python/pyflakes/Manifest +++ b/dev-python/pyflakes/Manifest @@ -1,12 +1,16 @@ AUX 1.0.0-fix-pypy-tests.patch 9242 BLAKE2B 3a3c015dab48d3c671189ad656b6f208812b4ffa8805d9a27d581167c1b36ff0cc6219e0ed6688c21d8ec25d247b3c6fa7cbe92d06889b60eca1bd7e40c148af SHA512 4772c32ea90e163030953f3ade2bd2434a10cf0e3c9234f4acaf596a44a812581ba92ef1498998566a7bf78e1bb8c7051260ebf8aca4ca2cd3a04e21e307bbfc +AUX pyflakes-2.1.1-py38.patch 1641 BLAKE2B c35e47c00b035d2488d49deab5207be6e539ba1c3683564ad1fea75b91e4d0e73a599a3ffcc9bcc7dca12fe7675e6e47c7e94fa2848d352c7be3639b07322efa SHA512 2605bf1c8f28eed285208219b3dd9816ae207ced87458c0f294ea6b3cb2e2a1f960fad257d3813b5e6dbfa07712644d5b38b28924340f34d3a8d701b09862222 +AUX pyflakes-2.1.1-tests.patch 7973 BLAKE2B d0b6663e9bb17e301e78104c08440a9bc7493e6cc2de56e73677c865d34b6bfcda39d2565414e6cd984a181c27cf7540e5de1ca9327103c03589f154d5bb4a3b SHA512 d4360525526ad0de395900aa4f986c03091ab06d77a3fe6ab92d4650e10a2a24accc5d77c1acb4800e095db5ed663d3ab13715c5433368c334891cee1b44dcc6 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 EBUILD pyflakes-0.8.1.ebuild 725 BLAKE2B 66db1c79832def85898214b113fa89f4954cf453bd8de2133307768d744ce4e298310ae166aa3e9c97c750db6ed5896636bcaceeeeb522057d7df6e11e2d6735 SHA512 17161d9c4497fea7cb139a041350d41ea72df414372c0ec703baf0e2b23b2ef47a6b7938246aca8fb0e06445d12826dfd4dd5a29722a67e052787225846f3a51 EBUILD pyflakes-1.0.0.ebuild 756 BLAKE2B b1c3e4eecb2943fc256f201b4d51341112c0f9bd37488bae76c3d6fb0db0e75c5e7ccbc18ccb8739fb3679ff1d4734f1a4b77cc6ea1c103346112b420c41fad3 SHA512 d9ae2e18cbdbfddc22ed8ba1f3404c0c6483d4ffa3b136cb04b43c2216082b6df36f3d0e1a01386ebf4bf6490368f1f5fe0db74c91f27ede8cc36fe707e961f6 EBUILD pyflakes-1.2.3.ebuild 696 BLAKE2B d454508e43c8aedf492e047297026645f994bff2f55a63a0827ec7678e5cfdf46dfac00f3058900f62dad0bdf1eabd68ab05b9b4d3afbb95274dc66df4f482c4 SHA512 964a3c17388641f44f589b23d83d492a01a4a47502382c1b8a18ed320219f3cb6ffd59f78318238be8ee8bfcb145025aa0100cf94face5cd2b06702aa3ba6223 EBUILD pyflakes-1.6.0.ebuild 690 BLAKE2B 815b16d83de58a29829c94e288720fdbee9be35909e25ffb007a0236b48ca26f6c75f894abec0ed8ae7841e762c837861945719ef3d1f3b3a4d5ee68f910c1f3 SHA512 ba4c917d05113b1aa4ac7b1c7a59fde2e21589aa5c3662fa3fbb466690fae1eead31e98484ef13ef80f68fe6d992ff68e2277bb86370f3c6147ba3735a495f85 EBUILD pyflakes-2.0.0.ebuild 701 BLAKE2B 0968f165e21a387dbab3e847f143769760856d4a53aa35a035439cf21e758ea43363faffe84218d55f95cc07a8133f1c0aa14a62e6e24a6975370290f1be978b SHA512 796ef54a7807e67fa2faf0d182a66e715e173c73249b7f8a9d0ebd801e443297f62189ca852d2685745e9c8826662af2c387ecc8172f670b1bdec2df8926e3bc +EBUILD pyflakes-2.1.1.ebuild 795 BLAKE2B 4c6565f35c80a2a03f2afb2c70c2cc07b6a05a171dd7c3b48a5bc140f674b2f52d0a7c57324865c84c36a6529343a6a167ca56bae9c129fdfa294ea09d0035fe SHA512 a2f4346ec403ff519feba2ca84f18b53b95b8879fb01c374047cd12620daaf8c212e74719e3e8a46116faa2e9ac86cd799668541c78ce194cb26bb2083fa61e9 MISC metadata.xml 738 BLAKE2B 5c1e0cb1452f9aebbefe7edd7a054cad85373344f834fb88ea37414ef69b12a36f774e6da05e73b898d6300a56189ec80891eca7a3c225c95b0fc8755daf18b6 SHA512 6ac45c3c5d1fd3eeae5c8ad9950a2c97ef31d0bb72e6034a1f8b75d2a28e997660df20719431ee138a76544942bc20d609fb6e4a26a77f0ef30f912c6d2c0257 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 000000000000..f9f00b895f5a --- /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 000000000000..5e1a445e161e --- /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('', 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 000000000000..b9d46be20e5d --- /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 -- cgit v1.2.3