mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-04-07 03:10:15 -04:00
dev-python/openai: new package, add 2.29.0
Signed-off-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
This commit is contained in:
5
dev-python/openai/Manifest
Normal file
5
dev-python/openai/Manifest
Normal file
@@ -0,0 +1,5 @@
|
||||
DIST npm-@stdy-cli-cli-0.19.7.tgz 7773 BLAKE2B 6ddc9db08ab06ef1ece58d3aeaf27517319a399262a63caa06e2d13a1bd8c83fac298a451f0ea57a71aaf9c4120f4efb742308106498d492d2593a4b58e04151 SHA512 ba4758dbe0d32e7c9994471713d0ae9a0967813bd1ec8fbce88247c2582ea248196f7858b56ce76e0716e016d5366b42700a78b603626d8de00e5a92599e009e
|
||||
DIST npm-@stdy-cli-linux-arm64-cli-linux-arm64-0.19.7.tgz 36812291 BLAKE2B b0c8fba73598ce1e6aa824ffefd237eb35875879308820ef1aeeba9ba80378ef346ef9ffd40107b1b9d7754cd8acac1076d74a55fddbf3cbad9881cb8b19b0be SHA512 8b9cb95aadbbba48b2531451cf991b9d067b6ef697a38ff2b3df72d82d3967c1ab1e29274dee23283557c47e881ee0cb12e5223163d1fec06ecea96fdaecfda4
|
||||
DIST npm-@stdy-cli-linux-x64-cli-linux-x64-0.19.7.tgz 37584041 BLAKE2B b9b6bee19fdf51c985d907b7dc8638ab3d3ebf88083794fb0d39a5f6c64beffbaf321cd71fc2869812092c0504fa47e3b889d0ffe483622fd215d214e4c1645e SHA512 2719af63c71ad21293bd3cac5d19f6b0ca960d0888026d9ffa5a62467d5d434d8937edb0ce90d467fdd348ba40b6f96a3ccd5e9c6b551b75a7de79d5fcc40df1
|
||||
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
|
||||
96
dev-python/openai/files/openai-2.29.0-mock-server-package-lock.json
generated
Normal file
96
dev-python/openai/files/openai-2.29.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.19.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@stdy/cli": {
|
||||
"version": "0.19.7",
|
||||
"resolved": "https://registry.npmjs.org/@stdy/cli/-/cli-0.19.7.tgz",
|
||||
"integrity": "sha512-ukdY2+DTLnyZlEcXE9CumglngTvR7I+86IJHwlguokgZb3hYtWznbgcW4BbVNmtCcAp4tgNibY3gDlqSWZ4Ang==",
|
||||
"license": "Elastic-2.0",
|
||||
"bin": {
|
||||
"steady": "steady.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@stdy/cli-darwin-arm64": "0.19.7",
|
||||
"@stdy/cli-darwin-x64": "0.19.7",
|
||||
"@stdy/cli-linux-arm64": "0.19.7",
|
||||
"@stdy/cli-linux-x64": "0.19.7",
|
||||
"@stdy/cli-win32-x64": "0.19.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@stdy/cli-darwin-arm64": {
|
||||
"version": "0.19.7",
|
||||
"resolved": "https://registry.npmjs.org/@stdy/cli-darwin-arm64/-/cli-darwin-arm64-0.19.7.tgz",
|
||||
"integrity": "sha512-baIrUrzhOgQmMOaOhrYZ0v95yMt5P26qeZdE+I79zaJbETjF8vM63AM+XHn7jVPulORG8lD+n90kyYfo20t9aA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "Elastic-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@stdy/cli-darwin-x64": {
|
||||
"version": "0.19.7",
|
||||
"resolved": "https://registry.npmjs.org/@stdy/cli-darwin-x64/-/cli-darwin-x64-0.19.7.tgz",
|
||||
"integrity": "sha512-3qEi400gNuY564Ku8Bru1h36vhfsrfk7IrukZgcovHVi3ANMLSMGsINgE+HM77patSlmB/fAgHWORZzHfn5ftg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Elastic-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@stdy/cli-linux-arm64": {
|
||||
"version": "0.19.7",
|
||||
"resolved": "https://registry.npmjs.org/@stdy/cli-linux-arm64/-/cli-linux-arm64-0.19.7.tgz",
|
||||
"integrity": "sha512-i5y5Wq27ukiyUxRRz5kbnQZ7bvaXo4/ys99y2C05Z8GrHiknTe4jKDVXxH6IHuDLEuUiMWPR/sBuzqlv2uz9pA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "Elastic-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@stdy/cli-linux-x64": {
|
||||
"version": "0.19.7",
|
||||
"resolved": "https://registry.npmjs.org/@stdy/cli-linux-x64/-/cli-linux-x64-0.19.7.tgz",
|
||||
"integrity": "sha512-JxmvY8ca0hKTvTysXRn2sMqWDQiIAm2f+lpiRn1dQ02JN+2wzpDUZ/3TSLpAtvlqPM1enGtVG3Wn3nnV/MQN8Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Elastic-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@stdy/cli-win32-x64": {
|
||||
"version": "0.19.7",
|
||||
"resolved": "https://registry.npmjs.org/@stdy/cli-win32-x64/-/cli-win32-x64-0.19.7.tgz",
|
||||
"integrity": "sha512-FNhuOpiglzJLT95sn+jOVc31M0r12H+hJ9C1mJsTckDJHu39Rq8h6ZcaL+oP2wXkkxipdAprj3m/jgpiFbcVgQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Elastic-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@stdy/cli": "^0.19.7"
|
||||
}
|
||||
}
|
||||
12
dev-python/openai/metadata.xml
Normal file
12
dev-python/openai/metadata.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>falbrechtskirchinger@gmail.com</email>
|
||||
<name>Florian Albrechtskirchinger</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="pypi">openai</remote-id>
|
||||
<remote-id type="github">openai/openai-python</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
149
dev-python/openai/openai-2.29.0.ebuild
Normal file
149
dev-python/openai/openai-2.29.0.ebuild
Normal file
@@ -0,0 +1,149 @@
|
||||
# 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
|
||||
|
||||
API_SPEC_BASE="https://storage.googleapis.com/stainless-sdk-openapi-specs"
|
||||
API_SPEC="openai-openapi-spec-v2.3.0.yml"
|
||||
MY_PN="openai-python"
|
||||
STDY_PV=0.19.7
|
||||
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_PN}-${PV}.gh.tar.gz
|
||||
|
||||
test? (
|
||||
${API_SPEC_BASE}/openai%2Fopenai-00994178cc8e20d71754b00c54b0e4f5b4128e1c1cce765e9b7d696bd8c80d33.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="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/distro[${PYTHON_USEDEP}]
|
||||
dev-python/httpx-aiohttp[${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_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}-2.29.0-mock-server-package.json" \
|
||||
"${mock_dir}/package.json" || die
|
||||
cp "${FILESDIR}/${PN}-2.29.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=$!
|
||||
|
||||
local attempts=0
|
||||
while ! curl -sf "http://127.0.0.1:4010/_x-steady/health" &>/dev/null; do
|
||||
if ! kill -0 ${mock_pid} 2>/dev/null; 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
|
||||
|
||||
popd >/dev/null || die
|
||||
|
||||
nonfatal distutils-r1_src_test
|
||||
local ret=${?}
|
||||
|
||||
einfo "Stopping mock server..."
|
||||
kill "${mock_pid}" || die
|
||||
|
||||
[[ ${ret} -ne 0 ]] && die
|
||||
}
|
||||
|
||||
python_test() {
|
||||
epytest -o asyncio_mode=auto
|
||||
}
|
||||
Reference in New Issue
Block a user