pythonPackages.openai: init at 0.11.4
This commit is contained in:
parent
4d31093afc
commit
3440beb11e
2 changed files with 57 additions and 0 deletions
55
pkgs/development/python-modules/openai/default.nix
Normal file
55
pkgs/development/python-modules/openai/default.nix
Normal file
|
@ -0,0 +1,55 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, pythonOlder
|
||||
|
||||
# Python dependencies
|
||||
, openpyxl
|
||||
, pandas
|
||||
, pandas-stubs
|
||||
, requests
|
||||
, tqdm
|
||||
|
||||
# Check dependencies
|
||||
, pytest-mock
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "openai";
|
||||
version = "0.11.4";
|
||||
|
||||
disabled = pythonOlder "3.7.1";
|
||||
|
||||
# Use GitHub source since PyPi source does not include tests
|
||||
src = fetchFromGitHub {
|
||||
owner = "openai";
|
||||
repo = "openai-python";
|
||||
rev = "v${version}";
|
||||
sha256 = "O2O4+GkyMyAxJqMNgiyPKoSXeJk0HGAst02QV6c9mJs=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
openpyxl
|
||||
pandas
|
||||
pandas-stubs
|
||||
requests
|
||||
tqdm
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "openai" ];
|
||||
checkInputs = [ pytestCheckHook pytest-mock ];
|
||||
pytestFlagsArray = [ "openai/tests" ];
|
||||
OPENAI_API_KEY = "sk-foo";
|
||||
disabledTestPaths = [
|
||||
"openai/tests/test_endpoints.py" # requires a real API key
|
||||
"openai/tests/test_file_cli.py"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Python client library for the OpenAI API";
|
||||
homepage = "https://github.com/openai/openai-python";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.malo ];
|
||||
};
|
||||
}
|
|
@ -5826,6 +5826,8 @@ in {
|
|||
|
||||
netmap = callPackage ../development/python-modules/netmap { };
|
||||
|
||||
openai = callPackage ../development/python-modules/openai { };
|
||||
|
||||
openapi-core = callPackage ../development/python-modules/openapi-core { };
|
||||
|
||||
pandas-stubs = callPackage ../development/python-modules/pandas-stubs { };
|
||||
|
|
Loading…
Reference in a new issue