git: ad476a8a41b7 - main - databases/py-dbt-duckdb: new port

From: Kurt Jaeger <pi_at_FreeBSD.org>
Date: Sun, 22 Oct 2023 09:15:38 UTC
The branch main has been updated by pi:

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

commit ad476a8a41b70043fc739fc01b32e7be910d6362
Author:     Pat Maddox <pat@patmaddox.com>
AuthorDate: 2023-10-22 09:14:47 +0000
Commit:     Kurt Jaeger <pi@FreeBSD.org>
CommitDate: 2023-10-22 09:15:28 +0000

    databases/py-dbt-duckdb: new port
    
    dbt-duckdb
    
    DuckDB is an embedded database, similar to SQLite, but designed for OLAP-style
    analytics. It is crazy fast and allows you to read and write data stored in CSV,
    JSON, and Parquet files directly, without requiring you to load them into the
    database first.
    
    dbt is the best way to manage a collection of data transformations written in
    SQL or Python for analytics and data science. dbt-duckdb is the project that
    ties DuckDB and dbt together, allowing you to create a Modern Data Stack In A
    Box or a simple and powerful data lakehouse with Python.
    
    PR:             274584
    Author:    Pat Maddox <pat@patmaddox.com>
---
 databases/Makefile                |  1 +
 databases/py-dbt-duckdb/Makefile  | 36 ++++++++++++++++++++++++++++++++++++
 databases/py-dbt-duckdb/distinfo  |  3 +++
 databases/py-dbt-duckdb/pkg-descr | 11 +++++++++++
 4 files changed, 51 insertions(+)

diff --git a/databases/Makefile b/databases/Makefile
index 34b75fde9742..ec438db417c0 100644
--- a/databases/Makefile
+++ b/databases/Makefile
@@ -757,6 +757,7 @@
     SUBDIR += py-databases
     SUBDIR += py-dbf
     SUBDIR += py-dbt-core
+    SUBDIR += py-dbt-duckdb
     SUBDIR += py-dbt-semantic-interfaces
     SUBDIR += py-dbt-snowflake
     SUBDIR += py-dbutils
diff --git a/databases/py-dbt-duckdb/Makefile b/databases/py-dbt-duckdb/Makefile
new file mode 100644
index 000000000000..94027b4a77e9
--- /dev/null
+++ b/databases/py-dbt-duckdb/Makefile
@@ -0,0 +1,36 @@
+PORTNAME=	dbt-duckdb
+PORTVERSION=	1.6.0
+CATEGORIES=	databases python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	pat@patmaddox.com
+COMMENT=	DuckDB adapter plugin for dbt (data build tool)
+WWW=		https://github.com/jwills/dbt-duckdb
+
+LICENSE=	APACHE20
+
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}dbt-core>=1.6.0,<2:databases/py-dbt-core@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}duckdb>=0.7.0:databases/py-duckdb@${PY_FLAVOR}
+
+USES=		python
+USE_PYTHON=	autoplist concurrent distutils
+
+# py-dbt-duckdb attempts to install __init__.py and the generated bytecode into
+# these directories which conflicts with those installed by py-dbt-core. We need to
+# delete these files and their entries in the generated plist post-install.
+COMMON_DIRS=	dbt \
+		dbt/adapters \
+		dbt/include
+
+post-stage:
+.for dir in ${COMMON_DIRS:S|/|\/|g}
+	@${REINPLACE_CMD} -e '/.*\/${dir}\/__init__.py/d' \
+		-e '/.*\/${dir}\/__pycache__.*/d' \
+		${WRKDIR}/.PLIST.pymodtmp
+.endfor
+.for dir in ${COMMON_DIRS}
+	@(cd ${STAGEDIR}${PYTHON_SITELIBDIR}/${dir} && ${RM} -r __pycache__ __init__.py)
+.endfor
+
+.include <bsd.port.mk>
diff --git a/databases/py-dbt-duckdb/distinfo b/databases/py-dbt-duckdb/distinfo
new file mode 100644
index 000000000000..fdf6ecf16212
--- /dev/null
+++ b/databases/py-dbt-duckdb/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1691548339
+SHA256 (dbt-duckdb-1.6.0.tar.gz) = e36776d6ee7aa1554a236b7ffa93c556c4419920134a3801feef7c64b706db16
+SIZE (dbt-duckdb-1.6.0.tar.gz) = 45586
diff --git a/databases/py-dbt-duckdb/pkg-descr b/databases/py-dbt-duckdb/pkg-descr
new file mode 100644
index 000000000000..577c7c7003d8
--- /dev/null
+++ b/databases/py-dbt-duckdb/pkg-descr
@@ -0,0 +1,11 @@
+dbt-duckdb
+
+DuckDB is an embedded database, similar to SQLite, but designed for OLAP-style
+analytics. It is crazy fast and allows you to read and write data stored in CSV,
+JSON, and Parquet files directly, without requiring you to load them into the
+database first.
+
+dbt is the best way to manage a collection of data transformations written in
+SQL or Python for analytics and data science. dbt-duckdb is the project that
+ties DuckDB and dbt together, allowing you to create a Modern Data Stack In A
+Box or a simple and powerful data lakehouse with Python.