From nobody Mon Oct 14 05:27:08 2024 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 4XRm244HTTz5Z9Tw; Mon, 14 Oct 2024 05:27:08 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XRm242BMzz4TSq; Mon, 14 Oct 2024 05:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728883628; 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=RsbtUhTUIu57muI8fM1Mavph9bu2KIN1q0pM0S/M638=; b=Yeuefwh4pzWZLU6x79HRu++G/T0/gYdWddQGa4AVv2qAa6aD+7f5YgtX7d51NcOIU25Vr8 lz91LOdjs4BeBJF3j3kHX91tBEqCuR7g+Fmpwr6MCE5Hp4Ijqrvj+uTXLYfSCJRdCSk+Vm WaEAxhqMGulAwSA7noSrBuhXWDcg6krjXr3FEKP3OjgMsVMN0ttECQLugdWPVMsoqDBGB2 TlHFH7LCSthQfUR7K9q4EB9iDnMO0aVgKWvAEIuedrbpKfqFBcdCNFXjY7K3jkcfPsaZTl pawd2C7y6DZ8CIQ6KK2pPgRIezGcbz2KAd+F+NCQd1+CX2AWN9YCXdEDPQjJig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728883628; 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=RsbtUhTUIu57muI8fM1Mavph9bu2KIN1q0pM0S/M638=; b=GbwKzWmiEYByDcaihjKufIsrWfEbP3sM39rYmcRY8mhvUPKzAkaIuavJXj2JE4oOZFe25M XF1bPsUuuL2nnd006Q9wUZIJ/oyMuR/ewjQ/KAKrH5Z0GPZZHCdKZ5Yqsl3cggSNfPFAcP +qBSP6e0RvanO1lczOH6PwTtlJI6Ym+MG2NAqYwAekx42DUtBQby2+MO1sdWMNmgssJfN9 LMgdSj4PskJqQ49AvysT72vTzpg+wDgf4QpCvyWQjkTXBMKmtgxS32EL5xeBJAPBFh2Ml6 BVABqvqGgD6NKo2SVZSXzTJltVSbBy45REDmrX/D/rgGJvpSmcZCHzkQ1GsKcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728883628; a=rsa-sha256; cv=none; b=qFnhoXX/6e210c7Ua0vak2+bstopVBkdrTbglm5GJiesbPxM9b4IY4+L4s+ze48NsRFMBX wHBnJQza4XMx4XVop4/ZC/XcYCEDGDecXOJEawlfvDS9R4joKMZpJjyGLxjM46cKhTAa9L kYtmjv/hGGpnb4pWfS06odyo7v1hBWI4nzAjLAFcQ4u9WUDV+yc7QlmuJBPSht1S4sqCzV udZHjiBT2RFRoBaVyluyRYsbd0AqZuK3RETf3dQKRXBBNuGRE30kUpzVvD2zIlvQIF4b90 3MdcF3Dqqtf08oAQQlRX7TeX/73/EfNNL67C72I/rtSgFGutc/mmROagkJlo9A== 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 4XRm241gnLzQB6; Mon, 14 Oct 2024 05:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49E5R80D046615; Mon, 14 Oct 2024 05:27:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49E5R8b8046612; Mon, 14 Oct 2024 05:27:08 GMT (envelope-from git) Date: Mon, 14 Oct 2024 05:27:08 GMT Message-Id: <202410140527.49E5R8b8046612@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: d8f05e1eab20 - main - devel/py-crosshair-tool: Add py-crosshair-tool 0.0.74 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: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8f05e1eab204fa83d38addc6efb95d87fac1a1d Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=d8f05e1eab204fa83d38addc6efb95d87fac1a1d commit d8f05e1eab204fa83d38addc6efb95d87fac1a1d Author: Po-Chuan Hsieh AuthorDate: 2024-10-14 04:45:08 +0000 Commit: Po-Chuan Hsieh CommitDate: 2024-10-14 04:45:08 +0000 devel/py-crosshair-tool: Add py-crosshair-tool 0.0.74 CrossHair is an analysis tool for Python that blurs the line between testing and type systems. If you have a function with type annotations and add a contract in a supported syntax, CrossHair will attempt to find counterexamples for you. CrossHair works by repeatedly calling your functions with symbolic inputs. It uses an SMT solver (a kind of theorem prover) to explore viable execution paths and find counterexamples for you. This is not a new idea; a Python approach was first described in this paper. However, to my knowledge, CrossHair is the most complete implementation: it can use symbolic reasoning for the built-in types, user-defined classes, and much of the standard library. --- devel/Makefile | 1 + devel/py-crosshair-tool/Makefile | 30 ++++++++++++++++++++++++++++ devel/py-crosshair-tool/distinfo | 3 +++ devel/py-crosshair-tool/files/patch-setup.py | 11 ++++++++++ devel/py-crosshair-tool/pkg-descr | 12 +++++++++++ 5 files changed, 57 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index 50615c8cb62f..0ef448281f6d 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -4700,6 +4700,7 @@ SUBDIR += py-crcmod SUBDIR += py-crick SUBDIR += py-crontab + SUBDIR += py-crosshair-tool SUBDIR += py-cson SUBDIR += py-csv23 SUBDIR += py-ctags diff --git a/devel/py-crosshair-tool/Makefile b/devel/py-crosshair-tool/Makefile new file mode 100644 index 000000000000..7634bf527d89 --- /dev/null +++ b/devel/py-crosshair-tool/Makefile @@ -0,0 +1,30 @@ +PORTNAME= crosshair-tool +PORTVERSION= 0.0.74 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Analyze Python code for correctness using symbolic execution +WWW= https://github.com/pschanely/CrossHair + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}importlib-metadata>=4.0.0:devel/py-importlib-metadata@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}packaging>=0:devel/py-packaging@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pygls>=1.0.0:devel/py-pygls@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}typeshed-client>=2.0.5:devel/py-typeshed-client@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}typing-extensions>=3.10.0:devel/py-typing-extensions@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}typing-inspect>=0.7.1:devel/py-typing-inspect@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}z3-solver>=4.13.0.0:math/py-z3-solver@${PY_FLAVOR} + +USES= python +USE_PYTHON= autoplist concurrent pep517 + +post-install: + ${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} + + +.include diff --git a/devel/py-crosshair-tool/distinfo b/devel/py-crosshair-tool/distinfo new file mode 100644 index 000000000000..87b9f419aea0 --- /dev/null +++ b/devel/py-crosshair-tool/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1728632222 +SHA256 (crosshair-tool-0.0.74.tar.gz) = 519be9cc21388686aa1181c3df6b10e58d5f3167eda88d77342d2ccb353eb32d +SIZE (crosshair-tool-0.0.74.tar.gz) = 447341 diff --git a/devel/py-crosshair-tool/files/patch-setup.py b/devel/py-crosshair-tool/files/patch-setup.py new file mode 100644 index 000000000000..b4c1c899d061 --- /dev/null +++ b/devel/py-crosshair-tool/files/patch-setup.py @@ -0,0 +1,11 @@ +--- setup.py.orig 2024-10-08 03:13:44 UTC ++++ setup.py +@@ -43,7 +43,7 @@ setup( + "packaging", + "typing-inspect>=0.7.1", + "typing_extensions>=3.10.0", +- "z3-solver==4.13.0.0", ++ "z3-solver>=4.13.0.0", + "importlib_metadata>=4.0.0", + "pygls>=1.0.0", # For the LSP server + "typeshed-client>=2.0.5", diff --git a/devel/py-crosshair-tool/pkg-descr b/devel/py-crosshair-tool/pkg-descr new file mode 100644 index 000000000000..543bc2a35027 --- /dev/null +++ b/devel/py-crosshair-tool/pkg-descr @@ -0,0 +1,12 @@ +CrossHair is an analysis tool for Python that blurs the line between testing and +type systems. + +If you have a function with type annotations and add a contract in a supported +syntax, CrossHair will attempt to find counterexamples for you. + +CrossHair works by repeatedly calling your functions with symbolic inputs. It +uses an SMT solver (a kind of theorem prover) to explore viable execution paths +and find counterexamples for you. This is not a new idea; a Python approach was +first described in this paper. However, to my knowledge, CrossHair is the most +complete implementation: it can use symbolic reasoning for the built-in types, +user-defined classes, and much of the standard library.