From nobody Fri Jan 28 00:11:20 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DCD061974517; Fri, 28 Jan 2022 00:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JlHtd52Fbz521l; Fri, 28 Jan 2022 00:11:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643328683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2w2dLrNjAEcSH6jDQ2+CivdnNNjSH5abqm16dwhep/E=; b=icERkSEs8CMsBlMStZYNQz/PIAnQhX+8k2dO7IRwhGipxGKGieCPGOljp1lU1eRt6Zipem WMMG5Z5ENdZDN9C6aP3TfHTgeS5pI6SbbNOykWkcvOiheDMK99sPjBxF0adePwBbK4iEFG SiZ/pFPvhkgVpLJL3OUGdkVFRiyx/j7bnFQS2oqWiQbxTD3myEX+fmqyRxzTJlF5z1VTOm p1IOIiLcbqs98elmk3oOaYSbMyCWvuupMLlDQrNmh691McxWyOfdlhrBxbHZ2GwhtdXqmE r0RP/enLjVffKHC5EM88JVvuTKuvXaALWzBuW1rcMUEq1Q0ewBYb6qA5qfkP9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82097203CA; Fri, 28 Jan 2022 00:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20S0BKXi027711; Fri, 28 Jan 2022 00:11:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20S0BKwR027710; Fri, 28 Jan 2022 00:11:20 GMT (envelope-from git) Date: Fri, 28 Jan 2022 00:11:20 GMT Message-Id: <202201280011.20S0BKwR027710@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Matthias Andree Subject: git: 372cb7445a6f - 2022Q1 - graphics/py-pytesseract: fix DICT conversion List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mandree X-Git-Repository: ports X-Git-Refname: refs/heads/2022Q1 X-Git-Reftype: branch X-Git-Commit: 372cb7445a6f9598fa715b519a5f7c4980f6b522 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643328683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2w2dLrNjAEcSH6jDQ2+CivdnNNjSH5abqm16dwhep/E=; b=fhObhYSjIvag6XWtVIBHgZkchb580gG0A+V+I0BJu+VxX74OmlGUXMLoPlVsT+oOewkghb E8WNrumo3Xwh8QMfsGHaMNMLHbNC2oDFiEHLdAsAtpC7ngsrE/SSDURW6mDn/8TVd/+LqX ukDrrpeMCnF/X07ZztwwV+D/iSdZWE4HiuyNLXQTr/v4BcYzZkjb+j1+aDan+mOjgHwjtM H0+BsU/l6yZQachiSMULASpcnt3KQ66vGwobVBCPnkA+ysDA26FVOYfMl7egE0IuCe8J6f +KJ9R/w6E3EdEorL+/IsVr3R4RFgPMjPxUaxvb9AXrNFGqlyxirH7Pswq3fsGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643328683; a=rsa-sha256; cv=none; b=C26flb1Kk9TiqnJbt3EEviUCCJE0czBqRC1I9TylUnzowcoxkNdp6Gp3+h71ruLcBs+5gZ XnNvDbx8ES+NzqHobG/JLHZs7zkdRbt/LdL7NxZb9hijgLEcFu7GdACtiZYMLTAPBDobPS 31ChHD5sN8YejPA9NQVfgB2iSB8Dpi6AgyA85d/iecUyvjSOQJYZD7FZNVJLi4Bl6HffjR rVcuG4YdAyjeFG5DdwYrtLOb3Er24d7MHb+SXD1kngFsV6Awe7LK/cH7+sfeix8/egwGpD o4pst9cVXMSLUm9w/hDAhCMcN89zfceN1Ig3wL4jOwX5sXUGOmhZJi5qiOYvVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch 2022Q1 has been updated by mandree: URL: https://cgit.FreeBSD.org/ports/commit/?id=372cb7445a6f9598fa715b519a5f7c4980f6b522 commit 372cb7445a6f9598fa715b519a5f7c4980f6b522 Author: Matthias Andree AuthorDate: 2022-01-27 23:48:12 +0000 Commit: Matthias Andree CommitDate: 2022-01-28 00:09:32 +0000 graphics/py-pytesseract: fix DICT conversion ...via tsv file; this was the one failing self-test, now passes. https://github.com/madmaze/pytesseract/issues/406 (cherry picked from commit fb684eef543b0c451ac9a59e50ee40ee540241f3) --- graphics/py-pytesseract/Makefile | 5 +++- graphics/py-pytesseract/files/patch-g06e7f807 | 36 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/graphics/py-pytesseract/Makefile b/graphics/py-pytesseract/Makefile index 969145cc2539..541f47401242 100644 --- a/graphics/py-pytesseract/Makefile +++ b/graphics/py-pytesseract/Makefile @@ -1,5 +1,6 @@ PORTNAME= pytesseract PORTVERSION= 0.3.9 +PORTREVISION= 1 DISTVERSIONPREFIX= v CATEGORIES= graphics python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -7,6 +8,8 @@ PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= mandree@FreeBSD.org COMMENT= wrapper for Google's Tesseract OCR engine +PATCH_STRIP= -p1 + LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE @@ -25,7 +28,7 @@ USE_PYTHON= autoplist concurrent distutils NO_ARCH= yes do-test: - cd ${WRKSRC} && ${SETENV} ${TEST_ENV} tox -e ${PY_FLAVOR} --sitepackages + cd ${WRKSRC} && ${SETENV} ${TEST_ENV} tox-${PYTHON_VER} -e ${PY_FLAVOR} --sitepackages .include diff --git a/graphics/py-pytesseract/files/patch-g06e7f807 b/graphics/py-pytesseract/files/patch-g06e7f807 new file mode 100644 index 000000000000..71ba847a05ff --- /dev/null +++ b/graphics/py-pytesseract/files/patch-g06e7f807 @@ -0,0 +1,36 @@ +This is obtained from upstream and ADDITIONALLY +changes the try: val = int(row[i]) in upstream int3l@github's version +to int(float(row[i])). -- Matthias Andree, mandree@FreeBSD.org + +From 06e7f8077467950d2f4e0f619fb193730c2d2079 Mon Sep 17 00:00:00 2001 +From: int3l +Date: Thu, 27 Jan 2022 16:09:21 +0200 +Subject: [PATCH] Fix confidence conversion from str to int + +Account for negative values. Fixes #406 +--- + pytesseract/pytesseract.py | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/pytesseract/pytesseract.py b/pytesseract/pytesseract.py +index 984b106..e927e80 100644 +--- a/pytesseract/pytesseract.py ++++ b/pytesseract/pytesseract.py +@@ -313,9 +313,14 @@ def file_to_dict(tsv, cell_delimiter, str_col_idx): + if len(row) <= i: + continue + +- val = row[i] +- if row[i].isdigit() and i != str_col_idx: +- val = int(row[i]) ++ if i != str_col_idx: ++ try: ++ val = int(float(row[i])) ++ except ValueError: ++ val = row[i] ++ else: ++ val = row[i] ++ + result[head].append(val) + + return result