python310Packages.openai: 0.23.0 -> 0.23.1

main
Fabian Affolter 2 years ago
parent 7e3eb4a0f9
commit df475f8b72
  1. 57
      pkgs/development/python-modules/openai/default.nix

@ -1,36 +1,35 @@
{ lib { lib
, buildPythonPackage , buildPythonPackage
, fetchFromGitHub , fetchFromGitHub
, pythonOlder , matplotlib
# Python dependencies
, numpy , numpy
, openpyxl , openpyxl
, pandas , pandas
, pandas-stubs , pandas-stubs
, plotly
, pytest-mock
, pytestCheckHook
, pythonOlder
, requests , requests
, scikit-learn , scikit-learn
, tenacity , tenacity
, tqdm , tqdm
, typing-extensions
, wandb , wandb
# Check dependencies
, pytest-mock
, pytestCheckHook
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "openai"; pname = "openai";
version = "0.23.0"; version = "0.23.1";
format = "setuptools";
disabled = pythonOlder "3.7.1"; disabled = pythonOlder "3.7.1";
# Use GitHub source since PyPi source does not include tests
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "openai"; owner = "openai";
repo = "openai-python"; repo = "openai-python";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-VH1XR2FocRX5AYpCruAKwQUXjXqvdJsVwKdtot5Bo+Y="; hash = "sha256-4RdER6ecvHGXTLZ1GnBNI1hIETI8O/t+kuOXiQhMigs=";
}; };
propagatedBuildInputs = [ propagatedBuildInputs = [
@ -39,18 +38,40 @@ buildPythonPackage rec {
pandas pandas
pandas-stubs pandas-stubs
requests requests
scikit-learn
tenacity
tqdm tqdm
wandb typing-extensions
];
passthru.optional-dependencies = {
wandb = [
wandb
];
embeddings = [
matplotlib
plotly
scikit-learn
tenacity
];
};
pythonImportsCheck = [
"openai"
];
checkInputs = [
pytestCheckHook
pytest-mock
];
pytestFlagsArray = [
"openai/tests"
]; ];
pythonImportsCheck = [ "openai" ];
checkInputs = [ pytestCheckHook pytest-mock ];
pytestFlagsArray = [ "openai/tests" ];
OPENAI_API_KEY = "sk-foo"; OPENAI_API_KEY = "sk-foo";
disabledTestPaths = [ disabledTestPaths = [
"openai/tests/test_endpoints.py" # requires a real API key # Requires a real API key
"openai/tests/test_endpoints.py"
"openai/tests/test_file_cli.py" "openai/tests/test_file_cli.py"
]; ];
@ -58,6 +79,6 @@ buildPythonPackage rec {
description = "Python client library for the OpenAI API"; description = "Python client library for the OpenAI API";
homepage = "https://github.com/openai/openai-python"; homepage = "https://github.com/openai/openai-python";
license = licenses.mit; license = licenses.mit;
maintainers = [ maintainers.malo ]; maintainers = with maintainers; [ malo ];
}; };
} }

Loading…
Cancel
Save