git: 77ca0c4157bd - main - devel/py-bashlex: New port: Python parser for bash

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Mon, 31 Mar 2025 09:12:38 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=77ca0c4157bd42c95b5750907da6a0461bc40777

commit 77ca0c4157bd42c95b5750907da6a0461bc40777
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2025-03-31 08:20:10 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2025-03-31 09:12:29 +0000

    devel/py-bashlex: New port: Python parser for bash
---
 devel/Makefile             |  1 +
 devel/py-bashlex/Makefile  | 27 +++++++++++++++++++++++++++
 devel/py-bashlex/distinfo  |  3 +++
 devel/py-bashlex/pkg-descr |  6 ++++++
 4 files changed, 37 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 92ce5306fe71..de8518e7f91b 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -4566,6 +4566,7 @@
     SUBDIR += py-backports.zoneinfo
     SUBDIR += py-banal
     SUBDIR += py-bandit
+    SUBDIR += py-bashlex
     SUBDIR += py-bcdoc
     SUBDIR += py-beartype
     SUBDIR += py-beautifultable
diff --git a/devel/py-bashlex/Makefile b/devel/py-bashlex/Makefile
new file mode 100644
index 000000000000..b7b61c1351c0
--- /dev/null
+++ b/devel/py-bashlex/Makefile
@@ -0,0 +1,27 @@
+PORTNAME=	bashlex
+DISTVERSION=	0.18
+CATEGORIES=	devel science
+#MASTER_SITES=	PYPI # no tests
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Python parser for bash
+WWW=		https://github.com/idank/bashlex
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PY_SETUPTOOLS} \
+		${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
+
+USES=		python
+USE_PYTHON=	pep517 autoplist pytest
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	idank
+
+NO_ARCH=	yes
+
+# tests as of 0.18: 60 passed, 5 warnings in 25.54s
+
+.include <bsd.port.mk>
diff --git a/devel/py-bashlex/distinfo b/devel/py-bashlex/distinfo
new file mode 100644
index 000000000000..e2958135bbad
--- /dev/null
+++ b/devel/py-bashlex/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1743408831
+SHA256 (idank-bashlex-0.18_GH0.tar.gz) = 116dec8de99b5477247bc6ee8d6ed4d0f7a661d7c0d8980b13e15b67b9248d82
+SIZE (idank-bashlex-0.18_GH0.tar.gz) = 66783
diff --git a/devel/py-bashlex/pkg-descr b/devel/py-bashlex/pkg-descr
new file mode 100644
index 000000000000..bd01a1291a54
--- /dev/null
+++ b/devel/py-bashlex/pkg-descr
@@ -0,0 +1,6 @@
+bashlex is a Python port of the parser used internally by GNU bash.
+
+For the most part it's transliterated from C, the major differences are:
+* it does not execute anything
+* it is reentrant
+* it generates a complete AST