git: 18ac24ac0e2b - main - misc/py-anthropic: new port - REST-based SDK for Anthropic API

From: Dave Cottlehuber <dch_at_FreeBSD.org>
Date: Wed, 22 May 2024 13:57:25 UTC
The branch main has been updated by dch:

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

commit 18ac24ac0e2b96b92c0d1c7f0574624daac3097e
Author:     Dave Cottlehuber <dch@FreeBSD.org>
AuthorDate: 2024-05-22 13:57:17 +0000
Commit:     Dave Cottlehuber <dch@FreeBSD.org>
CommitDate: 2024-05-22 13:57:17 +0000

    misc/py-anthropic: new port - REST-based SDK for Anthropic API
---
 misc/Makefile               |  1 +
 misc/py-anthropic/Makefile  | 30 ++++++++++++++++++++++++++++++
 misc/py-anthropic/distinfo  |  3 +++
 misc/py-anthropic/pkg-descr |  5 +++++
 4 files changed, 39 insertions(+)

diff --git a/misc/Makefile b/misc/Makefile
index d127008332ac..1134a465c505 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -404,6 +404,7 @@
     SUBDIR += py-SoapySDR
     SUBDIR += py-accelerate
     SUBDIR += py-alive-progress
+    SUBDIR += py-anthropic
     SUBDIR += py-apache-beam
     SUBDIR += py-ascii-magic
     SUBDIR += py-ast-comments
diff --git a/misc/py-anthropic/Makefile b/misc/py-anthropic/Makefile
new file mode 100644
index 000000000000..66bf76dca395
--- /dev/null
+++ b/misc/py-anthropic/Makefile
@@ -0,0 +1,30 @@
+PORTNAME=	anthropic
+DISTVERSION=	0.26.0
+CATEGORIES=	misc python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	dch@FreeBSD.org
+COMMENT=	Convenient access to the Anthropic REST API via python
+WWW=		https://github.com/anthropics/anthropic-sdk-python
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}hatch-fancy-pypi-readme>=0:devel/py-hatch-fancy-pypi-readme@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}hatchling>=0:devel/py-hatchling@${PY_FLAVOR}
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}anyio>=3.5:devel/py-anyio@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}cached-property>=1.2.0:devel/py-cached-property@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}distro>0:sysutils/py-distro@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}httpx>=0.23.0:www/py-httpx@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pydantic2>1.9.0:devel/py-pydantic2@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}sniffio>0:devel/py-sniffio@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}tokenizers>0:textproc/py-tokenizers@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.7:devel/py-typing-extensions@${PY_FLAVOR}
+
+USES=		python
+USE_PYTHON=	autoplist concurrent pep517
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/misc/py-anthropic/distinfo b/misc/py-anthropic/distinfo
new file mode 100644
index 000000000000..19f2c43ab7b5
--- /dev/null
+++ b/misc/py-anthropic/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1716217275
+SHA256 (anthropic-0.26.0.tar.gz) = 6aaffeb05d515cf9788eef57150a5f827f3786883628ccac71dbe5671ab6f44e
+SIZE (anthropic-0.26.0.tar.gz) = 828128
diff --git a/misc/py-anthropic/pkg-descr b/misc/py-anthropic/pkg-descr
new file mode 100644
index 000000000000..8dd3ef218a1c
--- /dev/null
+++ b/misc/py-anthropic/pkg-descr
@@ -0,0 +1,5 @@
+Provides convenient access to the Anthropic REST API from any Python application.
+It includes type definitions for all request params and response fields, and
+offers both synchronous and asynchronous clients powered by httpx.
+
+The REST API documentation can be found on docs.anthropic.com.