Merge pull request #287983 from fabaff/openai-fix

python311Packages.openai: 1.11.0 -> 1.12.0
This commit is contained in:
Fabian Affolter 2024-02-19 15:54:22 +01:00 committed by GitHub
commit 939ae61db5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 310 additions and 66 deletions

View File

@ -8,7 +8,7 @@ with python3.pkgs;
buildPythonPackage rec {
pname = "shell-genie";
version = "0.2.10";
format = "pyproject";
pyproject = true;
src = fetchPypi {
pname = "shell_genie";
@ -17,6 +17,7 @@ buildPythonPackage rec {
};
pythonRelaxDeps = [
"openai"
"typer"
];

View File

@ -1,41 +1,45 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, click
, fetchFromGitHub
, pytestCheckHook
, pythonOlder
, flit-core
}:
buildPythonPackage rec {
pname = "click-default-group";
version = "1.2.2";
format = "setuptools";
version = "1.2.4";
pyproject = true;
disabled = pythonOlder "3.7";
# No tests in Pypi tarball
src = fetchFromGitHub {
owner = "click-contrib";
repo = "click-default-group";
rev = "v${version}";
sha256 = "0nk39lmkn208w8kvq6f4h3a6qzxrrvxixahpips6ik3zflbkss86";
rev = "refs/tags/v${version}";
hash = "sha256-9Vk4LdgLDAWG2YCQPLKR6PIVnULmpOoe7RtS8DgWARo=";
};
patches = [
# make tests compatible with click 8
(fetchpatch {
url = "https://github.com/click-contrib/click-default-group/commit/9415c77d05cf7d16876e7d70a49a41a6189983b4.patch";
sha256 = "1czzma8nmwyxhwhnr8rfw5bjw6d46b3s5r5bfb8ly3sjwqjlwhw2";
})
nativeBuildInputs = [
flit-core
];
propagatedBuildInputs = [ click ];
propagatedBuildInputs = [
click
];
nativeCheckInputs = [ pytestCheckHook ];
nativeCheckInputs = [
pytestCheckHook
];
pythonImportsCheck = [ "click_default_group" ];
pythonImportsCheck = [
"click_default_group"
];
meta = with lib; {
homepage = "https://github.com/click-contrib/click-default-group";
description = "Group to invoke a command without explicit subcommand name";
homepage = "https://github.com/click-contrib/click-default-group";
license = licenses.bsd3;
maintainers = with maintainers; [ jakewaksbaum ];
};

View File

@ -0,0 +1,65 @@
{ lib
, buildPythonPackage
, email-validator
, fastapi
, fetchFromGitHub
, httpx
, oauthlib
, poetry-core
, pydantic
, pylint
, pytest-asyncio
, pytest-xdist
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "fastapi-sso";
version = "0.11.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "tomasvotava";
repo = "fastapi-sso";
rev = "refs/tags/${version}";
hash = "sha256-bz4rr7h90d/QkBBqQN1pLF8ANhOiq2v0Vv2pjBGpeTs=";
};
postPatch = ''
sed -i "/--cov/d" pyproject.toml
'';
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
fastapi
httpx
oauthlib
pydantic
pylint
];
nativeCheckInputs = [
email-validator
pytest-asyncio
pytest-xdist
pytestCheckHook
];
pythonImportsCheck = [
"fastapi_sso"
];
meta = with lib; {
description = "FastAPI plugin to enable SSO to most common providers (such as Facebook login, Google login and login via Microsoft Office 365 Account";
homepage = "https://github.com/tomasvotava/fastapi-sso";
changelog = "https://github.com/tomasvotava/fastapi-sso/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
}

View File

@ -17,7 +17,7 @@
buildPythonPackage rec {
pname = "langchain-community";
version = "0.0.16";
version = "0.0.19";
pyproject = true;
disabled = pythonOlder "3.8";
@ -25,7 +25,7 @@ buildPythonPackage rec {
src = fetchPypi {
pname = "langchain_community";
inherit version;
hash = "sha256-wGUSqTAToG+6dnnNWhJU/4uSfN3S0fvgzERL97vfC4w=";
hash = "sha256-XRitnhiLEKq6Y2H7KnR88ptksh/7gGGTP+wJAYfKOcI=";
};
nativeBuildInputs = [

View File

@ -8,6 +8,7 @@
, langsmith
, packaging
, pydantic
, pythonRelaxDepsHook
, pyyaml
, requests
, tenacity
@ -15,7 +16,7 @@
buildPythonPackage rec {
pname = "langchain-core";
version = "0.1.16";
version = "0.1.22";
pyproject = true;
disabled = pythonOlder "3.8";
@ -23,11 +24,16 @@ buildPythonPackage rec {
src = fetchPypi {
pname = "langchain_core";
inherit version;
hash = "sha256-jLVG7tMYAJ7hqKOB0QgHTt3wOVrmHrJD2wDXbh4mXok=";
hash = "sha256-3qwSs+QqCLu6oqz4PV+N0tVRMlbY2vDoU+nWj/TJnXk=";
};
pythonRelaxDeps = [
"langsmith"
];
nativeBuildInputs = [
poetry-core
pythonRelaxDepsHook
];
propagatedBuildInputs = [
@ -41,7 +47,9 @@ buildPythonPackage rec {
tenacity
];
pythonImportsCheck = [ "langchain_core" ];
pythonImportsCheck = [
"langchain_core"
];
# PyPI source does not have tests
doCheck = false;

View File

@ -52,7 +52,7 @@
buildPythonPackage rec {
pname = "langchain";
version = "0.1.1";
version = "0.1.6";
pyproject = true;
disabled = pythonOlder "3.8";
@ -61,7 +61,7 @@ buildPythonPackage rec {
owner = "langchain-ai";
repo = "langchain";
rev = "refs/tags/v${version}";
hash = "sha256-cQz4u6FeVZLNbix4pyc6ulfj+nb/tARMJniusy7Q46A=";
hash = "sha256-DMUf1dW1/Xl8OKRDb2o9NFgFE4rEgsCBZEPejGz1tQQ=";
};
sourceRoot = "${src.name}/libs/langchain";

View File

@ -1,4 +1,5 @@
{ lib
, attr
, buildPythonPackage
, fetchFromGitHub
, freezegun
@ -12,7 +13,7 @@
buildPythonPackage rec {
pname = "langsmith";
version = "0.0.83";
version = "0.0.90";
pyproject = true;
disabled = pythonOlder "3.8";
@ -21,7 +22,7 @@ buildPythonPackage rec {
owner = "langchain-ai";
repo = "langsmith-sdk";
rev = "refs/tags/v${version}";
hash = "sha256-WRrwekh4pcn3I0U/A2Q91ePrRx2RUC3XX+z4bez0BzU=";
hash = "sha256-YZykHDu++cEoLmV9PvzowA4j2UpteFJfzr6+3VlbPME=";
};
sourceRoot = "${src.name}/python";
@ -36,6 +37,7 @@ buildPythonPackage rec {
];
nativeCheckInputs = [
attr
freezegun
pytest-asyncio
pytestCheckHook
@ -51,11 +53,17 @@ buildPythonPackage rec {
"test_as_runnable_async_batch"
# requires git repo
"test_git_info"
# Tests require OpenAI API key
"test_chat_async_api"
"test_chat_sync_api"
"test_completions_async_api"
"test_completions_sync_api"
];
disabledTestPaths = [
# due to circular import
"tests/integration_tests/test_client.py"
"tests/unit_tests/test_client.py"
];
pythonImportsCheck = [

View File

@ -1,31 +1,48 @@
{ lib
, aiohttp
, apscheduler
, azure-identity
, azure-keyvault-secrets
, backoff
, buildPythonPackage
, click
, fastapi
, fastapi-sso
, fetchFromGitHub
, poetry-core
, google-cloud-kms
, gunicorn
, importlib-metadata
, jinja2
, openai
, orjson
, poetry-core
, prisma
, pyjwt
, python-dotenv
, python-multipart
, pythonOlder
, pyyaml
, requests
, resend
, rq
, streamlit
, tiktoken
, tokenizers
, click
, jinja2
, certifi
, appdirs
, aiohttp
, uvicorn
}:
let
version = "1.23.0";
in
buildPythonPackage {
buildPythonPackage rec {
pname = "litellm";
inherit version;
version = "1.23.9";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "BerriAI";
repo = "litellm";
rev = "refs/tags/v${version}";
hash = "sha256-Pl3Fet0TvGrNHNw4ssUMqa+UhzBYgqTydNfD96TeY7I=";
hash = "sha256-5VqYo9JhRwtPnk0z7w7jFKN8/E2JhZ50Zi4HgbFiyhE=";
};
postPatch = ''
@ -37,18 +54,41 @@ buildPythonPackage {
];
propagatedBuildInputs = [
aiohttp
click
importlib-metadata
jinja2
openai
requests
python-dotenv
tiktoken
importlib-metadata
tokenizers
click
jinja2
certifi
appdirs
aiohttp
];
passthru.optional-dependencies = {
proxy = [
apscheduler
backoff
fastapi
fastapi-sso
gunicorn
orjson
pyjwt
python-multipart
pyyaml
rq
uvicorn
];
extra_proxy = [
azure-identity
azure-keyvault-secrets
google-cloud-kms
prisma
resend
streamlit
];
};
# the import check phase fails trying to do a network request to openai
# pythonImportsCheck = [ "litellm" ];
@ -58,8 +98,8 @@ buildPythonPackage {
meta = with lib; {
description = "Use any LLM as a drop in replacement for gpt-3.5-turbo. Use Azure, OpenAI, Cohere, Anthropic, Ollama, VLLM, Sagemaker, HuggingFace, Replicate (100+ LLMs)";
homepage = "https://github.com/BerriAI/litellm";
license = licenses.mit;
changelog = "https://github.com/BerriAI/litellm/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ happysalada ];
};
}

View File

@ -1,27 +1,27 @@
{
buildPythonApplication,
buildPythonPackage,
fetchFromGitHub,
lib,
makeWrapper,
pytestCheckHook,
python3,
pythonOlder,
ruff,
setuptools,
}: let
{ lib
, buildPythonApplication
, buildPythonPackage
, fetchFromGitHub
, makeWrapper
, pytestCheckHook
, python3
, pythonOlder
, ruff
, setuptools
}:
let
llm = buildPythonPackage rec {
pname = "llm";
version = "0.12";
version = "0.13.1";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "simonw";
repo = pname;
repo = "llm";
rev = "refs/tags/${version}";
hash = "sha256-aCqdw2co/cXrBwVY/k/aSLl3C22nlH5LvU2yir1/NnQ=";
hash = "sha256-Nq6pduzl8IK+nA3pctst/W4ux7+P6mBFTEHMF+vtBQw=";
};
patches = [
@ -36,6 +36,7 @@
click-default-group
numpy
openai
pip
pluggy
pydantic
python-ulid
@ -48,8 +49,8 @@
nativeCheckInputs = with python3.pkgs; [
cogapp
numpy
pytest-httpx
pytestCheckHook
requests-mock
];
doCheck = true;

View File

@ -26,7 +26,7 @@
buildPythonPackage rec {
pname = "openai";
version = "1.11.1";
version = "1.12.0";
pyproject = true;
disabled = pythonOlder "3.7.1";
@ -35,7 +35,7 @@ buildPythonPackage rec {
owner = "openai";
repo = "openai-python";
rev = "refs/tags/v${version}";
hash = "sha256-PtxKQQfcM4aOlqU0qIJDpB/24Wkt/omx+uDk4mRZU4s=";
hash = "sha256-v623+dxttNDAfVh+2h64SqT4FvaOGRe0zvHCchIy/Wg=";
};
nativeBuildInputs = [
@ -75,12 +75,13 @@ buildPythonPackage rec {
];
disabledTests = [
# makes network requests
# Tests make network requests
"test_streaming_response"
"test_copy_build_request"
];
disabledTestPaths = [
# makes network requests
# Test makes network requests
"tests/api_resources"
];

View File

@ -0,0 +1,63 @@
{ lib
, buildPythonPackage
, click
, fetchFromGitHub
, httpx
, jinja2
, nodeenv
, pydantic
, pytestCheckHook
, python-dotenv
, pythonOlder
, setuptools
, strenum
, tomlkit
, typing-extensions
}:
buildPythonPackage rec {
pname = "prisma";
version = "0.12.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "RobertCraigie";
repo = "prisma-client-py";
rev = "refs/tags/v${version}";
hash = "sha256-vmcYBUPDhFbxgWyrF+AjoXwAAH2R/tJYttFD+41bPbA=";
};
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
click
httpx
jinja2
nodeenv
pydantic
python-dotenv
tomlkit
typing-extensions
] ++ lib.optionals (pythonOlder "3.11") [
strenum
];
# Building the client requires network access
doCheck = false;
pythonImportsCheck = [
"prisma"
];
meta = with lib; {
description = "Auto-generated and fully type-safe database client for prisma";
homepage = "https://github.com/RobertCraigie/prisma-client-py";
changelog = "https://github.com/RobertCraigie/prisma-client-py/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ fab ];
};
}

View File

@ -0,0 +1,47 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, setuptools
, pythonOlder
, pytestCheckHook
, requests
}:
buildPythonPackage rec {
pname = "resend";
version = "0.7.2";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "resend";
repo = "resend-python";
rev = "refs/tags/v${version}";
hash = "sha256-3wX2xNz/6Erv97TlQCuF0Sha0fbJJX1LK9dx8xYG4M0=";
};
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
requests
];
nativeCheckInputs = [
pytestCheckHook
];
pythonImportsCheck = [
"resend"
];
meta = with lib; {
description = "SDK for Resend";
homepage = "https://github.com/resend/resend-python";
changelog = "https://github.com/resend/resend-python/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
}

View File

@ -3949,6 +3949,8 @@ self: super: with self; {
fastapi-mail = callPackage ../development/python-modules/fastapi-mail { };
fastapi-sso = callPackage ../development/python-modules/fastapi-sso { };
fast-histogram = callPackage ../development/python-modules/fast-histogram { };
fastavro = callPackage ../development/python-modules/fastavro { };
@ -9919,6 +9921,8 @@ self: super: with self; {
priority = callPackage ../development/python-modules/priority { };
prisma = callPackage ../development/python-modules/prisma { };
prison = callPackage ../development/python-modules/prison { };
proboscis = callPackage ../development/python-modules/proboscis { };
@ -12694,6 +12698,8 @@ self: super: with self; {
resampy = callPackage ../development/python-modules/resampy { };
resend = callPackage ../development/python-modules/resend { };
resize-right = callPackage ../development/python-modules/resize-right { };
resolvelib = callPackage ../development/python-modules/resolvelib { };