git: 58a7baab60ed - main - devel/py-dbt-extractor: new port

From: Kurt Jaeger <pi_at_FreeBSD.org>
Date: Sat, 21 Oct 2023 17:35:53 UTC
The branch main has been updated by pi:

URL: https://cgit.FreeBSD.org/ports/commit/?id=58a7baab60ed793e6c95a819f95b5a989ebf574d

commit 58a7baab60ed793e6c95a819f95b5a989ebf574d
Author:     Pat Maddox <pat@patmaddox.com>
AuthorDate: 2023-10-21 17:34:53 +0000
Commit:     Kurt Jaeger <pi@FreeBSD.org>
CommitDate: 2023-10-21 17:35:47 +0000

    devel/py-dbt-extractor: new port
    
    A tool that processes the most common jinja value templates in dbt model
    files. The tool depends on tree-sitter and the tree-sitter-jinja2 library.
    
    The current strategy is for this processor to be 100% certain when it can
    accurately extract values from a given model file. Anything less than 100%
    certainty returns an exception so that the model can be rendered with python
    Jinja instead.
    
    PR:             274578
    Author:         Pat Maddox <pat@patmaddox.com>
---
 devel/Makefile                         |   1 +
 devel/py-dbt-extractor/Makefile        |  35 ++++++++++
 devel/py-dbt-extractor/Makefile.crates |  57 ++++++++++++++++
 devel/py-dbt-extractor/distinfo        | 117 +++++++++++++++++++++++++++++++++
 devel/py-dbt-extractor/pkg-descr       |   7 ++
 5 files changed, 217 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index e559fc2479e7..126629232271 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -4573,6 +4573,7 @@
     SUBDIR += py-dateutil
     SUBDIR += py-dateutils
     SUBDIR += py-datrie
+    SUBDIR += py-dbt-extractor
     SUBDIR += py-dbus
     SUBDIR += py-ddsketch
     SUBDIR += py-ddt
