public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/kde:master commit in: dev-python/parse_cmake/files/, dev-python/parse_cmake/
@ 2019-09-14 15:50 Andreas Sturmlechner
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Sturmlechner @ 2019-09-14 15:50 UTC (permalink / raw
  To: gentoo-commits

commit:     2a108e673d95c095fd5be61183050fd1d245f349
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 14 15:37:40 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> 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 <asturm <AT> 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 <contact@jeffquast.com>
+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
+}


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

* [gentoo-commits] proj/kde:master commit in: dev-python/parse_cmake/files/, dev-python/parse_cmake/
@ 2023-12-18 11:07 Andreas Sturmlechner
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Sturmlechner @ 2023-12-18 11:07 UTC (permalink / raw
  To: gentoo-commits

commit:     9a40f836f3dc4731eddb293359947f093c45279d
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Mon Dec 18 09:34:46 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Dec 18 11:06:51 2023 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=9a40f836

dev-python/parse_cmake: PEP517, pypi, python3.12

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Closes: https://github.com/gentoo/kde/pull/958
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../parse_cmake-0.4.1-dont-install-tests.patch     | 19 ++++++++++++++
 dev-python/parse_cmake/metadata.xml                |  1 +
 dev-python/parse_cmake/parse_cmake-0.4.1-r1.ebuild | 26 -------------------
 dev-python/parse_cmake/parse_cmake-0.4.1-r2.ebuild | 30 ++++++++++++++++++++++
 4 files changed, 50 insertions(+), 26 deletions(-)

diff --git a/dev-python/parse_cmake/files/parse_cmake-0.4.1-dont-install-tests.patch b/dev-python/parse_cmake/files/parse_cmake-0.4.1-dont-install-tests.patch
new file mode 100644
index 0000000000..91fbea3c56
--- /dev/null
+++ b/dev-python/parse_cmake/files/parse_cmake-0.4.1-dont-install-tests.patch
@@ -0,0 +1,19 @@
+https://github.com/wjwwood/parse_cmake/commit/fcc77a5e104040ef074dec5b538e635b63e1dad1
+https://github.com/wjwwood/parse_cmake/pull/6
+
+From fcc77a5e104040ef074dec5b538e635b63e1dad1 Mon Sep 17 00:00:00 2001
+From: Timon Engelke <timonegk@users.noreply.github.com>
+Date: Tue, 1 Mar 2022 23:53:29 +0100
+Subject: [PATCH] Do not install tests folder (#6)
+
+--- a/setup.py
++++ b/setup.py
+@@ -7,7 +7,7 @@
+     author_email='itrotts@willowgarage.com, william@osrfoundation.org',
+     url='http://github.com/wjwwood/parse_cmake',
+     description='Parser for CMakeLists.txt files',
+-    packages=find_packages(),
++    packages=find_packages(exclude=['tests']),
+     install_requires=['pyPEG2'],
+     tests_require=['nose', 'flake8'],
+     test_suite='nose.collector',

diff --git a/dev-python/parse_cmake/metadata.xml b/dev-python/parse_cmake/metadata.xml
index 83f930ec68..e96576e59e 100644
--- a/dev-python/parse_cmake/metadata.xml
+++ b/dev-python/parse_cmake/metadata.xml
@@ -5,6 +5,7 @@
 		<email>kde@gentoo.org</email>
 	</maintainer>
 	<upstream>
+		<remote-id type="github">wjwwood/parse_cmake</remote-id>
 		<remote-id type="pypi">parse_cmake</remote-id>
 	</upstream>
 </pkgmetadata>

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
deleted file mode 100644
index 8029a2ac27..0000000000
--- a/dev-python/parse_cmake/parse_cmake-0.4.1-r1.ebuild
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{10..11} )
-inherit distutils-r1
-
-DESCRIPTION="Parser for CMakeLists.txt files"
-HOMEPAGE="https://pypi.org/project/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
-}

diff --git a/dev-python/parse_cmake/parse_cmake-0.4.1-r2.ebuild b/dev-python/parse_cmake/parse_cmake-0.4.1-r2.ebuild
new file mode 100644
index 0000000000..aa7f34d005
--- /dev/null
+++ b/dev-python/parse_cmake/parse_cmake-0.4.1-r2.ebuild
@@ -0,0 +1,30 @@
+# 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_{10..12} )
+inherit distutils-r1 pypi
+
+DESCRIPTION="Parser for CMakeLists.txt files"
+HOMEPAGE="
+	https://github.com/wjwwood/parse_cmake
+	https://pypi.org/project/parse_cmake/
+"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+PATCHES=(
+	"${FILESDIR}/${P}-python3-fix.patch"
+	"${FILESDIR}/${P}-dont-install-tests.patch"
+)
+
+distutils_enable_tests unittest
+
+src_prepare() {
+	distutils-r1_src_prepare
+	sed -i setup.py -e "s/'pyPEG2'//" || die
+}


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

end of thread, other threads:[~2023-12-18 11:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-18 11:07 [gentoo-commits] proj/kde:master commit in: dev-python/parse_cmake/files/, dev-python/parse_cmake/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2019-09-14 15:50 Andreas Sturmlechner

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