[gentoo-commits] repo/proj/guru:dev commit in: app-text/lizard/files/, app-text/lizard/

2024-04-15 Thread David Roman
commit: 62eac930d9029a343ad9f39bb147a9fb5cf6ef8f
Author: David Roman  gmail  com>
AuthorDate: Mon Apr 15 11:58:58 2024 +
Commit: David Roman  gmail  com>
CommitDate: Mon Apr 15 11:59:23 2024 +
URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=62eac930

app-text/lizard: fix py3.12 tests

Closes: https://bugs.gentoo.org/927725
Signed-off-by: David Roman  gmail.com>

 app-text/lizard/files/lizard-1.17.10-py3.12.patch | 45 +++
 app-text/lizard/lizard-1.17.10-r1.ebuild  |  4 +-
 2 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/app-text/lizard/files/lizard-1.17.10-py3.12.patch 
b/app-text/lizard/files/lizard-1.17.10-py3.12.patch
new file mode 100644
index 00..f150f74f8e
--- /dev/null
+++ b/app-text/lizard/files/lizard-1.17.10-py3.12.patch
@@ -0,0 +1,45 @@
+From f44f7969c592ecbc1752827cb27dd44e79e1e75e Mon Sep 17 00:00:00 2001
+From: David Roman 
+Date: Thu, 27 Jul 2023 15:07:51 +0200
+Subject: [PATCH] replace deprecated assertRegexpMatches -> assertRegex
+
+Close: #374
+---
+ test/testOutputCSV.py  | 4 ++--
+ test/testOutputHTML.py | 3 +--
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/test/testOutputCSV.py b/test/testOutputCSV.py
+index 78cb221..4d10217 100644
+--- a/test/testOutputCSV.py
 b/test/testOutputCSV.py