diff --git a/devel/py-dbt-extractor/Makefile b/devel/py-dbt-extractor/Makefile
new file mode 100644
index 000000000000..bc57dc314d99
--- /dev/null
+++ b/devel/py-dbt-extractor/Makefile
@@ -0,0 +1,35 @@
+PORTNAME=	dbt-extractor
+PORTVERSION=	0.4.1
+CATEGORIES=	devel python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+DISTNAME=	dbt_extractor-${PORTVERSION}
+DISTFILES=	${DISTNAME}.tar.gz
+
+MAINTAINER=	pat@patmaddox.com
+COMMENT=	Analyze and extract information from Jinja used in dbt projects
+WWW=		https://github.com/dbt-labs/dbt-extractor/
+
+LICENSE=	APACHE20
+
+BUILD_DEPENDS=	maturin:devel/py-maturin@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}tree-sitter>0:devel/py-tree-sitter@${PY_FLAVOR}
+
+USES=		cargo python
+USE_PYTHON=	autoplist concurrent pep517
+
+CARGO_BUILD=	no
+CARGO_INSTALL=	no
+
+post-extract:
+	${LN} -s ${WRKDIR}/tree-sitter-jinja2-*/ ${WRKSRC}/tree-sitter-dbt-jinja
+
+pre-build:
+	cd ${WRKSRC} && maturin build -f
+	${MKDIR} ${WRKSRC}/dist
+	${CP} ${WRKSRC}/target/wheels/${DISTNAME}-*freebsd*.whl ${WRKSRC}/dist/
+
+do-test:
+	@(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} PYO3_PYTHON=${PYTHON_CMD} ${CARGO} test)
+
+.include <bsd.port.mk>
diff --git a/devel/py-dbt-extractor/Makefile.crates b/devel/py-dbt-extractor/Makefile.crates
new file mode 100644
index 000000000000..f73adc1ea048
--- /dev/null
+++ b/devel/py-dbt-extractor/Makefile.crates
@@ -0,0 +1,57 @@
+CARGO_CRATES=	aho-corasick-0.7.18 \
+		autocfg-1.0.1 \
+		bitflags-1.3.2 \
+		cc-1.0.69 \
+		cfg-if-1.0.0 \
+		crossbeam-channel-0.5.1 \
+		crossbeam-deque-0.8.1 \
+		crossbeam-epoch-0.9.5 \
+		crossbeam-utils-0.8.5 \
+		either-1.6.1 \
+		env_logger-0.8.4 \
+		getrandom-0.2.3 \
+		hermit-abi-0.1.19 \
+		indoc-0.3.6 \
+		indoc-impl-0.3.6 \
+		instant-0.1.10 \
+		lazy_static-1.4.0 \
+		libc-0.2.101 \
+		lock_api-0.4.4 \
+		log-0.4.14 \
+		memchr-2.4.1 \
+		memoffset-0.6.4 \
+		num_cpus-1.13.0 \
+		once_cell-1.9.0 \
+		parking_lot-0.11.1 \
+		parking_lot_core-0.8.3 \
+		paste-0.1.18 \
+		paste-impl-0.1.18 \
+		proc-macro-hack-0.5.19 \
+		proc-macro2-1.0.28 \
+		pyo3-0.15.1 \
+		pyo3-build-config-0.15.1 \
+		pyo3-macros-0.15.1 \
+		pyo3-macros-backend-0.15.1 \
+		quickcheck-1.0.3 \
+		quickcheck_macros-1.0.0 \
+		quote-1.0.9 \
+		rand-0.8.4 \
+		rand_core-0.6.3 \
+		rayon-1.5.1 \
+		rayon-core-1.9.1 \
+		redox_syscall-0.2.10 \
+		regex-1.5.4 \
+		regex-syntax-0.6.25 \
+		scopeguard-1.1.0 \
+		smallvec-1.6.1 \
+		syn-1.0.75 \
+		thiserror-1.0.26 \
+		thiserror-impl-1.0.26 \
+		tree-sitter-0.19.5 \
+		unicode-xid-0.2.2 \
+		unindent-0.1.7 \
+		wasi-0.10.2+wasi-snapshot-preview1 \
+		winapi-0.3.9 \
+		winapi-i686-pc-windows-gnu-0.4.0 \
+		winapi-x86_64-pc-windows-gnu-0.4.0 \
+		tree-sitter-jinja2@git+https://github.com/dbt-labs/tree-sitter-jinja2?tag=v0.1.0\#52da7b0b1480b23381ea84cf5ea3bf058dd6d8c4
diff --git a/devel/py-dbt-extractor/distinfo b/devel/py-dbt-extractor/distinfo
new file mode 100644
index 000000000000..babcf06ef92c
--- /dev/null
+++ b/devel/py-dbt-extractor/distinfo
@@ -0,0 +1,117 @@
+TIMESTAMP = 1691560041
+SHA256 (dbt_extractor-0.4.1.tar.gz) = 75b1c665699ec0f1ffce1ba3d776f7dfce802156f22e70a7b9c8f0b4d7e80f42
+SIZE (dbt_extractor-0.4.1.tar.gz) = 264647
+SHA256 (rust/crates/aho-corasick-0.7.18.crate) = 1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f
+SIZE (rust/crates/aho-corasick-0.7.18.crate) = 112923
+SHA256 (rust/crates/autocfg-1.0.1.crate) = cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a
+SIZE (rust/crates/autocfg-1.0.1.crate) = 12908
+SHA256 (rust/crates/bitflags-1.3.2.crate) = bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a
+SIZE (rust/crates/bitflags-1.3.2.crate) = 23021
+SHA256 (rust/crates/cc-1.0.69.crate) = e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2
+SIZE (rust/crates/cc-1.0.69.crate) = 56044
+SHA256 (rust/crates/cfg-if-1.0.0.crate) = baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd
+SIZE (rust/crates/cfg-if-1.0.0.crate) = 7934
+SHA256 (rust/crates/crossbeam-channel-0.5.1.crate) = 06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4
+SIZE (rust/crates/crossbeam-channel-0.5.1.crate) = 86919
+SHA256 (rust/crates/crossbeam-deque-0.8.1.crate) = 6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e
+SIZE (rust/crates/crossbeam-deque-0.8.1.crate) = 20852
+SHA256 (rust/crates/crossbeam-epoch-0.9.5.crate) = 4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd
+SIZE (rust/crates/crossbeam-epoch-0.9.5.crate) = 43883
+SHA256 (rust/crates/crossbeam-utils-0.8.5.crate) = d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db
+SIZE (rust/crates/crossbeam-utils-0.8.5.crate) = 38414
+SHA256 (rust/crates/either-1.6.1.crate) = e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457
+SIZE (rust/crates/either-1.6.1.crate) = 13641
+SHA256 (rust/crates/env_logger-0.8.4.crate) = a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3
+SIZE (rust/crates/env_logger-0.8.4.crate) = 33342
+SHA256 (rust/crates/getrandom-0.2.3.crate) = 7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753
+SIZE (rust/crates/getrandom-0.2.3.crate) = 26261
+SHA256 (rust/crates/hermit-abi-0.1.19.crate) = 62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33
+SIZE (rust/crates/hermit-abi-0.1.19.crate) = 9979
+SHA256 (rust/crates/indoc-0.3.6.crate) = 47741a8bc60fb26eb8d6e0238bbb26d8575ff623fdc97b1a2c00c050b9684ed8
+SIZE (rust/crates/indoc-0.3.6.crate) = 9663
+SHA256 (rust/crates/indoc-impl-0.3.6.crate) = ce046d161f000fffde5f432a0d034d0341dc152643b2598ed5bfce44c4f3a8f0
+SIZE (rust/crates/indoc-impl-0.3.6.crate) = 7933
+SHA256 (rust/crates/instant-0.1.10.crate) = bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d
+SIZE (rust/crates/instant-0.1.10.crate) = 5218
+SHA256 (rust/crates/lazy_static-1.4.0.crate) = e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646
+SIZE (rust/crates/lazy_static-1.4.0.crate) = 10443
+SHA256 (rust/crates/libc-0.2.101.crate) = 3cb00336871be5ed2c8ed44b60ae9959dc5b9f08539422ed43f09e34ecaeba21
+SIZE (rust/crates/libc-0.2.101.crate) = 530003
+SHA256 (rust/crates/lock_api-0.4.4.crate) = 0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb
+SIZE (rust/crates/lock_api-0.4.4.crate) = 20356
+SHA256 (rust/crates/log-0.4.14.crate) = 51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710
+SIZE (rust/crates/log-0.4.14.crate) = 34582
+SHA256 (rust/crates/memchr-2.4.1.crate) = 308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a
+SIZE (rust/crates/memchr-2.4.1.crate) = 64977
+SHA256 (rust/crates/memoffset-0.6.4.crate) = 59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9
+SIZE (rust/crates/memoffset-0.6.4.crate) = 7664
+SHA256 (rust/crates/num_cpus-1.13.0.crate) = 05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3
+SIZE (rust/crates/num_cpus-1.13.0.crate) = 14704
+SHA256 (rust/crates/once_cell-1.9.0.crate) = da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5
+SIZE (rust/crates/once_cell-1.9.0.crate) = 30702
+SHA256 (rust/crates/parking_lot-0.11.1.crate) = 6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb
+SIZE (rust/crates/parking_lot-0.11.1.crate) = 39854
+SHA256 (rust/crates/parking_lot_core-0.8.3.crate) = fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018
+SIZE (rust/crates/parking_lot_core-0.8.3.crate) = 32147
+SHA256 (rust/crates/paste-0.1.18.crate) = 45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880
+SIZE (rust/crates/paste-0.1.18.crate) = 12259
+SHA256 (rust/crates/paste-impl-0.1.18.crate) = d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6
+SIZE (rust/crates/paste-impl-0.1.18.crate) = 9451
+SHA256 (rust/crates/proc-macro-hack-0.5.19.crate) = dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5
+SIZE (rust/crates/proc-macro-hack-0.5.19.crate) = 15556
+SHA256 (rust/crates/proc-macro2-1.0.28.crate) = 5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612
+SIZE (rust/crates/proc-macro2-1.0.28.crate) = 38732
+SHA256 (rust/crates/pyo3-0.15.1.crate) = 7cf01dbf1c05af0a14c7779ed6f3aa9deac9c3419606ac9de537a2d649005720
+SIZE (rust/crates/pyo3-0.15.1.crate) = 370722
+SHA256 (rust/crates/pyo3-build-config-0.15.1.crate) = dbf9e4d128bfbddc898ad3409900080d8d5095c379632fbbfbb9c8cfb1fb852b
+SIZE (rust/crates/pyo3-build-config-0.15.1.crate) = 22095
+SHA256 (rust/crates/pyo3-macros-0.15.1.crate) = 67701eb32b1f9a9722b4bc54b548ff9d7ebfded011c12daece7b9063be1fd755
+SIZE (rust/crates/pyo3-macros-0.15.1.crate) = 7555
+SHA256 (rust/crates/pyo3-macros-backend-0.15.1.crate) = f44f09e825ee49a105f2c7b23ebee50886a9aee0746f4dd5a704138a64b0218a
+SIZE (rust/crates/pyo3-macros-backend-0.15.1.crate) = 46111
+SHA256 (rust/crates/quickcheck-1.0.3.crate) = 588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6
+SIZE (rust/crates/quickcheck-1.0.3.crate) = 28069
+SHA256 (rust/crates/quickcheck_macros-1.0.0.crate) = b22a693222d716a9587786f37ac3f6b4faedb5b80c23914e7303ff5a1d8016e9
+SIZE (rust/crates/quickcheck_macros-1.0.0.crate) = 5275
+SHA256 (rust/crates/quote-1.0.9.crate) = c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7
+SIZE (rust/crates/quote-1.0.9.crate) = 25042
+SHA256 (rust/crates/rand-0.8.4.crate) = 2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8
+SIZE (rust/crates/rand-0.8.4.crate) = 87406
+SHA256 (rust/crates/rand_core-0.6.3.crate) = d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7
+SIZE (rust/crates/rand_core-0.6.3.crate) = 21938
+SHA256 (rust/crates/rayon-1.5.1.crate) = c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90
+SIZE (rust/crates/rayon-1.5.1.crate) = 160424
+SHA256 (rust/crates/rayon-core-1.9.1.crate) = d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e
+SIZE (rust/crates/rayon-core-1.9.1.crate) = 64961
+SHA256 (rust/crates/redox_syscall-0.2.10.crate) = 8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff
+SIZE (rust/crates/redox_syscall-0.2.10.crate) = 23582
+SHA256 (rust/crates/regex-1.5.4.crate) = d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461
+SIZE (rust/crates/regex-1.5.4.crate) = 236581
+SHA256 (rust/crates/regex-syntax-0.6.25.crate) = f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b
+SIZE (rust/crates/regex-syntax-0.6.25.crate) = 293293
+SHA256 (rust/crates/scopeguard-1.1.0.crate) = d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd
+SIZE (rust/crates/scopeguard-1.1.0.crate) = 11470
+SHA256 (rust/crates/smallvec-1.6.1.crate) = fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e
+SIZE (rust/crates/smallvec-1.6.1.crate) = 26444
+SHA256 (rust/crates/syn-1.0.75.crate) = b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7
+SIZE (rust/crates/syn-1.0.75.crate) = 233068
+SHA256 (rust/crates/thiserror-1.0.26.crate) = 93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2
+SIZE (rust/crates/thiserror-1.0.26.crate) = 16711
+SHA256 (rust/crates/thiserror-impl-1.0.26.crate) = 060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745
+SIZE (rust/crates/thiserror-impl-1.0.26.crate) = 13431
+SHA256 (rust/crates/tree-sitter-0.19.5.crate) = ad726ec26496bf4c083fff0f43d4eb3a2ad1bba305323af5ff91383c0b6ecac0
+SIZE (rust/crates/tree-sitter-0.19.5.crate) = 125205
+SHA256 (rust/crates/unicode-xid-0.2.2.crate) = 8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3
+SIZE (rust/crates/unicode-xid-0.2.2.crate) = 14955
+SHA256 (rust/crates/unindent-0.1.7.crate) = f14ee04d9415b52b3aeab06258a3f07093182b88ba0f9b8d203f211a7a7d41c7
+SIZE (rust/crates/unindent-0.1.7.crate) = 8346
+SHA256 (rust/crates/wasi-0.10.2+wasi-snapshot-preview1.crate) = fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6
+SIZE (rust/crates/wasi-0.10.2+wasi-snapshot-preview1.crate) = 27505
+SHA256 (rust/crates/winapi-0.3.9.crate) = 5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419
+SIZE (rust/crates/winapi-0.3.9.crate) = 1200382
+SHA256 (rust/crates/winapi-i686-pc-windows-gnu-0.4.0.crate) = ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6
+SIZE (rust/crates/winapi-i686-pc-windows-gnu-0.4.0.crate) = 2918815
+SHA256 (rust/crates/winapi-x86_64-pc-windows-gnu-0.4.0.crate) = 712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f
+SIZE (rust/crates/winapi-x86_64-pc-windows-gnu-0.4.0.crate) = 2947998
+SHA256 (dbt-labs-tree-sitter-jinja2-v0.1.0_GH0.tar.gz) = 2513994450f81a0674676fa451d4eea9ea4e665e6f7c1e1f4577ff9466feb765
+SIZE (dbt-labs-tree-sitter-jinja2-v0.1.0_GH0.tar.gz) = 22280
diff --git a/devel/py-dbt-extractor/pkg-descr b/devel/py-dbt-extractor/pkg-descr
new file mode 100644
index 000000000000..c67935eeb561
--- /dev/null
+++ b/devel/py-dbt-extractor/pkg-descr
@@ -0,0 +1,7 @@
+A tool that processes the most common jinja value templates in dbt model
+files. The tool depends on tree-sitter and the tree-sitter-jinja2 library.
+
+The current strategy is for this processor to be 100% certain when it can
+accurately extract values from a given model file. Anything less than 100%
+certainty returns an exception so that the model can be rendered with python
+Jinja instead.