nixpkgs/pkgs/development/python-modules/openai/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

87 lines
1.4 KiB
Nix
Raw Normal View History

2021-12-11 00:52:49 +00:00
{ lib
, buildPythonPackage
, fetchFromGitHub
, matplotlib
2022-08-01 21:41:33 +00:00
, numpy
2021-12-11 00:52:49 +00:00
, openpyxl
, pandas
, pandas-stubs
, plotly
, pytest-mock
, pytestCheckHook
, pythonOlder
2021-12-11 00:52:49 +00:00
, requests
2022-08-01 21:41:33 +00:00
, scikit-learn
, tenacity
2021-12-11 00:52:49 +00:00
, tqdm
, typing-extensions
, wandb
2021-12-11 00:52:49 +00:00
}:
buildPythonPackage rec {
pname = "openai";
2022-11-03 19:46:39 +00:00
version = "0.25.0";
format = "setuptools";
2021-12-11 00:52:49 +00:00
disabled = pythonOlder "3.7.1";
src = fetchFromGitHub {
owner = "openai";
repo = "openai-python";
rev = "v${version}";
2022-11-03 19:46:39 +00:00
hash = "sha256-bwv7lpdDYlk+y3KBjv7cSvaGr3v02riNCUfPFh6yv1I=";
2021-12-11 00:52:49 +00:00
};
propagatedBuildInputs = [
2022-08-01 21:41:33 +00:00
numpy
2021-12-11 00:52:49 +00:00
openpyxl
pandas
pandas-stubs
requests
tqdm
typing-extensions
];
passthru.optional-dependencies = {
wandb = [
wandb
];
embeddings = [
matplotlib
plotly
scikit-learn
tenacity
];
};
pythonImportsCheck = [
"openai"
];
checkInputs = [
pytestCheckHook
pytest-mock
];
pytestFlagsArray = [
"openai/tests"
2021-12-11 00:52:49 +00:00
];
OPENAI_API_KEY = "sk-foo";
2021-12-11 00:52:49 +00:00
disabledTestPaths = [
# Requires a real API key
"openai/tests/test_endpoints.py"
2022-10-21 19:03:44 +00:00
# openai: command not found
2021-12-11 00:52:49 +00:00
"openai/tests/test_file_cli.py"
2022-10-21 19:03:44 +00:00
"openai/tests/test_long_examples_validator.py"
2021-12-11 00:52:49 +00:00
];
meta = with lib; {
description = "Python client library for the OpenAI API";
homepage = "https://github.com/openai/openai-python";
license = licenses.mit;
maintainers = with maintainers; [ malo ];
2021-12-11 00:52:49 +00:00
};
}