From 5fd9237759454716b33edbc028504a29119cee72 Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Sun, 5 Jul 2026 10:08:59 +0200 Subject: [PATCH] dev-python/anthropic: add 0.116.0 Signed-off-by: Florian Albrechtskirchinger --- dev-python/anthropic/Manifest | 5 + dev-python/anthropic/anthropic-0.116.0.ebuild | 172 ++++++++++++++++++ ...opic-0.116.0-mock-server-package-lock.json | 96 ++++++++++ ...anthropic-0.116.0-mock-server-package.json | 5 + 4 files changed, 278 insertions(+) create mode 100644 dev-python/anthropic/anthropic-0.116.0.ebuild create mode 100644 dev-python/anthropic/files/anthropic-0.116.0-mock-server-package-lock.json create mode 100644 dev-python/anthropic/files/anthropic-0.116.0-mock-server-package.json diff --git a/dev-python/anthropic/Manifest b/dev-python/anthropic/Manifest index 94ce685825..4493195378 100644 --- a/dev-python/anthropic/Manifest +++ b/dev-python/anthropic/Manifest @@ -1,5 +1,10 @@ +DIST anthropic-openapi-spec-0.116.0.yml 1719154 BLAKE2B 32be75b7450aa5062831d2f1a78a97303f2f783a94df1850e724882b2e587328bb58245225f0dc605a30c9d681f3ee7f5dea53e7988997343fd753e8ceac9fe2 SHA512 c9849308da448eaac0960006c01fde2f4f2f749fdcfe9316931be0fd11b9fcbee6d6897140722c6e5c211480e93b19f0ee274fd31ab1c2ec4193dd1ab3af77f2 DIST anthropic-openapi-spec-v2026.03.18.yml 724122 BLAKE2B d890c6d5082b0e540c340943dccd2a48d0d18dc31bbc5e55df45d93bbd3e2b64e515d46a814365bc0e56a7a1904a94ae252d65bd6fb631a0ea872fa6f3b05b14 SHA512 41aceb88f1b93437a9a15ec9a8ab917b65c647ee4ac579456a6b35a8d1a5df4903345927e7443739461dc430cec3156c980258f92f57b298c31ca53dcb66c608 +DIST anthropic-sdk-python-0.116.0.gh.tar.gz 970819 BLAKE2B 74a310bffe030cce92c7be650cfd77c1cb41fe1ce660536a383502a8239fbe4ff49a83f574e3637354d743e585fc2760c1e4446830def8f7135192788e4838b3 SHA512 0efd6713463fb242427ed86bb963501c99dd54f6da455d9ee5124fc3309a2fc7490add508bf09037583199de77f8e38e8766bfa42854b085c1e6bb38cc385647 DIST anthropic-sdk-python-0.86.0.gh.tar.gz 602140 BLAKE2B 31a0c049926f1f3049a2846a0b62062c7e03d29a4deda739a9a7583a26e52dddde92d4207ce424022d848e793cd758e257e734018f33ddbae556bb274264a7fb SHA512 7aae6861a4c042ccfd2c15b97c89fa7a1855f525a59e2eccdf22ef5550bc7b31b3546cefa746a107ff74027061de0bb6951f2db9bd34d0ee373b17f9f8b8e8f5 DIST npm-@stdy-cli-cli-0.19.7.tgz 7773 BLAKE2B 6ddc9db08ab06ef1ece58d3aeaf27517319a399262a63caa06e2d13a1bd8c83fac298a451f0ea57a71aaf9c4120f4efb742308106498d492d2593a4b58e04151 SHA512 ba4758dbe0d32e7c9994471713d0ae9a0967813bd1ec8fbce88247c2582ea248196f7858b56ce76e0716e016d5366b42700a78b603626d8de00e5a92599e009e +DIST npm-@stdy-cli-cli-0.22.1.tgz 7776 BLAKE2B ec66af59c4c864a4331dc7918ed0a82d452579427663c3666b94d6008e769cb8a61d00e1971a394c326ca180da7f3009597b15d4c6bea8d169bda56c87ae21fb SHA512 55d9c2a0afddd09588853a1a8c1c4075a813a4b097ff34dded18ae2b529d4f5d90e29667ffe792f7b82af78fa3bfa4db88c77ef5259e39db100a86a0a4b98d7c DIST npm-@stdy-cli-linux-arm64-cli-linux-arm64-0.19.7.tgz 36812291 BLAKE2B b0c8fba73598ce1e6aa824ffefd237eb35875879308820ef1aeeba9ba80378ef346ef9ffd40107b1b9d7754cd8acac1076d74a55fddbf3cbad9881cb8b19b0be SHA512 8b9cb95aadbbba48b2531451cf991b9d067b6ef697a38ff2b3df72d82d3967c1ab1e29274dee23283557c47e881ee0cb12e5223163d1fec06ecea96fdaecfda4 +DIST npm-@stdy-cli-linux-arm64-cli-linux-arm64-0.22.1.tgz 37635112 BLAKE2B f749d99342d9cffb831f0feea34ed74301a3beea7ec4c7e46cd5b942cacfea4b10c28632cc3e38a0ac00b565c2ca5889cb6587fcccb75f1557fa29dace58a343 SHA512 5c6432dd9a85e423aa4600151b109da16f5dcf19dfc710920070869a1a4573ea557e941c6077cf72736199686994c09eae24d4c8228b246fbf7c67728e2eded9 DIST npm-@stdy-cli-linux-x64-cli-linux-x64-0.19.7.tgz 37584041 BLAKE2B b9b6bee19fdf51c985d907b7dc8638ab3d3ebf88083794fb0d39a5f6c64beffbaf321cd71fc2869812092c0504fa47e3b889d0ffe483622fd215d214e4c1645e SHA512 2719af63c71ad21293bd3cac5d19f6b0ca960d0888026d9ffa5a62467d5d434d8937edb0ce90d467fdd348ba40b6f96a3ccd5e9c6b551b75a7de79d5fcc40df1 +DIST npm-@stdy-cli-linux-x64-cli-linux-x64-0.22.1.tgz 38431354 BLAKE2B f6b49ce9f79ad98de58f6f01874e5ae03f728f062b09b91b092f1410e1bf3d2874d25dfb30038291429043eeffc4c5e3183e7e9307c6fb889521008b981df4f9 SHA512 bbbe7cd48dec73a47e3d4c0692f1056ef0ffc3a617bd193e893d0122658a3ed298036e9c3cfd7a96003b82abaeded00493eddcf581a7e71854a6109cf7a68b4a diff --git a/dev-python/anthropic/anthropic-0.116.0.ebuild b/dev-python/anthropic/anthropic-0.116.0.ebuild new file mode 100644 index 0000000000..459c46f2a4 --- /dev/null +++ b/dev-python/anthropic/anthropic-0.116.0.ebuild @@ -0,0 +1,172 @@ +# Copyright 2024-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=hatchling +PYTHON_COMPAT=( python3_{12..14} ) + +inherit distutils-r1 optfeature pypi + +# See https://github.com/anthropics/anthropic-sdk-python/blob/main/.stats.yml +API_SPEC_BASE="https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic" +API_SPEC="anthropic-openapi-spec-${PV}.yml" +MY_PN="anthropic-sdk-python" +# See https://github.com/anthropics/anthropic-sdk-python/blob/main/scripts/mock +STDY_PV=0.22.1 +DESCRIPTION="The official Python library for the anthropic API" +HOMEPAGE=" + https://github.com/anthropics/anthropic-sdk-python + https://pypi.org/project/anthropic +" +SRC_URI=" + https://github.com/anthropics/${MY_PN}/archive/refs/tags/v${PV}.tar.gz + -> ${MY_PN}-${PV}.gh.tar.gz + + test? ( + ${API_SPEC_BASE}/anthropic-506a5ad71d522b4ae56ac3429380486647af1f92eddde80603480fb592d62b54.yml + -> ${API_SPEC} + + https://registry.npmjs.org/@stdy/cli/-/cli-${STDY_PV}.tgz + -> npm-@stdy-cli-cli-${STDY_PV}.tgz + + amd64? ( + https://registry.npmjs.org/@stdy/cli-linux-x64/-/cli-linux-x64-${STDY_PV}.tgz + -> npm-@stdy-cli-linux-x64-cli-linux-x64-${STDY_PV}.tgz + ) + + arm64? ( + https://registry.npmjs.org/@stdy/cli-linux-arm64/-/cli-linux-arm64-${STDY_PV}.tgz + -> npm-@stdy-cli-linux-arm64-cli-linux-arm64-${STDY_PV}.tgz + ) + ) +" +S="${WORKDIR}/${MY_PN}-${PV}" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm64" + +RDEPEND=" + >=dev-python/anyio-3.5.0[${PYTHON_USEDEP}] + >=dev-python/distro-1.7.0[${PYTHON_USEDEP}] + >=dev-python/docstring-parser-0.15[${PYTHON_USEDEP}] + >=dev-python/httpx-0.25.0[${PYTHON_USEDEP}] + >=dev-python/jiter-0.4.0[${PYTHON_USEDEP}] + >=dev-python/pydantic-1.9.0[${PYTHON_USEDEP}] + dev-python/sniffio[${PYTHON_USEDEP}] + >=dev-python/typing-extensions-4.14[${PYTHON_USEDEP}] +" + +BDEPEND=" + dev-python/hatch-fancy-pypi-readme[${PYTHON_USEDEP}] + test? ( + >=dev-python/boto3-1.28.57[${PYTHON_USEDEP}] + >=dev-python/botocore-1.31.57[${PYTHON_USEDEP}] + >=dev-python/httpx-aiohttp-0.1.9[${PYTHON_USEDEP}] + >=dev-python/rich-13.7.1[${PYTHON_USEDEP}] + >=dev-python/standardwebhooks-1.0.1[${PYTHON_USEDEP}] + net-libs/nodejs[npm] + ) +" + +EPYTEST_PLUGINS=( + dirty-equals + http-snapshot + inline-snapshot + pytest-{asyncio,xdist} + respx + time-machine +) +distutils_enable_tests pytest + +src_unpack() { + unpack "${MY_PN}-${PV}.gh.tar.gz" +} + +src_test() { + einfo "Assembling npm cache..." + + local -x npm_config_cache="${WORKDIR}/npm-cache" + mkdir -p "${npm_config_cache}" || die + + for distfile in ${A}; do + if [[ "${distfile}" == npm-* ]]; then + npm cache add "${DISTDIR}/${distfile}" &>/dev/null || die + fi + done + + einfo "Installing mock server..." + + local mock_dir="${WORKDIR}/mock-server" + mkdir -p "${mock_dir}" || die + + cp "${FILESDIR}/${PN}-0.116.0-mock-server-package.json" \ + "${mock_dir}/package.json" || die + cp "${FILESDIR}/${PN}-0.116.0-mock-server-package-lock.json" \ + "${mock_dir}/package-lock.json" || die + + local mock_dir="${WORKDIR}/mock-server" + local mock="${mock_dir}/node_modules/.bin/steady" + + pushd "${mock_dir}" >/dev/null || die + + npm ci &>/dev/null || die + + einfo "Starting mock server..." + + # Replicate the logic from scripts/mock --daemon + "${mock}" --host 127.0.0.1 -p 4010 \ + --validator-form-array-format=brackets \ + --validator-query-array-format=brackets \ + --validator-form-object-format=brackets \ + --validator-query-object-format=brackets \ + "${DISTDIR}/${API_SPEC}" &> .stdy.log & + local mock_pid=$! + + is_mock_running() { + local -a args + readarray -d '' args < "/proc/${mock_pid}/cmdline" 2>/dev/null || return 1 + [[ "${args[1]}" == "${mock}" ]] + } + + local attempts=0 + while ! curl -sf "http://127.0.0.1:4010/_x-steady/health" &>/dev/null; do + if ! is_mock_running; then + cat .stdy.log + die "Mock server failed to start" + fi + attempts=$((attempts + 1)) + if (( attempts >= 300 )); then + cat .stdy.log + die "Timed out waiting for mock server to start" + fi + sleep 0.1 + done + + # Oops; connected to another Steady instance running on 4010 + is_mock_running || die + + popd >/dev/null || die + + nonfatal distutils-r1_src_test + local ret=${?} + + if is_mock_running; then + einfo "Stopping mock server..." + kill "${mock_pid}" || die + fi + + [[ ${ret} -ne 0 ]] && die +} + +pkg_postinst() { + optfeature "alternative async HTTP client support" \ + "dev-python/aiohttp >=dev-python/httpx-aiohttp-0.1.9" + optfeature "Google Cloud Vertex AI integration" \ + ">=dev-python/google-auth-2 dev-python/requests" + optfeature "Amazon Web Services (AWS) Bedrock integration" \ + ">=dev-python/boto3-1.28.57 >=dev-python/botocore-1.31.57" + optfeature "Model Context Protocol (MCP) support" \ + ">=dev-python/mcp-1.0" +} diff --git a/dev-python/anthropic/files/anthropic-0.116.0-mock-server-package-lock.json b/dev-python/anthropic/files/anthropic-0.116.0-mock-server-package-lock.json new file mode 100644 index 0000000000..f651ba1b64 --- /dev/null +++ b/dev-python/anthropic/files/anthropic-0.116.0-mock-server-package-lock.json @@ -0,0 +1,96 @@ +{ + "name": "mock-server", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "@stdy/cli": "0.22.1" + } + }, + "node_modules/@stdy/cli": { + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@stdy/cli/-/cli-0.22.1.tgz", + "integrity": "sha512-VdnCoK/d0JWIhToajBxAdagTpLCX/zTd7RiuK1KdT12Q4pZn/+eS97gq94+jv6TbiMd+9SWeOdsQCoagpLmNfA==", + "license": "Elastic-2.0", + "bin": { + "steady": "steady.js" + }, + "engines": { + "node": ">=14.0.0" + }, + "optionalDependencies": { + "@stdy/cli-darwin-arm64": "0.22.1", + "@stdy/cli-darwin-x64": "0.22.1", + "@stdy/cli-linux-arm64": "0.22.1", + "@stdy/cli-linux-x64": "0.22.1", + "@stdy/cli-win32-x64": "0.22.1" + } + }, + "node_modules/@stdy/cli-darwin-arm64": { + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@stdy/cli-darwin-arm64/-/cli-darwin-arm64-0.22.1.tgz", + "integrity": "sha512-sahxc3R9I+vO7dDr7t9aneE8aLZdZeaQU5OfhZVLny97K8K7RXqhpXHN/0DFvg3Pw5ZKisHvJysY3iu/LIZA6g==", + "cpu": [ + "arm64" + ], + "license": "Elastic-2.0", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@stdy/cli-darwin-x64": { + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@stdy/cli-darwin-x64/-/cli-darwin-x64-0.22.1.tgz", + "integrity": "sha512-/bVzcHkbX6zn5qZL73oWR5YXVc/+/IP7uWYw905B+hWRuZlJfN7hX4+68BxCBOI8wiRf82cSQjRnI/Datdwz1Q==", + "cpu": [ + "x64" + ], + "license": "Elastic-2.0", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@stdy/cli-linux-arm64": { + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@stdy/cli-linux-arm64/-/cli-linux-arm64-0.22.1.tgz", + "integrity": "sha512-XGQy3ZqF5COqRgAVGxCdoW9dzxnfxxCSAHCGmhpFc+pVfpQcYHfPcnNhmWhplMCeriTUyCKLJG+/fGdyji7e2Q==", + "cpu": [ + "arm64" + ], + "license": "Elastic-2.0", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@stdy/cli-linux-x64": { + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@stdy/cli-linux-x64/-/cli-linux-x64-0.22.1.tgz", + "integrity": "sha512-u7581I3sc6R+PUwGkvEFbvD/w6YXvRk+iT0BImWKPtKYA26cPP16lgA7gquu3tAEk+3c9YGn5xhUphCc96aLSg==", + "cpu": [ + "x64" + ], + "license": "Elastic-2.0", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@stdy/cli-win32-x64": { + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@stdy/cli-win32-x64/-/cli-win32-x64-0.22.1.tgz", + "integrity": "sha512-4kkgSGCKTO/Fb+ciBANshegYIztBqynIyOveWYc3Vp7mXszg8yx6slKSzz5bg757H8Ol2jxxuL4XxHVIGMr6Rw==", + "cpu": [ + "x64" + ], + "license": "Elastic-2.0", + "optional": true, + "os": [ + "win32" + ] + } + } +} diff --git a/dev-python/anthropic/files/anthropic-0.116.0-mock-server-package.json b/dev-python/anthropic/files/anthropic-0.116.0-mock-server-package.json new file mode 100644 index 0000000000..66616ec5d2 --- /dev/null +++ b/dev-python/anthropic/files/anthropic-0.116.0-mock-server-package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@stdy/cli": "0.22.1" + } +}