git: 6807332e573b - main - devel/py-ddtrace: Add OPENAI option

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sun, 04 Aug 2024 21:31:40 UTC
The branch main has been updated by sunpoet:

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

commit 6807332e573bf4dcf9b9f02521eb4b4dd162992b
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2024-08-04 21:30:51 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-08-04 21:30:51 +0000

    devel/py-ddtrace: Add OPENAI option
    
    - Bump PORTREVISION for dependency change
---
 devel/py-ddtrace/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/devel/py-ddtrace/Makefile b/devel/py-ddtrace/Makefile
index 1583bb335f83..73e5b8a69bee 100644
--- a/devel/py-ddtrace/Makefile
+++ b/devel/py-ddtrace/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	ddtrace
 PORTVERSION=	2.10.2
+PORTREVISION=	1
 CATEGORIES=	devel python
 MASTER_SITES=	PYPI \
 		https://github.com/abseil/abseil-cpp/releases/download/20240116.2/:abseil
@@ -48,10 +49,12 @@ SHEBANG_FILES=	ddtrace/internal/datadog/profiling/cmake/tools/fetch_infer.sh \
 		ddtrace/internal/datadog/profiling/cmake/tools/fetch_libdatadog.sh \
 		ddtrace/internal/datadog/profiling/setup_custom.sh
 
-OPTIONS_DEFINE=	OPENTRACING
-OPTIONS_DEFAULT=OPENTRACING
+OPTIONS_DEFINE=	OPENAI OPENTRACING
+OPTIONS_DEFAULT=OPENAI OPENTRACING
+OPENAI_DESC=		Calculate number of tokens
 OPENTRACING_DESC=	OpenTracing support
 
+OPENAI_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}tiktoken>=0:textproc/py-tiktoken@${PY_FLAVOR}
 OPENTRACING_RUN_DEPENDS=${PYTHON_PKGNAMEPREFIX}opentracing>=2.0.0:devel/py-opentracing@${PY_FLAVOR}
 
 .include <bsd.port.pre.mk>