mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-08 14:43:27 -04:00
dev-python/openai: add 2.44.0
Signed-off-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
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
|
||||
DIST openai-openapi-spec-2.44.0.yml 2333764 BLAKE2B f96a21463f43efd8e4930e91fae4f48b4be28ed497223374d3402a22a7f1fc1644deb89ce613901dde2a05c1ac92551406ebc8a99c58bf014698f3932565da77 SHA512 0a1c51e2a330f05c91f76646c7efc02633632524db0a18cf2eabbac9147ecbe60083b1e5789b0e3efd445cbebf34b48c025d4f640e4948289c44c8d2c4ef52ba
|
||||
DIST openai-openapi-spec-v2.3.0.yml 2167549 BLAKE2B f4f87bbaf33689e8f1336ad4ea78d39302c7b4c457ab47a164936f3e4056068d9a49e5bc54e47d196123c12da7b033f0c018c22ce8bef3a6fa7504dbd8f758ac SHA512 23ac527df45040575a5f9b020af0971a86acf1cc296eda538a39b003692277ba86b7d6d477eff0466e9178a2d8271a3374692aecad4e6b6ecd29c5bcae64947d
|
||||
DIST openai-python-2.29.0.gh.tar.gz 691490 BLAKE2B ce5dd047bc178d10e2505733e532b0e45bf604ce940902bed8656f41bfcdbdbdf61af91aaca30f1fc2e4175002d53a4c4b0c70ee8385e2e065d125e7f661faf6 SHA512 9bc5d9dbb747920412c1f73bbdcc36f6450dd0c4a245fde1e397864376816181823d92886ae4eb87fbee09e098fedeee8785602198deebd037a5f7bc520d2596
|
||||
DIST openai-python-2.44.0.gh.tar.gz 1017643 BLAKE2B bedd273b0e790b331c20244ae967a5082f878db1764451a47a6fbdedb71dd72c18f075d63e6cd2500bd4a6e95521034f5280cb5aa08ef06b0bfc09738cbdce6a SHA512 c0ae402fb6e60499220416c010ab3ce7f89c755f9ab04f61465c6b5033c339a1a94c971fe6af2eaf926d2d08a76d7270f249eb07f580978fe23a0aaa436e3d47
|
||||
|
||||
96
dev-python/openai/files/openai-2.44.0-mock-server-package-lock.json
generated
Normal file
96
dev-python/openai/files/openai-2.44.0-mock-server-package-lock.json
generated
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@stdy/cli": "0.22.1"
|
||||
}
|
||||
}
|
||||
167
dev-python/openai/openai-2.44.0.ebuild
Normal file
167
dev-python/openai/openai-2.44.0.ebuild
Normal file
@@ -0,0 +1,167 @@
|
||||
# Copyright 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 pypi
|
||||
|
||||
# See https://github.com/openai/openai-python/blob/main/.stats.yml
|
||||
API_SPEC_BASE="https://storage.googleapis.com/stainless-sdk-openapi-specs/openai"
|
||||
API_SPEC="openai-openapi-spec-${PV}.yml"
|
||||
MY_PN="openai-python"
|
||||
MY_P="${MY_PN}-${PV}"
|
||||
# See https://github.com/openai/openai-python/blob/main/scripts/mock
|
||||
STDY_PV=0.22.1
|
||||
DESCRIPTION="The official Python library for the openai API"
|
||||
HOMEPAGE="
|
||||
https://github.com/openai/openai-python
|
||||
https://pypi.org/project/openai/
|
||||
"
|
||||
SRC_URI="
|
||||
https://github.com/openai/${MY_PN}/archive/refs/tags/v${PV}.tar.gz
|
||||
-> ${MY_P}.gh.tar.gz
|
||||
|
||||
test? (
|
||||
${API_SPEC_BASE}/openai-b5b621065906a2579dc180db1236ee3b08a4fca9539accc2fbbf88da0ca3923f.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_P}"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~arm64"
|
||||
|
||||
RDEPEND="
|
||||
>=dev-python/anyio-3.5.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/distro-1.7.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/httpx-0.23.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/jiter-0.10.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/pydantic-1.9.0[${PYTHON_USEDEP}]
|
||||
dev-python/sniffio[${PYTHON_USEDEP}]
|
||||
>=dev-python/tqdm-4.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/typing-extensions-4.14[${PYTHON_USEDEP}]
|
||||
"
|
||||
|
||||
BDEPEND="
|
||||
dev-python/hatch-fancy-pypi-readme[${PYTHON_USEDEP}]
|
||||
test? (
|
||||
>=dev-python/botocore-1.42.97[${PYTHON_USEDEP}]
|
||||
dev-python/dirty-equals[${PYTHON_USEDEP}]
|
||||
dev-python/distro[${PYTHON_USEDEP}]
|
||||
dev-python/httpx-aiohttp[${PYTHON_USEDEP}]
|
||||
>=dev-python/importlib-metadata-6.7.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/jsonschema-4.23.0[${PYTHON_USEDEP}]
|
||||
net-libs/nodejs[npm]
|
||||
net-misc/curl
|
||||
)
|
||||
"
|
||||
|
||||
EPYTEST_PLUGINS=(
|
||||
inline-snapshot
|
||||
nest-asyncio
|
||||
pytest-{asyncio,xdist}
|
||||
respx
|
||||
time-machine
|
||||
)
|
||||
distutils_enable_tests pytest
|
||||
|
||||
src_unpack() {
|
||||
unpack "${MY_P}.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}-2.44.0-mock-server-package.json" \
|
||||
"${mock_dir}/package.json" || die
|
||||
cp "${FILESDIR}/${PN}-2.44.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
|
||||
}
|
||||
|
||||
python_test() {
|
||||
epytest -o asyncio_mode=auto
|
||||
}
|
||||
Reference in New Issue
Block a user