+@@ -22,7 +22,7 @@ def test_csv_header(self):
+ options_mock.verbose = True
+ options_mock.extensions = []
+ csv_output(AllResult([self.fileSummary]), options_mock)
+-self.assertRegexpMatches(sys.stdout.stream,
++self.assertRegex(sys.stdout.stream,
+  
r"NLOC,CCN,token,PARAM,length,location,file,function,long_name,start,end")
+ 
+ def test_csv_header_with_extension(self):
+@@ -35,7 +35,7 @@ def test_csv_header_with_extension(self):
+ results = AllResult([self.fileSummary])
+ results.result[0].function_list[0].exit_count = 1
+ csv_output(results, options_mock)
+-self.assertRegexpMatches(sys.stdout.stream,
++self.assertRegex(sys.stdout.stream,
+  
r"NLOC,CCN,token,PARAM,length,location,file,function,long_name,start,end,exits")
+ 
+ def test_csv_no_header(self):
+diff --git a/test/testOutputHTML.py b/test/testOutputHTML.py
+index f91156b..81965fc 100644
+--- a/test/testOutputHTML.py
 b/test/testOutputHTML.py
+@@ -17,6 +17,5 @@ def setUp(self):
+ 
+ def test_should_have_html_body(self):
+ html_output([self.fileSummary], self.option, None, AllResult)
+-self.assertRegexpMatches(sys.stdout.stream,
+- r"\")
++self.assertRegex(sys.stdout.stream, r"\")
+ 

diff --git a/app-text/lizard/lizard-1.17.10-r1.ebuild 
b/app-text/lizard/lizard-1.17.10-r1.ebuild
index 20e6432fa3..c562054a2d 100644
--- a/app-text/lizard/lizard-1.17.10-r1.ebuild
+++ b/app-text/lizard/lizard-1.17.10-r1.ebuild
@@ -12,9 +12,9 @@ DESCRIPTION="A simple code complexity analyser, supports most 
of the popular lan
 HOMEPAGE="http://www.lizard.ws/";
 SRC_URI="https://github.com/terryyin/lizard/archive/${PV}.tar.gz -> 
${P}.tar.gz"
 
-KEYWORDS="~amd64"
 LICENSE="MIT"
 SLOT="0"
+KEYWORDS="~amd64"
 
 DEPEND="
test? (
@@ -23,6 +23,6 @@ DEPEND="
)
 "
 
-PATCHES=( "${FILESDIR}/${P}-py3.11.patch" )
+PATCHES=( "${FILESDIR}/${P}-py3.11.patch" "${FILESDIR}/${P}-py3.12.patch" )
 
 distutils_enable_tests pytest



[gentoo-commits] repo/proj/guru:dev commit in: app-text/lizard/

2024-04-02 Thread Julien Roy
commit: 66d94e83aada74e4c3907b651f19c7663a827a7d
Author: Julien Roy  jroy  ca>
AuthorDate: Tue Apr  2 22:57:34 2024 +
Commit: Julien Roy  jroy  ca>
CommitDate: Tue Apr  2 22:57:34 2024 +
URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=66d94e83

app-text/lizard: drop 1.17.10

Signed-off-by: Julien Roy  jroy.ca>

 app-text/lizard/lizard-1.17.10.ebuild | 26 --
 1 file changed, 26 deletions(-)

diff --git a/app-text/lizard/lizard-1.17.10.ebuild 
b/app-text/lizard/lizard-1.17.10.ebuild
deleted file mode 100644
index 5ac75fd3d5..00
--- a/app-text/lizard/lizard-1.17.10.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_11 )
-
-inherit distutils-r1
-
-DESCRIPTION="A simple code complexity analyser, supports most of the popular 
languages."
-HOMEPAGE="http://www.lizard.ws/";
-SRC_URI="https://github.com/terryyin/lizard/archive/${PV}.tar.gz -> 
${P}.tar.gz"
-
-KEYWORDS="~amd64"
-LICENSE="MIT"
-SLOT="0"
-
-DEPEND="
-   test? (
-   dev-python/jinja[${PYTHON_USEDEP}]
-   dev-python/mock[${PYTHON_USEDEP}]
-   dev-python/nose[${PYTHON_USEDEP}]
-   )
-"
-
-distutils_enable_tests pytest



[gentoo-commits] repo/proj/guru:dev commit in: app-text/lizard/, app-text/lizard/files/

2023-07-27 Thread David Roman
commit: fb3679d5071a1b10333c964b121eab0223cfb803
Author: David Roman  gmail  com>
AuthorDate: Thu Jul 27 13:50:59 2023 +
Commit: David Roman  gmail  com>
CommitDate: Thu Jul 27 13:50:59 2023 +
URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=fb3679d5

app-text/lizard: add support for python3.11

Closes: https://bugs.gentoo.org/907137
Signed-off-by: David Roman  gmail.com>

 app-text/lizard/files/lizard-1.17.10-py3.11.patch | 60 +++
 app-text/lizard/lizard-1.17.10-r1.ebuild  | 28 +++
 2 files changed, 88 insertions(+)

diff --git a/app-text/lizard/files/lizard-1.17.10-py3.11.patch 
b/app-text/lizard/files/lizard-1.17.10-py3.11.patch
new file mode 100644
index 00..d17b9511db
--- /dev/null
+++ b/app-text/lizard/files/lizard-1.17.10-py3.11.patch
@@ -0,0 +1,60 @@
+commit fc8a14e84acd8a4baa2d98bdec4e7ac18ed137a5
+Author: Mazunki Hoksaas 
+Date:   Thu Jul 27 15:04:16 2023 +0200
+
+add support for python3.11 re module
+
+diff --git a/lizard_languages/code_reader.py b/lizard_languages/code_reader.py
+index 1eb95d5..9e12658 100644
+--- a/lizard_languages/code_reader.py
 b/lizard_languages/code_reader.py
+@@ -4,6 +4,8 @@ Base class for all language parsers
+ 
+ import re
+ from copy import copy
++from functools import reduce
++from operator import or_
+ 
+ 
+ class CodeStateMachine(object):
+@@ -112,7 +114,7 @@ class CodeReader:
+ if not token_class:
+ token_class = create_token
+ 
+-def _generate_tokens(source, add):
++def _generate_tokens(source, add, flags=re.NOFLAG):
+ # DO NOT put any sub groups in the regex. Good for performance
+ _until_end = r"(?:\\\n|[^\n])*"
+ combined_symbols = ["<<=", ">>=", "||", "&&", "===", "!==",
+@@ -136,7 +138,7 @@ class CodeReader:
+ r"|\\\n" +
+ r"|\n" +
+ r"|[^\S\n]+" +
+-r"|.)", re.M | re.S)
++r"|.)", re.M | re.S | flags)
+ macro = ""
+ for match in token_pattern.finditer(source):
+ token = token_class(match)
+@@ -154,7 +156,21 @@ class CodeReader:
+ if macro:
+ yield macro
+ 
+-return _generate_tokens(source_code, addition)
++flag_dict = {
++'a': re.A,  # ASCII-only matching
++'i': re.I,  # Ignore case
++'L': re.L,  # Locale dependent
++'m': re.M,  # Multi-line
++'s': re.S,  # Dot matches all
++'u': re.U,  # Unicode matching
++'x': re.X   # Verbose
++}
++
++pattern = re.compile(r'\(\?[aiLmsux]+\)')
++re_flags = ''.join(opt[2:-1] for opt in pattern.findall(addition))
++flags = reduce(or_, (flag_dict[flag] for flag in re_flags), re.NOFLAG)
++
++return _generate_tokens(source_code, pattern.sub('', addition), 
flags=flags)
+ 
+ def __call__(self, tokens, reader):
+ self.context = reader.context

diff --git a/app-text/lizard/lizard-1.17.10-r1.ebuild 
b/app-text/lizard/lizard-1.17.10-r1.ebuild
new file mode 100644
index 00..20e6432fa3
--- /dev/null
+++ b/app-text/lizard/lizard-1.17.10-r1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{11,12} )
+DISTUTILS_USE_PEP517=setuptools
+
+inherit distutils-r1
+
+DESCRIPTION="A simple code complexity analyser, supports most of the popular 
languages."
+HOMEPAGE="http://www.lizard.ws/";
+SRC_URI="https://github.com/terryyin/lizard/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+
+KEYWORDS="~amd64"
+LICENSE="MIT"
+SLOT="0"
+
+DEPEND="
+   test? (
+   dev-python/jinja[${PYTHON_USEDEP}]
+   dev-python/mock[${PYTHON_USEDEP}]
+   )
+"
+
+PATCHES=( "${FILESDIR}/${P}-py3.11.patch" )
+
+distutils_enable_tests pytest



[gentoo-commits] repo/proj/guru:dev commit in: app-text/lizard/

2023-05-23 Thread David Roman
commit: 0e0423a553ece987d3d66fa4cbbbf6140db4d4b1
Author: David Roman  gmail  com>
AuthorDate: Tue May 23 20:12:04 2023 +
Commit: David Roman  gmail  com>
CommitDate: Tue May 23 20:12:24 2023 +
URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=0e0423a5

app-text/lizard: enable py3.11 and disable py3.10

Closes: https://bugs.gentoo.org/897378
Signed-off-by: David Roman  gmail.com>

 app-text/lizard/lizard-1.17.10.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app-text/lizard/lizard-1.17.10.ebuild 
b/app-text/lizard/lizard-1.17.10.ebuild
index 157fe5111..5ac75fd3d 100644
--- a/app-text/lizard/lizard-1.17.10.ebuild
+++ b/app-text/lizard/lizard-1.17.10.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_10 )
+PYTHON_COMPAT=( python3_11 )
 
 inherit distutils-r1
 



