From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8CE40138334 for ; Sat, 14 Sep 2019 15:50:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BA897E0903; Sat, 14 Sep 2019 15:50:38 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 978B3E0903 for ; Sat, 14 Sep 2019 15:50:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 75DBC34B18E for ; Sat, 14 Sep 2019 15:50:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A1AD07F0 for ; Sat, 14 Sep 2019 15:50:34 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1568475460.2a108e673d95c095fd5be61183050fd1d245f349.asturm@gentoo> Subject: [gentoo-commits] proj/kde:master commit in: dev-python/parse_cmake/files/, dev-python/parse_cmake/ X-VCS-Repository: proj/kde X-VCS-Files: dev-python/parse_cmake/files/parse_cmake-0.4.1-python3-fix.patch dev-python/parse_cmake/parse_cmake-0.4.1-r1.ebuild X-VCS-Directories: dev-python/parse_cmake/files/ dev-python/parse_cmake/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 2a108e673d95c095fd5be61183050fd1d245f349 X-VCS-Branch: master Date: Sat, 14 Sep 2019 15:50:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 2b2b5295-bd8e-4523-84a2-6d8be90c5634 X-Archives-Hash: fc26aec7e58431665a35cf5053f68344 commit: 2a108e673d95c095fd5be61183050fd1d245f349 Author: Andreas Sturmlechner gentoo org> AuthorDate: Sat Sep 14 15:37:40 2019 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Sat Sep 14 15:37:40 2019 +0000 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=2a108e67 dev-python/parse_cmake: Add upstream python3 fix Package-Manager: Portage-2.3.76, Repoman-2.3.17 Signed-off-by: Andreas Sturmlechner gentoo.org> .../files/parse_cmake-0.4.1-python3-fix.patch | 110 +++++++++++++++++++++ dev-python/parse_cmake/parse_cmake-0.4.1-r1.ebuild | 26 +++++ 2 files changed, 136 insertions(+) diff --git a/dev-python/parse_cmake/files/parse_cmake-0.4.1-python3-fix.patch b/dev-python/parse_cmake/files/parse_cmake-0.4.1-python3-fix.patch new file mode 100644 index 0000000000..c9e6d8859c --- /dev/null +++ b/dev-python/parse_cmake/files/parse_cmake-0.4.1-python3-fix.patch @@ -0,0 +1,110 @@ +From 51daaefdfd68ee805bc5380f68ae88a32ef72a72 Mon Sep 17 00:00:00 2001 +From: Jeff Quast +Date: Thu, 22 Mar 2018 17:46:26 -0700 +Subject: [PATCH] Bugfix python3 entry point for cmake_pprint (#2) + +* Update cmake_pprint.py + +* pprint doesn't make a difference + +* update flake8 test from rosdep repository + +* py2.7 fix + +* ignore some rules +--- + parse_cmake/cmake_pprint.py | 4 +-- + tests/test_code_format.py | 57 ++++++++++++++++++++++++++++++------- + 2 files changed, 48 insertions(+), 13 deletions(-) + +diff --git a/parse_cmake/cmake_pprint.py b/parse_cmake/cmake_pprint.py +index 18e4e9e..d6865ef 100644 +--- a/parse_cmake/cmake_pprint.py ++++ b/parse_cmake/cmake_pprint.py +@@ -18,7 +18,7 @@ + import argparse + import sys + +-import parsing as cmp ++from .parsing import parse + + + def main(): +@@ -40,7 +40,7 @@ def main(): + for (name, file) in files: + with file: + input = file.read() +- tree = cmp.parse(input, path=name) ++ tree = parse(input, path=name) + if args.tree: + # Print out AST + print(repr(tree)) +diff --git a/tests/test_code_format.py b/tests/test_code_format.py +index 287e6e1..9ab09e2 100644 +--- a/tests/test_code_format.py ++++ b/tests/test_code_format.py +@@ -12,18 +12,53 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-import flake8.engine ++from __future__ import print_function ++ + import os ++import sys ++ ++# flake8 doesn't support Python < 2.7 anymore ++if sys.version_info[0] > 2 or sys.version_info[1] >= 7: ++ from flake8.api.legacy import get_style_guide ++else: ++ get_style_guide = None + + + def test_flake8(): +- """Test source code for pyFlakes and PEP8 conformance""" +- flake8style = flake8.engine.StyleGuide(max_line_length=100) +- report = flake8style.options.report +- report.start() +- this_dir = os.path.dirname(os.path.abspath(__file__)) +- flake8style.input_dir(os.path.join(this_dir, '..', 'parse_cmake')) +- report.stop() +- assert report.total_errors == 0, \ +- ("Found '{0}' code style errors (and warnings)." +- .format(report.total_errors)) ++ if get_style_guide is None: ++ # skip test on Python 2.6 and older ++ return ++ ++ style_guide = get_style_guide( ++ exclude=[], ++ ignore=[ ++ 'E731', # ignore assign lambda warning ++ 'E226', # ignore whitespace around arithmetic operators ++ 'E305', # ignore whitespace before/after functions rule ++ 'D', # ignore documentation related warnings ++ 'I', # ignore import order related warnings ++ 'N802', # ignore presence of upper case in function names ++ ], ++ max_line_length=100, ++ max_complexity=10, ++ show_source=True, ++ ) ++ ++ stdout = sys.stdout ++ sys.stdout = sys.stderr ++ # implicitly calls report_errors() ++ report = style_guide.check_files([ ++ os.path.dirname(os.path.dirname(__file__)), ++ ]) ++ sys.stdout = stdout ++ ++ if report.total_errors: ++ # output summary with per-category counts ++ print() ++ report._application.formatter.show_statistics(report._stats) ++ print( ++ 'flake8 reported {report.total_errors} errors' ++ .format_map(locals()), file=sys.stderr) ++ ++ assert not report.total_errors, \ ++ 'flake8 reported {report.total_errors} errors'.format(**locals()) diff --git a/dev-python/parse_cmake/parse_cmake-0.4.1-r1.ebuild b/dev-python/parse_cmake/parse_cmake-0.4.1-r1.ebuild new file mode 100644 index 0000000000..cc2187f798 --- /dev/null +++ b/dev-python/parse_cmake/parse_cmake-0.4.1-r1.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{6,7} ) +inherit distutils-r1 + +DESCRIPTION="Parser for CMakeLists.txt files" +HOMEPAGE="https://pypi.python.org/pypi/parse_cmake/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" +IUSE="" + +BDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]" + +PATCHES=( "${FILESDIR}/${P}-python3-fix.patch" ) + +src_prepare() { + distutils-r1_src_prepare + sed -i setup.py -e "s/'pyPEG2'//" || die + mv tests tests-hidden || die +}