[gentoo-commits] repo/proj/guru:dev commit in: app-text/lizard/

2022-06-03 Thread David Roman
commit: 4aa447498d5a5bf0d29cdcd83ac052cce744c8a1
Author: David Roman  gmail  com>
AuthorDate: Fri Jun  3 08:25:03 2022 +
Commit: David Roman  gmail  com>
CommitDate: Fri Jun  3 08:25:03 2022 +
URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4aa44749

app-text/lizard: add 1.17.10, drop 1.17.7

Closes: https://bugs.gentoo.org/848105
Signed-off-by: David Roman  gmail.com>

 app-text/lizard/Manifest| 2 +-
 app-text/lizard/{lizard-1.17.7.ebuild => lizard-1.17.10.ebuild} | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/app-text/lizard/Manifest b/app-text/lizard/Manifest
index 23a178c0e..60c953cd4 100644
--- a/app-text/lizard/Manifest
+++ b/app-text/lizard/Manifest
@@ -1 +1 @@
-DIST lizard-1.17.7.tar.gz 1223565 BLAKE2B 
d49b7c05d459ff2c24a6c252840fd411a6fa720327d1ef0a7d0bb7fda6684210cca20f5d6e675c2e80f7edf9d4703c31b0e0aca267222037a6167a0265385169
 SHA512 
c47079e3077ebf87ee42dc361ffa4b68100408215f76d110ba20eaa44de51fbe54d695cefdd0a9e20752aafade865b7ed24551db4d34466b6e2d25df80806e79
+DIST lizard-1.17.10.tar.gz 1230723 BLAKE2B 
ed6a899088a19c05de7f1a01a0dea23add0ab917a7bf8213bac8417831ad061f0802a742f955ca2dc025e7ad4caf3447ba4f33cd5b020f669dff8aff062f5aa6
 SHA512 
7b2ebc8ccacec9a72b79f01af76a5574caca28b8d03f28353f29a61cb683cf2fe73e09b7a238f4aa3c487d49aa73b69f040d4040e2d36406c2408d4c1a7d80c3

diff --git a/app-text/lizard/lizard-1.17.7.ebuild 
b/app-text/lizard/lizard-1.17.10.ebuild
similarity index 86%
rename from app-text/lizard/lizard-1.17.7.ebuild
rename to app-text/lizard/lizard-1.17.10.ebuild
index a915a188a..af001e18d 100644
--- a/app-text/lizard/lizard-1.17.7.ebuild
+++ b/app-text/lizard/lizard-1.17.10.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-PYTHON_COMPAT=( python3_{8,9} )
+PYTHON_COMPAT=( python3_{8..10} )
 
 inherit distutils-r1